From owner-svn-src-head@FreeBSD.ORG Sun Aug 21 10:52:50 2011 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 D17451065670; Sun, 21 Aug 2011 10:52:50 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C20AB8FC08; Sun, 21 Aug 2011 10:52:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7LAqo3a000913; Sun, 21 Aug 2011 10:52:50 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7LAqoJJ000911; Sun, 21 Aug 2011 10:52:50 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201108211052.p7LAqoJJ000911@svn.freebsd.org> From: Attilio Rao Date: Sun, 21 Aug 2011 10:52: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: r225057 - 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, 21 Aug 2011 10:52:50 -0000 Author: attilio Date: Sun Aug 21 10:52:50 2011 New Revision: 225057 URL: http://svn.freebsd.org/changeset/base/225057 Log: callout_cpu_switch() allows preemption when dropping the outcoming callout cpu lock (and after having dropped it). If the newly scheduled thread wants to acquire the old queue it will just spin forever. Fix this by disabling preemption and interrupts entirely (because fast interrupt handlers may incur in the same problem too) while switching locks. Reported by: hrs, Mike Tancsa , Chip Camden Tested by: hrs, Mike Tancsa , Chip Camden , Nicholas Esborn Approved by: re (kib) MFC after: 10 days Modified: head/sys/kern/kern_timeout.c Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Sun Aug 21 10:05:39 2011 (r225056) +++ head/sys/kern/kern_timeout.c Sun Aug 21 10:52:50 2011 (r225057) @@ -269,10 +269,17 @@ callout_cpu_switch(struct callout *c, st MPASS(c != NULL && cc != NULL); CC_LOCK_ASSERT(cc); + /* + * Avoid interrupts and preemption firing after the callout cpu + * is blocked in order to avoid deadlocks as the new thread + * may be willing to acquire the callout cpu lock. + */ c->c_cpu = CPUBLOCK; + spinlock_enter(); CC_UNLOCK(cc); new_cc = CC_CPU(new_cpu); CC_LOCK(new_cc); + spinlock_exit(); c->c_cpu = new_cpu; return (new_cc); } From owner-svn-src-head@FreeBSD.ORG Sun Aug 21 18:49:28 2011 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 EBB151065672; Sun, 21 Aug 2011 18:49:28 +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 D9F908FC16; Sun, 21 Aug 2011 18:49:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7LInSBk015321; Sun, 21 Aug 2011 18:49:28 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7LInS4A015318; Sun, 21 Aug 2011 18:49:28 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201108211849.p7LInS4A015318@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 21 Aug 2011 18:49: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: r225065 - head/usr.sbin/bsdinstall/scripts 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, 21 Aug 2011 18:49:29 -0000 Author: nwhitehorn Date: Sun Aug 21 18:49:28 2011 New Revision: 225065 URL: http://svn.freebsd.org/changeset/base/225065 Log: Make messages about typos appear on the screen instead of in the log file. Reported by: lev Approved by: re (kib) Modified: head/usr.sbin/bsdinstall/scripts/adduser head/usr.sbin/bsdinstall/scripts/rootpass Modified: head/usr.sbin/bsdinstall/scripts/adduser ============================================================================== --- head/usr.sbin/bsdinstall/scripts/adduser Sun Aug 21 18:23:09 2011 (r225064) +++ head/usr.sbin/bsdinstall/scripts/adduser Sun Aug 21 18:49:28 2011 (r225065) @@ -31,4 +31,4 @@ echo "FreeBSD Installer" echo "========================" echo "Add Users" echo -chroot $BSDINSTALL_CHROOT adduser +chroot $BSDINSTALL_CHROOT adduser 2>&1 Modified: head/usr.sbin/bsdinstall/scripts/rootpass ============================================================================== --- head/usr.sbin/bsdinstall/scripts/rootpass Sun Aug 21 18:23:09 2011 (r225064) +++ head/usr.sbin/bsdinstall/scripts/rootpass Sun Aug 21 18:49:28 2011 (r225065) @@ -33,5 +33,5 @@ echo echo "Please select a password for the system management account (root):" -chroot $BSDINSTALL_CHROOT passwd root +chroot $BSDINSTALL_CHROOT passwd root 2>&1 From owner-svn-src-head@FreeBSD.ORG Sun Aug 21 18:50:30 2011 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 6EA1C106566B; Sun, 21 Aug 2011 18:50: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 5B6CC8FC14; Sun, 21 Aug 2011 18:50:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7LIoURI015397; Sun, 21 Aug 2011 18:50:30 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7LIoUii015392; Sun, 21 Aug 2011 18:50:30 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201108211850.p7LIoUii015392@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 21 Aug 2011 18:50: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: r225066 - head/usr.sbin/bsdinstall/partedit 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, 21 Aug 2011 18:50:30 -0000 Author: nwhitehorn Date: Sun Aug 21 18:50:30 2011 New Revision: 225066 URL: http://svn.freebsd.org/changeset/base/225066 Log: Implement support for GRAID volumes in the installer partition editor, rename a few options, clarify some help text, and add help text for the buttons on the main partition editor screen. Approved by: re (kib) Modified: head/usr.sbin/bsdinstall/partedit/diskeditor.c head/usr.sbin/bsdinstall/partedit/gpart_ops.c head/usr.sbin/bsdinstall/partedit/part_wizard.c head/usr.sbin/bsdinstall/partedit/partedit.c Modified: head/usr.sbin/bsdinstall/partedit/diskeditor.c ============================================================================== --- head/usr.sbin/bsdinstall/partedit/diskeditor.c Sun Aug 21 18:49:28 2011 (r225065) +++ head/usr.sbin/bsdinstall/partedit/diskeditor.c Sun Aug 21 18:50:30 2011 (r225066) @@ -65,7 +65,12 @@ diskeditor_show(const char *title, const WINDOW *dialog, *partitions; char *prompt; const char *buttons[] = - { "Create", "Delete", "Modify", "Revert", "Auto", "Exit", NULL }; + { "Create", "Delete", "Modify", "Revert", "Auto", "Finish", NULL }; + const char *help_text[] = { + "Add a new partition", "Delete selected partition or partitions", + "Change partition type or mountpoint", + "Revert changes to disk setup", "Use guided partitioning tool", + "Exit partitioner (will ask whether to save changes)", NULL }; int x, y; int i; int height, width, min_width; @@ -125,6 +130,7 @@ diskeditor_show(const char *title, const dlg_register_buttons(partitions, "partlist", buttons); wattrset(partitions, menubox_attr); + dlg_item_help(help_text[cur_button]); dlg_draw_buttons(dialog, height - 2*MARGIN, 0, buttons, cur_button, FALSE, width); dlg_print_autowrap(dialog, prompt, height, width); @@ -154,6 +160,7 @@ repaint: key = dlg_mouse_wgetch(dialog, &fkey); if ((i = dlg_char_to_button(key, buttons)) >= 0) { cur_button = i; + dlg_item_help(help_text[cur_button]); dlg_draw_buttons(dialog, height - 2*MARGIN, 0, buttons, cur_button, FALSE, width); break; @@ -167,6 +174,7 @@ repaint: cur_button = dlg_next_button(buttons, cur_button); if (cur_button < 0) cur_button = 0; + dlg_item_help(help_text[cur_button]); dlg_draw_buttons(dialog, height - 2*MARGIN, 0, buttons, cur_button, FALSE, width); break; @@ -174,6 +182,7 @@ repaint: cur_button = dlg_prev_button(buttons, cur_button); if (cur_button < 0) cur_button = 0; + dlg_item_help(help_text[cur_button]); dlg_draw_buttons(dialog, height - 2*MARGIN, 0, buttons, cur_button, FALSE, width); break; @@ -215,6 +224,8 @@ repaint: cur_scroll += (partlist_height - 2); if (cur_scroll + partlist_height - 2 >= nitems) cur_scroll = nitems - (partlist_height - 2); + if (cur_scroll < 0) + cur_scroll = 0; if (cur_part < cur_scroll) cur_part = cur_scroll; goto repaint; @@ -231,6 +242,8 @@ repaint: goto repaint; case DLGK_PAGE_LAST: cur_scroll = nitems - (partlist_height - 2); + if (cur_scroll < 0) + cur_scroll = 0; cur_part = cur_scroll; goto repaint; case DLGK_ENTER: @@ -238,6 +251,7 @@ repaint: default: if (is_DLGK_MOUSE(key)) { cur_button = key - M_EVENT; + dlg_item_help(help_text[cur_button]); dlg_draw_buttons(dialog, height - 2*MARGIN, 0, buttons, cur_button, FALSE, width); goto done; Modified: head/usr.sbin/bsdinstall/partedit/gpart_ops.c ============================================================================== --- head/usr.sbin/bsdinstall/partedit/gpart_ops.c Sun Aug 21 18:49:28 2011 (r225065) +++ head/usr.sbin/bsdinstall/partedit/gpart_ops.c Sun Aug 21 18:50:30 2011 (r225066) @@ -472,7 +472,7 @@ gpart_edit(struct gprovider *pp) if (geom == NULL) { /* Disk not partitioned, so partition it */ - gpart_partition(pp->lg_geom->lg_name, NULL); + gpart_partition(pp->lg_name, NULL); return; } @@ -791,7 +791,7 @@ gpart_create(struct gprovider *pp, char } if (geom == NULL || scheme == NULL || strcmp(scheme, "(none)") == 0) { - if (gpart_partition(pp->lg_geom->lg_name, NULL) == 0) + if (gpart_partition(pp->lg_name, NULL) == 0) dialog_msgbox("", "The partition table has been successfully created." " Please press Create again to create partitions.", @@ -820,8 +820,10 @@ gpart_create(struct gprovider *pp, char items[1].text = sizestr; /* Special-case the MBR default type for nested partitions */ - if (strcmp(scheme, "MBR") == 0 || strcmp(scheme, "PC98") == 0) + if (strcmp(scheme, "MBR") == 0 || strcmp(scheme, "PC98") == 0) { items[0].text = "freebsd"; + items[0].help = "Filesystem type (e.g. freebsd, fat32)"; + } nitems = scheme_supports_labels(scheme) ? 4 : 3; Modified: head/usr.sbin/bsdinstall/partedit/part_wizard.c ============================================================================== --- head/usr.sbin/bsdinstall/partedit/part_wizard.c Sun Aug 21 18:49:28 2011 (r225065) +++ head/usr.sbin/bsdinstall/partedit/part_wizard.c Sun Aug 21 18:50:30 2011 (r225066) @@ -96,6 +96,7 @@ boot_disk(struct gmesh *mesh) LIST_FOREACH(classp, &mesh->lg_class, lg_class) { if (strcmp(classp->lg_name, "DISK") != 0 && + strcmp(classp->lg_name, "RAID") != 0 && strcmp(classp->lg_name, "MD") != 0) continue; @@ -169,6 +170,7 @@ provider_for_name(struct gmesh *mesh, co LIST_FOREACH(classp, &mesh->lg_class, lg_class) { if (strcmp(classp->lg_name, "DISK") != 0 && strcmp(classp->lg_name, "PART") != 0 && + strcmp(classp->lg_name, "RAID") != 0 && strcmp(classp->lg_name, "MD") != 0) continue; Modified: head/usr.sbin/bsdinstall/partedit/partedit.c ============================================================================== --- head/usr.sbin/bsdinstall/partedit/partedit.c Sun Aug 21 18:49:28 2011 (r225065) +++ head/usr.sbin/bsdinstall/partedit/partedit.c Sun Aug 21 18:50:30 2011 (r225066) @@ -50,8 +50,24 @@ static void init_fstab_metadata(void); static void get_mount_points(struct partedit_item *items, int nitems); static int validate_setup(void); +static void +sigint_handler(int sig) +{ + struct gmesh mesh; + + /* Revert all changes and exit dialog-mode cleanly on SIGINT */ + geom_gettree(&mesh); + gpart_revert_all(&mesh); + geom_deletetree(&mesh); + + end_dialog(); + + exit(1); +} + int -main(int argc, const char **argv) { +main(int argc, const char **argv) +{ struct partition_metadata *md; const char *prompt; struct partedit_item *items; @@ -69,13 +85,16 @@ main(int argc, const char **argv) { dialog_vars.item_help = TRUE; nscroll = i = 0; + /* Revert changes on SIGINT */ + signal(SIGINT, sigint_handler); + if (strcmp(basename(argv[0]), "autopart") == 0) { /* Guided */ prompt = "Please review the disk setup. When complete, press " - "the Exit button."; + "the Finish button."; part_wizard(); } else { prompt = "Create partitions for FreeBSD. No changes will be " - "made until you select Exit."; + "made until you select Finish."; } /* Show the part editor either immediately, or to confirm wizard */ @@ -129,21 +148,24 @@ main(int argc, const char **argv) { error = 0; if (op == 5) { /* Finished */ - dialog_vars.extra_button = TRUE; + dialog_vars.ok_label = __DECONST(char *, "Commit"); dialog_vars.extra_label = - __DECONST(char *, "Abort"); - dialog_vars.ok_label = __DECONST(char *, "Save"); + __DECONST(char *, "Revert & Exit"); + dialog_vars.extra_button = TRUE; + dialog_vars.cancel_label = __DECONST(char *, "Back"); op = dialog_yesno("Confirmation", "Your changes will " "now be written to disk. If you have chosen to " "overwrite existing data, it will be PERMANENTLY " - "ERASED. Are you sure you want to proceed?", 0, 0); - dialog_vars.extra_button = FALSE; + "ERASED. Are you sure you want to commit your " + "changes?", 0, 0); dialog_vars.ok_label = NULL; + dialog_vars.extra_button = FALSE; + dialog_vars.cancel_label = NULL; if (op == 0 && validate_setup()) { /* Save */ error = apply_changes(&mesh); break; - } else if (op == 3) { /* Don't save => Quit */ + } else if (op == 3) { /* Quit */ gpart_revert_all(&mesh); error = -1; break; @@ -181,7 +203,8 @@ get_part_metadata(const char *name, int } void -delete_part_metadata(const char *name) { +delete_part_metadata(const char *name) +{ struct partition_metadata *md; TAILQ_FOREACH(md, &part_metadata, metadata) { @@ -316,7 +339,8 @@ apply_changes(struct gmesh *mesh) } static struct partedit_item * -read_geom_mesh(struct gmesh *mesh, int *nitems) { +read_geom_mesh(struct gmesh *mesh, int *nitems) +{ struct gclass *classp; struct ggeom *gp; struct partedit_item *items; @@ -330,7 +354,7 @@ read_geom_mesh(struct gmesh *mesh, int * LIST_FOREACH(classp, &mesh->lg_class, lg_class) { if (strcmp(classp->lg_name, "DISK") != 0 && - strcmp(classp->lg_name, "MD") != 0) + strcmp(classp->lg_name, "MD") != 0) continue; /* Now recurse into all children */ @@ -343,7 +367,8 @@ read_geom_mesh(struct gmesh *mesh, int * static void add_geom_children(struct ggeom *gp, int recurse, struct partedit_item **items, - int *nitems) { + int *nitems) +{ struct gconsumer *cp; struct gprovider *pp; struct gconfig *gc; From owner-svn-src-head@FreeBSD.ORG Mon Aug 22 03:10:30 2011 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 0DD491065672; Mon, 22 Aug 2011 03:10:30 +0000 (UTC) (envelope-from silby@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F21868FC13; Mon, 22 Aug 2011 03:10:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7M3ATm0030992; Mon, 22 Aug 2011 03:10:29 GMT (envelope-from silby@svn.freebsd.org) Received: (from silby@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7M3ATr2030990; Mon, 22 Aug 2011 03:10:29 GMT (envelope-from silby@svn.freebsd.org) Message-Id: <201108220310.p7M3ATr2030990@svn.freebsd.org> From: Mike Silbersack Date: Mon, 22 Aug 2011 03:10:29 +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: r225069 - head/sys/x86/x86 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, 22 Aug 2011 03:10:30 -0000 Author: silby Date: Mon Aug 22 03:10:29 2011 New Revision: 225069 URL: http://svn.freebsd.org/changeset/base/225069 Log: Disable TSC usage inside SMP VM environments. On my VMware ESXi 4.1 environment with a core i5-2500K, operation in this mode causes timeouts from the mpt driver. Switching to the ACPI-fast timer resolves this issue. Switching the VM back to single CPU mode also works, which is why I have not disabled the TSC in that mode. I did not test with KVM or other VM environments, but I am being cautious and assuming that the TSC is not reliable in SMP mode there as well. Reviewed by: kib Approved by: re (kib) MFC after: Not applicable, the timecounter code is new for 9.x Modified: head/sys/x86/x86/tsc.c Modified: head/sys/x86/x86/tsc.c ============================================================================== --- head/sys/x86/x86/tsc.c Sun Aug 21 22:09:30 2011 (r225068) +++ head/sys/x86/x86/tsc.c Mon Aug 22 03:10:29 2011 (r225069) @@ -464,11 +464,16 @@ init_TSC_tc(void) * synchronized. If the user is sure that the system has synchronized * TSCs, set kern.timecounter.smp_tsc tunable to a non-zero value. * We also limit the frequency even lower to avoid "temporal anomalies" - * as much as possible. + * as much as possible. The TSC seems unreliable in virtualized SMP + * environments, so it is set to a negative quality in those cases. */ if (smp_cpus > 1) { - tsc_timecounter.tc_quality = test_smp_tsc(); - max_freq >>= 8; + if (vm_guest != 0) { + tsc_timecounter.tc_quality = -100; + } else { + tsc_timecounter.tc_quality = test_smp_tsc(); + max_freq >>= 8; + } } else #endif if (tsc_is_invariant) From owner-svn-src-head@FreeBSD.ORG Mon Aug 22 11:18:48 2011 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 3B3CD1065677; Mon, 22 Aug 2011 11:18:48 +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 2ACB18FC15; Mon, 22 Aug 2011 11:18:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7MBImKP048378; Mon, 22 Aug 2011 11:18:48 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7MBImh0048376; Mon, 22 Aug 2011 11:18:48 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201108221118.p7MBImh0048376@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 22 Aug 2011 11:18: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: r225076 - 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: Mon, 22 Aug 2011 11:18:48 -0000 Author: kib Date: Mon Aug 22 11:18:47 2011 New Revision: 225076 URL: http://svn.freebsd.org/changeset/base/225076 Log: Apply the limit to avoid the overflows in the radix tree subr_blist.c after the conversion of the swap device size to the page size units, not before. That lifts the limit on the usable swap partition size from 32GB to 256GB, that is less depressing for the modern systems. Submitted by: Alexander V. Chernikov Reviewed by: alc Approved by: re (bz) MFC after: 2 weeks Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Mon Aug 22 07:55:48 2011 (r225075) +++ head/sys/vm/swap_pager.c Mon Aug 22 11:18:47 2011 (r225076) @@ -2133,16 +2133,6 @@ swaponsomething(struct vnode *vp, void * u_long mblocks; /* - * If we go beyond this, we get overflows in the radix - * tree bitmap code. - */ - mblocks = 0x40000000 / BLIST_META_RADIX; - if (nblks > mblocks) { - printf("WARNING: reducing size to maximum of %lu blocks per swap unit\n", - mblocks); - nblks = mblocks; - } - /* * nblks is in DEV_BSIZE'd chunks, convert to PAGE_SIZE'd chunks. * First chop nblks off to page-align it, then convert. * @@ -2151,6 +2141,18 @@ swaponsomething(struct vnode *vp, void * nblks &= ~(ctodb(1) - 1); nblks = dbtoc(nblks); + /* + * If we go beyond this, we get overflows in the radix + * tree bitmap code. + */ + mblocks = 0x40000000 / BLIST_META_RADIX; + if (nblks > mblocks) { + printf( + "WARNING: reducing swap size to maximum of %luMB per unit\n", + mblocks / 1024 / 1024 * PAGE_SIZE); + nblks = mblocks; + } + sp = malloc(sizeof *sp, M_VMPGDATA, M_WAITOK | M_ZERO); sp->sw_vp = vp; sp->sw_id = id; From owner-svn-src-head@FreeBSD.ORG Mon Aug 22 18:36:58 2011 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 A757A1065676; Mon, 22 Aug 2011 18:36:58 +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 7E79D8FC1A; Mon, 22 Aug 2011 18:36:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7MIawNG063473; Mon, 22 Aug 2011 18:36:58 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7MIawPg063472; Mon, 22 Aug 2011 18:36:58 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201108221836.p7MIawPg063472@svn.freebsd.org> From: John Baldwin Date: Mon, 22 Aug 2011 18: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: r225079 - head/sys/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: Mon, 22 Aug 2011 18:36:58 -0000 Author: jhb Date: Mon Aug 22 18:36:58 2011 New Revision: 225079 URL: http://svn.freebsd.org/changeset/base/225079 Log: Add two new macros DRIVER_MODULE_ORDERED() and EARLY_DRIVER_MODULE_ORDERED() that allow a module to use an order other than the default of SI_ORDER_MIDDLE when registering a driver. This can be useful for drivers in a kld that contain multiple new-bus drivers as part of one logical device driver. A typical case would be to use SI_ORDER_LAST for the "main" driver to ensure that any other "helper" drivers are registered and available before the "main" driver attempts to attach. Tested by: kib, Jason Harmening jason harmening / gmail Approved by: re (kib) MFC after: 1 week Modified: head/sys/sys/bus.h Modified: head/sys/sys/bus.h ============================================================================== --- head/sys/sys/bus.h Mon Aug 22 16:35:46 2011 (r225078) +++ head/sys/sys/bus.h Mon Aug 22 18:36:58 2011 (r225079) @@ -596,7 +596,8 @@ struct driver_module_data { int dmd_pass; }; -#define EARLY_DRIVER_MODULE(name, busname, driver, devclass, evh, arg, pass) \ +#define EARLY_DRIVER_MODULE_ORDERED(name, busname, driver, devclass, \ + evh, arg, order, pass) \ \ static struct driver_module_data name##_##busname##_driver_mod = { \ evh, arg, \ @@ -612,7 +613,16 @@ static moduledata_t name##_##busname##_m &name##_##busname##_driver_mod \ }; \ DECLARE_MODULE(name##_##busname, name##_##busname##_mod, \ - SI_SUB_DRIVERS, SI_ORDER_MIDDLE) + SI_SUB_DRIVERS, order) + +#define EARLY_DRIVER_MODULE(name, busname, driver, devclass, evh, arg, pass) \ + EARLY_DRIVER_MODULE_ORDERED(name, busname, driver, devclass, \ + evh, arg, SI_ORDER_MIDDLE, pass) + +#define DRIVER_MODULE_ORDERED(name, busname, driver, devclass, evh, arg,\ + order) \ + EARLY_DRIVER_MODULE_ORDERED(name, busname, driver, devclass, \ + evh, arg, order, BUS_PASS_DEFAULT) #define DRIVER_MODULE(name, busname, driver, devclass, evh, arg) \ EARLY_DRIVER_MODULE(name, busname, driver, devclass, evh, arg, \ From owner-svn-src-head@FreeBSD.ORG Mon Aug 22 20:33:05 2011 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 D1032106564A; Mon, 22 Aug 2011 20:33:05 +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 A741A8FC0A; Mon, 22 Aug 2011 20:33:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7MKX5Ko067377; Mon, 22 Aug 2011 20:33:05 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7MKX54Y067375; Mon, 22 Aug 2011 20:33:05 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201108222033.p7MKX54Y067375@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 22 Aug 2011 20:33: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: r225088 - head/sys/dev/alc 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, 22 Aug 2011 20:33:05 -0000 Author: yongari Date: Mon Aug 22 20:33:05 2011 New Revision: 225088 URL: http://svn.freebsd.org/changeset/base/225088 Log: Disable PHY hibernation until I get more detailed hibernation programming secret. The PHY would go into sleep state when it detects no established link and it will re-establish link when the cable is plugged in. Previously it failed to re-establish link when the cable is plugged in such that it required to manually down and up the interface again to make it work. This came from incorrectly programmed hibernation parameters. According to Atheros, each PHY chip requires different configuration for hibernation and different vendor has different settings for the same chip. Disabling hibernation may consume more power but establishing link looks more important than saving power. Special thanks to Atheros for giving me instructions that disable hibernation. MFC after: 1 week Approved by: re (kib) Modified: head/sys/dev/alc/if_alc.c Modified: head/sys/dev/alc/if_alc.c ============================================================================== --- head/sys/dev/alc/if_alc.c Mon Aug 22 20:25:55 2011 (r225087) +++ head/sys/dev/alc/if_alc.c Mon Aug 22 20:33:05 2011 (r225088) @@ -532,13 +532,11 @@ alc_phy_reset(struct alc_softc *sc) uint16_t data; /* Reset magic from Linux. */ - CSR_WRITE_2(sc, ALC_GPHY_CFG, - GPHY_CFG_HIB_EN | GPHY_CFG_HIB_PULSE | GPHY_CFG_SEL_ANA_RESET); + CSR_WRITE_2(sc, ALC_GPHY_CFG, GPHY_CFG_SEL_ANA_RESET); CSR_READ_2(sc, ALC_GPHY_CFG); DELAY(10 * 1000); - CSR_WRITE_2(sc, ALC_GPHY_CFG, - GPHY_CFG_EXT_RESET | GPHY_CFG_HIB_EN | GPHY_CFG_HIB_PULSE | + CSR_WRITE_2(sc, ALC_GPHY_CFG, GPHY_CFG_EXT_RESET | GPHY_CFG_SEL_ANA_RESET); CSR_READ_2(sc, ALC_GPHY_CFG); DELAY(10 * 1000); @@ -623,6 +621,23 @@ alc_phy_reset(struct alc_softc *sc) alc_miibus_writereg(sc->alc_dev, sc->alc_phyaddr, ALC_MII_DBG_DATA, data); DELAY(1000); + + /* Disable hibernation. */ + alc_miibus_writereg(sc->alc_dev, sc->alc_phyaddr, ALC_MII_DBG_ADDR, + 0x0029); + data = alc_miibus_readreg(sc->alc_dev, sc->alc_phyaddr, + ALC_MII_DBG_DATA); + data &= ~0x8000; + alc_miibus_writereg(sc->alc_dev, sc->alc_phyaddr, ALC_MII_DBG_DATA, + data); + + alc_miibus_writereg(sc->alc_dev, sc->alc_phyaddr, ALC_MII_DBG_ADDR, + 0x000B); + data = alc_miibus_readreg(sc->alc_dev, sc->alc_phyaddr, + ALC_MII_DBG_DATA); + data &= ~0x8000; + alc_miibus_writereg(sc->alc_dev, sc->alc_phyaddr, ALC_MII_DBG_DATA, + data); } static void @@ -648,8 +663,7 @@ alc_phy_down(struct alc_softc *sc) break; default: /* Force PHY down. */ - CSR_WRITE_2(sc, ALC_GPHY_CFG, - GPHY_CFG_EXT_RESET | GPHY_CFG_HIB_EN | GPHY_CFG_HIB_PULSE | + CSR_WRITE_2(sc, ALC_GPHY_CFG, GPHY_CFG_EXT_RESET | GPHY_CFG_SEL_ANA_RESET | GPHY_CFG_PHY_IDDQ | GPHY_CFG_PWDOWN_HW); DELAY(1000); From owner-svn-src-head@FreeBSD.ORG Mon Aug 22 20:44:18 2011 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 77DD81065670; Mon, 22 Aug 2011 20:44:18 +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 676AC8FC0C; Mon, 22 Aug 2011 20:44:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7MKiIAg067741; Mon, 22 Aug 2011 20:44:18 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7MKiIXJ067739; Mon, 22 Aug 2011 20:44:18 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201108222044.p7MKiIXJ067739@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 22 Aug 2011 20:44: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: r225089 - 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: Mon, 22 Aug 2011 20:44:18 -0000 Author: kib Date: Mon Aug 22 20:44:18 2011 New Revision: 225089 URL: http://svn.freebsd.org/changeset/base/225089 Log: Update some comments in swap_pager.c. Reviewed and most wording by: alc MFC after: 1 week Approved by: re (bz) Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Mon Aug 22 20:33:05 2011 (r225088) +++ head/sys/vm/swap_pager.c Mon Aug 22 20:44:18 2011 (r225089) @@ -114,9 +114,9 @@ __FBSDID("$FreeBSD$"); #include /* - * SWB_NPAGES must be a power of 2. It may be set to 1, 2, 4, 8, or 16 - * pages per allocation. We recommend you stick with the default of 8. - * The 16-page limit is due to the radix code (kern/subr_blist.c). + * SWB_NPAGES must be a power of 2. It may be set to 1, 2, 4, 8, 16 + * or 32 pages per allocation. + * The 32-page limit is due to the radix code (kern/subr_blist.c). */ #ifndef MAX_PAGEOUT_CLUSTER #define MAX_PAGEOUT_CLUSTER 16 @@ -127,14 +127,11 @@ __FBSDID("$FreeBSD$"); #endif /* - * Piecemeal swap metadata structure. Swap is stored in a radix tree. - * - * If SWB_NPAGES is 8 and sizeof(char *) == sizeof(daddr_t), our radix - * is basically 8. Assuming PAGE_SIZE == 4096, one tree level represents - * 32K worth of data, two levels represent 256K, three levels represent - * 2 MBytes. This is acceptable. - * - * Overall memory utilization is about the same as the old swap structure. + * The swblock structure maps an object and a small, fixed-size range + * of page indices to disk addresses within a swap area. + * The collection of these mappings is implemented as a hash table. + * Unused disk addresses within a swap area are allocated and managed + * using a blist. */ #define SWCORRECT(n) (sizeof(void *) * (n) / sizeof(daddr_t)) #define SWAP_META_PAGES (SWB_NPAGES * 2) @@ -662,9 +659,7 @@ swap_pager_alloc(void *handle, vm_ooffse * routine is typically called only when the entire object is * about to be destroyed. * - * This routine may block, but no longer does. - * - * The object must be locked or unreferenceable. + * The object must be locked. */ static void swap_pager_dealloc(vm_object_t object) @@ -706,7 +701,7 @@ swap_pager_dealloc(vm_object_t object) * Also has the side effect of advising that somebody made a mistake * when they configured swap and didn't configure enough. * - * This routine may not block + * This routine may not sleep. * * We allocate in round-robin fashion from the configured devices. */ @@ -776,10 +771,7 @@ swp_pager_strategy(struct buf *bp) * * This routine returns the specified swap blocks back to the bitmap. * - * Note: This routine may not block (it could in the old swap code), - * and through the use of the new blist routines it does not block. - * - * This routine may not block + * This routine may not sleep. */ static void swp_pager_freeswapspace(daddr_t blk, int npages) @@ -875,21 +867,16 @@ swap_pager_reserve(vm_object_t object, v * cases where both the source and destination have a valid swapblk, * we keep the destination's. * - * This routine is allowed to block. It may block allocating metadata + * This routine is allowed to sleep. It may sleep allocating metadata * indirectly through swp_pager_meta_build() or if paging is still in * progress on the source. * - * XXX vm_page_collapse() kinda expects us not to block because we - * supposedly do not need to allocate memory, but for the moment we - * *may* have to get a little memory from the zone allocator, but - * it is taken from the interrupt memory. We should be ok. - * * The source object contains no vm_page_t's (which is just as well) * * The source object is of type OBJT_SWAP. * - * The source and destination objects must be locked or - * inaccessible (XXX are they ?) + * The source and destination objects must be locked. + * Both object locks may temporarily be released. */ void swap_pager_copy(vm_object_t srcobject, vm_object_t dstobject, @@ -1066,7 +1053,7 @@ swap_pager_haspage(vm_object_t object, v * does NOT change the m->dirty status of the page. Also: MADV_FREE * depends on it. * - * This routine may not block + * This routine may not sleep. */ static void swap_pager_unswapped(vm_page_t m) @@ -1472,7 +1459,7 @@ swap_pager_putpages(vm_object_t object, * operations, we vm_page_t->busy'd unbusy all pages ( we can do this * because we marked them all VM_PAGER_PEND on return from putpages ). * - * This routine may not block. + * This routine may not sleep. */ static void swp_pager_async_iodone(struct buf *bp) @@ -1657,7 +1644,7 @@ swp_pager_async_iodone(struct buf *bp) * Return 1 if at least one page in the given object is paged * out to the given swap device. * - * This routine may not block. + * This routine may not sleep. */ int swap_pager_isswapped(vm_object_t object, struct swdevt *sp) From owner-svn-src-head@FreeBSD.ORG Mon Aug 22 21:05:40 2011 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 2530C106566B; Mon, 22 Aug 2011 21:05:40 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 130D98FC16; Mon, 22 Aug 2011 21:05:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7ML5ec0068403; Mon, 22 Aug 2011 21:05:40 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7ML5eSv068401; Mon, 22 Aug 2011 21:05:40 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201108222105.p7ML5eSv068401@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 22 Aug 2011 21:05: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: r225090 - head/lib/libusb 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, 22 Aug 2011 21:05:40 -0000 Author: hselasky Date: Mon Aug 22 21:05:39 2011 New Revision: 225090 URL: http://svn.freebsd.org/changeset/base/225090 Log: Whitespace corrections for LibUSB manual page (1/2). MFC after: 1 week Approved by: re (kib) PR: docs/159898 Modified: head/lib/libusb/libusb.3 Modified: head/lib/libusb/libusb.3 ============================================================================== --- head/lib/libusb/libusb.3 Mon Aug 22 20:44:18 2011 (r225089) +++ head/lib/libusb/libusb.3 Mon Aug 22 21:05:39 2011 (r225090) @@ -31,165 +31,123 @@ .Os .Sh NAME .Nm libusb -. .Nd "USB access library" -. -. .Sh LIBRARY -. -. USB access library (libusb -lusb) -. -. .Sh SYNOPSIS -. -. .In libusb.h -. -. .Sh DESCRIPTION The .Nm library contains interfaces for directly managing a usb device. The current implementation supports v1.0 of the libusb API. -. -. .Sh LIBRARY INITIALISATION / DEINITIALISATION -. .Pp -. .Ft int .Fn libusb_init libusb_context **ctx -This function initialises libusb. Must be called at the beginning -of the program. This function returns 0 on success or LIBUSB_ERROR on +This function initialises libusb. +Must be called at the beginning +of the program. +This function returns 0 on success or LIBUSB_ERROR on failure. -. .Pp -. .Ft void .Fn libusb_exit "libusb_context *ctx" -Deinitialise libusb. Must be called at the end of the application. -. +Deinitialise libusb. +Must be called at the end of the application. .Pp -. .Ft const char * .Fn libusb_strerror "int code" Get ASCII representation of the error given by the .Fa code argument. -. -. .Pp -. .Ft void .Fn libusb_set_debug "libusb_context *ctx" "int level" Set debug to the .Fa level level. -. .Pp -. .Ft ssize_t .Fn libusb_get_device_list "libusb_context *ctx" "libusb_device ***list" Fill into -.Fa list -the list of usb device available. All the device created by this -function must be unref and free when you are done with them. This +.Fa list +the list of usb device available. +All the device created by this +function must be unref and free when you are done with them. +This function returns the number of devices in list or a LIBUSB_ERROR code. -. .Pp -. .Ft void .Fn libusb_free_device_list "libusb_device **list" "int unref_devices" -Free the list of devices discovered by libusb_get_device_list. If +Free the list of devices discovered by libusb_get_device_list. +If .Fa unref_device is set to 1 all devices are unref one time. -. .Pp -. .Ft uint8_t .Fn libusb_get_bus_number "libusb_device *dev" Returns the number of the bus contained by the device .Fa dev. -. .Pp -. .Ft uint8_t .Fn libusb_get_device_address "libusb_device *dev" Returns the device_address contained by the device .Fa dev. -. .Pp -. .Ft enum libusb_speed .Fn libusb_get_device_speed "libusb_device *dev" Returns the wire speed at which the device is connected. See the LIBUSB_SPEED_XXX enums for more information. LIBUSB_SPEED_UNKNOWN is returned in case of unknown wire speed. -. .Pp -. .Ft int .Fn libusb_get_max_packet_size "libusb_device *dev" "unsigned char endpoint" -Returns the wMaxPacketSize value on success, LIBUSB_ERROR_NOT_FOUND if the +Returns the wMaxPacketSize value on success, LIBUSB_ERROR_NOT_FOUND if the endpoint does not exist and LIBUSB_ERROR_OTHERS on other failure. -. .Pp -. .Ft libusb_device * .Fn libusb_ref_device "libusb_device *dev" Increment the reference counter of the device .Fa dev. -. .Pp -. .Ft void .Fn libusb_unref_device "libusb_device *dev" Decrement the reference counter of the device .Fa dev. -. .Pp -. .Ft int .Fn libusb_open "libusb_device *dev" "libusb_device_handle **devh" -Open a device and obtain a device_handle. Returns 0 on success, -LIBUSB_ERROR_NO_MEM on memory allocation problem, LIBUSB_ERROR_ACCESS -on permission problem, LIBUSB_ERROR_NO_DEVICE if the device has been +Open a device and obtain a device_handle. +Returns 0 on success, +LIBUSB_ERROR_NO_MEM on memory allocation problem, LIBUSB_ERROR_ACCESS +on permission problem, LIBUSB_ERROR_NO_DEVICE if the device has been disconnected and a LIBUSB_ERROR code on error. -. .Pp -. .Ft libusb_device_handle * .Fn libusb_open_device_with_vid_pid "libusb_context *ctx" "uint16_t vid" "uint16_t pid" -Convenience function to open a device with is -.Fa vid -and +Convenience function to open a device with is +.Fa vid +and .Fa pid. Returns NULL on error. -. .Pp -. .Ft void .Fn libusb_close "libusb_device_handle *devh" Close a device handle. -. .Pp -. .Ft libusb_device * .Fn libusb_get_device "libusb_device_handle *devh" Get the device contained by devh. Returns NULL on error. -. .Pp -. .Ft int .Fn libusb_get_configuration "libusb_device_handle *devh" "int *config" -Returns the bConfiguration value of the current configuration. Returns 0 -on success, LIBUSB_ERROR_NO_DEVICE if the device has been disconnected +Returns the bConfiguration value of the current configuration. +Returns 0 +on success, LIBUSB_ERROR_NO_DEVICE if the device has been disconnected and a LIBUSB_ERROR code on error. -. .Pp -. .Ft int .Fn libusb_set_configuration "libusb_device_handle *devh" "int config" Set the active configuration @@ -197,73 +155,66 @@ Set the active configuration for the device contained by .Fa devh. This function returns 0 on success, LIBUSB_ERROR_NOT_FOUND if the requested -configuration does not exist, LIBUSB_ERROR_BUSY if the interfaces are currently -claimed, LIBUSB_ERROR_NO_DEVICE if the device has been disconnected and a +configuration does not exist, LIBUSB_ERROR_BUSY if the interfaces are currently +claimed, LIBUSB_ERROR_NO_DEVICE if the device has been disconnected and a LIBUSB_ERROR code on failure. -. .Pp -. .Ft int .Fn libusb_claim_interface "libusb_device_handle *devh" "int interface_number" Claim an interface in a given libusb_handle .Fa devh. -This is a non-blocking function. It returns 0 success, LIBUSB_ERROR_NOT_FOUND -if the requested interface does not exist, LIBUSB_ERROR_BUSY if a program or -driver has claimed the interface, LIBUSB_ERROR_NO_DEVICE if the device has +This is a non-blocking function. +It returns 0 success, LIBUSB_ERROR_NOT_FOUND +if the requested interface does not exist, LIBUSB_ERROR_BUSY if a program or +driver has claimed the interface, LIBUSB_ERROR_NO_DEVICE if the device has been disconnected and a LIBUSB_ERROR code on failure. -. .Pp -. .Ft int .Fn libusb_release_interface "libusb_device_handle *devh" "int interface_number" -This function release an interface. All the claimed interface must be released -before closing a device. Returns 0 on success, LIBUSB_ERROR_NOT_FOUND if the -interface was not claimed, LIBUSB_ERROR_NO_DEVICE if the device has been +This function release an interface. +All the claimed interface must be released +before closing a device. +Returns 0 on success, LIBUSB_ERROR_NOT_FOUND if the +interface was not claimed, LIBUSB_ERROR_NO_DEVICE if the device has been disconnected and LIBUSB_ERROR on failure. -. .Pp -. .Ft int .Fn libusb_set_interface_alt_setting "libusb_device_handle *dev" "int interface_number" "int alternate_setting" -Activate an alternate setting for an interface. Returns 0 on success, -LIBUSB_ERROR_NOT_FOUND if the interface was not claimed or the requested -setting does not exist, LIBUSB_ERROR_NO_DEVICE if the device has been +Activate an alternate setting for an interface. +Returns 0 on success, +LIBUSB_ERROR_NOT_FOUND if the interface was not claimed or the requested +setting does not exist, LIBUSB_ERROR_NO_DEVICE if the device has been disconnected and LIBUSB_ERROR code on failure. -. .Pp -. .Ft int .Fn libusb_clear_halt "libusb_device_handle *devh" "unsigned char endpoint" -Clear an halt/stall for a endpoint. Returns 0 on success, LIBUSB_ERROR_NOT_FOUND -if the endpoint does not exist, LIBUSB_ERROR_NO_DEVICE if the device has been +Clear an halt/stall for a endpoint. +Returns 0 on success, LIBUSB_ERROR_NOT_FOUND +if the endpoint does not exist, LIBUSB_ERROR_NO_DEVICE if the device has been disconnected and a LIBUSB_ERROR code on failure. -. .Pp -. .Ft int .Fn libusb_reset_device "libusb_device_handle *devh" -Perform an USB port reset for an usb device. Returns 0 on success, +Perform an USB port reset for an usb device. +Returns 0 on success, LIBUSB_ERROR_NOT_FOUND if re-enumeration is required or if the device has been disconnected and a LIBUSB_ERROR code on failure. -. .Pp -. .Ft int .Fn libusb_check_connected "libusb_device_handle *devh" -Test if USB device is still connected. Returns 0 on success, +Test if USB device is still connected. +Returns 0 on success, LIBUSB_ERROR_NO_DEVICE if has been disconnected and a LIBUSB_ERROR code on failure. -. .Pp -. .Ft int .Fn libusb_kernel_driver_active "libusb_device_handle *devh" "int interface" -Determine if a driver is active on a interface. Returns 0 if no kernel driver -is active, returns 1 if a kernel driver is active, returns LIBUSB_ERROR_NO_DEVICE +Determine if a driver is active on a interface. +Returns 0 if no kernel driver +is active, returns 1 if a kernel driver is active, +returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected and returns a LIBUSB_ERROR code on failure. -. .Pp -. .Ft int .Fn libusb_get_driver "libusb_device_handle *devh" "int interface" "char *name" "int namelen" or @@ -284,9 +235,7 @@ This function is non-portable. The buffer pointed to by .Fa name is only zero terminated on success. -. .Pp -. .Ft int .Fn libusb_detach_kernel_driver "libusb_device_handle *devh" "int interface" or @@ -295,69 +244,66 @@ or Detach a kernel driver from an interface. This is needed to claim an interface required by a kernel driver. Returns 0 on success, LIBUSB_ERROR_NOT_FOUND if no kernel driver was active, -LIBUSB_ERROR_INVALID_PARAM if the interface does not exist, LIBUSB_ERROR_NO_DEVICE if the device has been disconnected and a LIBUSB_ERROR code on failure. This function is non-portable. -. +LIBUSB_ERROR_INVALID_PARAM if the interface does not exist, +LIBUSB_ERROR_NO_DEVICE if the device has been disconnected +and a LIBUSB_ERROR code on failure. +This function is non-portable. .Pp -. .Ft int .Fn libusb_attach_kernel_driver "libusb_device_handle *devh" "int interface" -Re-attach an interface kernel driver previously detached. Returns 0 on success, -LIBUSB_ERROR_INVALID_PARAM if the interface does not exist, LIBUSB_ERROR_NO_DEVICE -if the device has been disconnect, LIBUSB_ERROR_BUSY if the driver cannot be -attached because the interface is claimed by a program or driver and a +Re-attach an interface kernel driver previously detached. +Returns 0 on success, +LIBUSB_ERROR_INVALID_PARAM if the interface does not exist, +LIBUSB_ERROR_NO_DEVICE +if the device has been disconnect, LIBUSB_ERROR_BUSY if the driver cannot be +attached because the interface is claimed by a program or driver and a LIBUSB_ERROR code on failure. -. .Pp -. .Sh USB DESCRIPTORS -. .Pp -. .Ft int .Fn libusb_get_device_descriptor "libusb_device *dev" "libusb_device_descriptor *desc" Get the USB device descriptor for the device .Fa dev. -This is a non-blocking function. Returns 0 on success and a LIBUSB_ERROR code on +This is a non-blocking function. +Returns 0 on success and a LIBUSB_ERROR code on failure. -. .Pp -.Ft int +.Ft int .Fn libsub_get_active_config_descriptor "libusb_device *dev" "struct libusb_config_descriptor **config" -Get the USB configuration descriptor for the active configuration. Returns 0 on -success, returns LIBUSB_ERROR_NOT_FOUND if the device is in unconfigured state +Get the USB configuration descriptor for the active configuration. +Returns 0 on +success, returns LIBUSB_ERROR_NOT_FOUND if the device is in unconfigured state and returns another LIBUSB_ERROR code on error. -. .Pp -.Ft int +.Ft int .Fn libusb_get_config_descriptor "libusb_device *dev" "uint8_t config_index" "libusb_config_descriptor **config" -Get USB configuration descriptor based on its index +Get USB configuration descriptor based on its index .Fa idx. -Returns 0 on success, LIBUSB_ERROR_NOT_FOUND if the configuration does not exist +Returns 0 on success, LIBUSB_ERROR_NOT_FOUND if the configuration does not exist and returns another LIBUSB_ERROR code on error. -. .Pp .Ft int .Fn libusb_get_config_descriptor_by_value "libusb_device *dev" "uint8 bConfigurationValue" "libusb_config_descriptor **config" -Get a USB configuration descriptor with a specific bConfigurationValue. This is -a non-blocking function which does not send request through the device. Returns 0 -on success, LIBUSB_ERROR_NOT_FOUND if the configuration does not exist and another +Get a USB configuration descriptor with a specific bConfigurationValue. +This is +a non-blocking function which does not send request through the device. +Returns 0 +on success, LIBUSB_ERROR_NOT_FOUND if the configuration +does not exist and another LIBUSB_ERROR code on failure. -. .Pp .Ft void .Fn libusb_free_config_descriptor "libusb_config_descriptor *config" Free a configuration descriptor. -. .Pp .Ft int .Fn libusb_get_string_descriptor_ascii "libusb_device_handle *devh" "uint8_t desc_idx" "unsigned char *data" "int length" Retrieve a string descriptor in C style ascii. -Returns a positive number of bytes in the resulting ASCII string on success and a LIBUSB_ERROR code on failure. -. +Returns a positive number of bytes in the resulting ASCII string +on success and a LIBUSB_ERROR code on failure. .Pp -. .Sh USB ASYNCHRONOUS I/O -. .Pp .Ft struct libusb_transfer * .Fn libusb_alloc_transfer "int iso_packets" @@ -365,28 +311,24 @@ Allocate a transfer with .Fa iso_packets numbers of isochronous packet descriptors. Returns NULL on error. -. .Pp .Ft void .Fn libusb_free_transfer "struct libusb_transfer *tr" Free a transfer. -. .Pp .Ft int .Fn libusb_submit_transfer "struct libusb_transfer *tr" This function will submit a transfer and returns immediately. -Returns 0 on success, LIBUSB_ERROR_NO_DEVICE if the device has been disconnected and +Returns 0 on success, LIBUSB_ERROR_NO_DEVICE if +the device has been disconnected and LIBUSB_ERROR code on other failure. -. .Pp .Ft int .Fn libusb_cancel_transfer "struct libusb_transfer *tr" This function asynchronously cancel a transfer. Returns 0 on success and LIBUSB_ERROR code on failure. -. .Pp .Sh USB SYNCHRONOUS I/O -. .Pp .Ft int .Fn libusb_control_transfer "libusb_device_handle *devh" "uint8_t bmRequestType" "uint8_t bRequest" "uint16_t wValue" "uint16_t wIndex" "unsigned char *data" "uint16_t wLength" "unsigned int timeout" @@ -400,125 +342,121 @@ LIBUSB_ERROR_TIMEOUT if the transfer tim control request was not supported, LIBUSB_ERROR_NO_DEVICE if the device has been disconnected or another LIBUSB_ERROR code on other failures. The libusb error codes are always negative. -. .Pp .Ft int .Fn libusb_bulk_transfer "struct libusb_device_handle *devh" "unsigned char endpoint" "unsigned char *data" "int length" "int *transferred" "unsigned int timeout" Perform an USB bulk transfer. A timeout value of zero means no timeout. The timeout value is given in milliseconds. -Returns 0 on success, LIBUSB_ERROR_TIMEOUT -if the transfer timeout, LIBUSB_ERROR_PIPE if the control request was not -supported, LIBUSB_ERROR_OVERFLOW if the device offered more data, -LIBUSB_ERROR_NO_DEVICE if the device has been disconnected and +Returns 0 on success, LIBUSB_ERROR_TIMEOUT +if the transfer timeout, LIBUSB_ERROR_PIPE if the control request was not +supported, LIBUSB_ERROR_OVERFLOW if the device offered more data, +LIBUSB_ERROR_NO_DEVICE if the device has been disconnected and LIBUSB_ERROR code on other failure. -. .Pp .Ft int .Fn libusb_interrupt_transfer "struct libusb_device_handle *devh" "unsigned char endpoint" "unsigned char *data" "int length" "int *transferred" "unsigned int timeout" Perform an USB Interrupt transfer. A timeout value of zero means no timeout. The timeout value is given in milliseconds. -Returns 0 on success, LIBUSB_ERROR_TIMEOUT -if the transfer timeout, LIBUSB_ERROR_PIPE if the control request was not -supported, LIBUSB_ERROR_OVERFLOW if the device offered more data, -LIBUSB_ERROR_NO_DEVICE if the device has been disconnected and +Returns 0 on success, LIBUSB_ERROR_TIMEOUT +if the transfer timeout, LIBUSB_ERROR_PIPE if the control request was not +supported, LIBUSB_ERROR_OVERFLOW if the device offered more data, +LIBUSB_ERROR_NO_DEVICE if the device has been disconnected and LIBUSB_ERROR code on other failure. -. .Pp .Sh USB EVENTS -. .Pp .Ft int .Fn libusb_try_lock_events "libusb_context *ctx" Try to acquire the event handling lock. Returns 0 if the lock was obtained and 1 if not. -. .Pp .Ft void .Fn libusb_lock_events "libusb_context *ctx" -Acquire the event handling lock. This function is blocking. -. +Acquire the event handling lock. +This function is blocking. .Pp .Ft void .Fn libusb_unlock_events "libusb_context *ctx" -Release the event handling lock. This will wake up any thread blocked +Release the event handling lock. +This will wake up any thread blocked on libusb_wait_for_event(). -. .Pp .Ft int .Fn libusb_event_handling_ok "libusb_context *ctx" -Determine if it still OK for this thread to be doing event handling. Returns 1 -if event handling can start or continue. Returns 0 if this thread must give up +Determine if it still OK for this thread to be doing event handling. +Returns 1 +if event handling can start or continue. +Returns 0 if this thread must give up the events lock. -. .Pp .Ft int .Fn libusb_event_handler_active "libusb_context *ctx" -Determine if an active thread is handling events. Returns 1 if yes and 0 if there +Determine if an active thread is handling events. +Returns 1 if yes and 0 if there are no threads currently handling events. -. .Pp .Ft void .Fn libusb_lock_event_waiters "libusb_context *ctx" -Acquire the event_waiters lock. This lock is designed to be obtained under the +Acquire the event_waiters lock. +This lock is designed to be obtained under the situation where you want to be aware when events are completed, but some other thread is event handling so calling libusb_handle_events() is not allowed. -. .Pp .Ft void .Fn libusb_unlock_event_waiters "libusb_context *ctx" Release the event_waiters lock. -. .Pp -.Ft int +.Ft int .Fn libusb_wait_for_event "libusb_context *ctx" "struct timeval *tv" -Wait for another thread to signal completion of an event. Must be called -with the event waiters lock held, see libusb_lock_event_waiters(). This will +Wait for another thread to signal completion of an event. +Must be called +with the event waiters lock held, see libusb_lock_event_waiters(). +This will block until the timeout expires or a transfer completes or a thread releases -the event handling lock through libusb_unlock_events(). Returns 0 after a +the event handling lock through libusb_unlock_events(). +Returns 0 after a transfer completes or another thread stops event handling, returns 1 if the timeout expired. -. .Pp .Ft int .Fn libusb_handle_events_timeout "libusb_context *ctx" "struct timeval *tv" -Handle any pending events by checking if timeouts have expired and by -checking the set of file descriptors for activity. Returns 0 on success, or a +Handle any pending events by checking if timeouts have expired and by +checking the set of file descriptors for activity. +Returns 0 on success, or a LIBUSB_ERROR code on failure. -. .Pp .Ft int .Fn libusb_handle_events "libusb_context *ctx" -Handle any pending events in blocking mode with a sensible timeout. Returns 0 +Handle any pending events in blocking mode with a sensible timeout. +Returns 0 on success, returns a LIBUSB_ERROR code on failure. -. .Pp .Ft int .Fn libusb_handle_events_locked "libusb_context *ctx" "struct timeval *tv" Handle any pending events by polling file desciptors, without checking if -another threads are already doing so. Must be called with the event lock held. -. +another threads are already doing so. +Must be called with the event lock held. .Pp .Ft int .Fn libusb_get_next_timeout "libusb_context *ctx" "struct timeval *tv" -Determine the next internal timeout that libusb needs to handle. Returns 0 +Determine the next internal timeout that libusb needs to handle. +Returns 0 if there are no pending timeouts, 1 if a timeout was returned, or LIBUSB_ERROR code on failure. -. .Pp .Ft void .Fn libusb_set_pollfd_notifiers "libusb_context *ctx" "libusb_pollfd_added_cb added_cb" "libusb_pollfd_removed_cb remove_cb" "void *user_data" Register notification functions for file descriptor additions/removals. These functions will be invoked for every new or removed file descriptor that libusb uses as an event source. -. .Pp .Ft const struct libusb_pollfd ** .Fn libusb_get_pollfds "libusb_context *ctx" -Retrive a list of file descriptors that should be polled by your main loop as -libusb event sources. Returns a NULL-terminated list on success or NULL on failure. -. +Retrive a list of file descriptors that should be polled by your main loop as +libusb event sources. +Returns a NULL-terminated list on success or NULL on failure. .Sh LIBUSB VERSION 0.1 COMPATIBILITY .Pp The library is also compliant with LibUSB version 0.1.12. @@ -555,16 +493,13 @@ The library is also compliant with LibUS .Fn usb_check_connected .Fn usb_get_driver_np .Fn usb_detach_kernel_driver_np -. .Sh SEE ALSO .Xr libusb20 3 , .Xr usb 4 , .Xr usbconfig 8 .Pp .Pa http://libusb.sourceforge.net/ -. .Sh HISTORY -. .Nm support first appeared in .Fx 8.0 . From owner-svn-src-head@FreeBSD.ORG Mon Aug 22 21:10:50 2011 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 8DC5A1065677; Mon, 22 Aug 2011 21:10:50 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7BE098FC19; Mon, 22 Aug 2011 21:10:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7MLAo5G068586; Mon, 22 Aug 2011 21:10:50 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7MLAoq6068584; Mon, 22 Aug 2011 21:10:50 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201108222110.p7MLAoq6068584@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 22 Aug 2011 21:10: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: r225091 - head/lib/libusb 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, 22 Aug 2011 21:10:50 -0000 Author: hselasky Date: Mon Aug 22 21:10:50 2011 New Revision: 225091 URL: http://svn.freebsd.org/changeset/base/225091 Log: Spelling corrections for LibUSB manual page (2/2). MFC after: 1 week Approved by: re (kib) PR: docs/159898 Modified: head/lib/libusb/libusb.3 Modified: head/lib/libusb/libusb.3 ============================================================================== --- head/lib/libusb/libusb.3 Mon Aug 22 21:05:39 2011 (r225090) +++ head/lib/libusb/libusb.3 Mon Aug 22 21:10:50 2011 (r225091) @@ -33,7 +33,8 @@ .Nm libusb .Nd "USB access library" .Sh LIBRARY -USB access library (libusb -lusb) +USB access library +.Pq libusb, -lusb .Sh SYNOPSIS .In libusb.h .Sh DESCRIPTION @@ -46,8 +47,8 @@ The current implementation supports v1.0 .Ft int .Fn libusb_init libusb_context **ctx This function initialises libusb. -Must be called at the beginning -of the program. +It must be called at the beginning +of the program, before other libusb routines are used. This function returns 0 on success or LIBUSB_ERROR on failure. .Pp @@ -55,35 +56,39 @@ failure. .Fn libusb_exit "libusb_context *ctx" Deinitialise libusb. Must be called at the end of the application. +Other libusb routines may not be called after this function. .Pp .Ft const char * .Fn libusb_strerror "int code" -Get ASCII representation of the error given by the +Get the ASCII representation of the error given by the .Fa code argument. .Pp .Ft void .Fn libusb_set_debug "libusb_context *ctx" "int level" -Set debug to the -.Fa level -level. +Set the debug level to +.Fa level . .Pp .Ft ssize_t .Fn libusb_get_device_list "libusb_context *ctx" "libusb_device ***list" -Fill into +Populate .Fa list -the list of usb device available. -All the device created by this -function must be unref and free when you are done with them. +with the list of usb devices available, adding a reference to each +device in the list. +All the list entries created by this +function must have their reference counter +decremented when you are done with them, +and the list itself must be freed. This -function returns the number of devices in list or a LIBUSB_ERROR code. +function returns the number of devices in the list or a LIBUSB_ERROR code. .Pp .Ft void .Fn libusb_free_device_list "libusb_device **list" "int unref_devices" Free the list of devices discovered by libusb_get_device_list. If .Fa unref_device -is set to 1 all devices are unref one time. +is set to 1 all devices in the list have their reference +counter decremented once. .Pp .Ft uint8_t .Fn libusb_get_bus_number "libusb_device *dev" @@ -120,13 +125,13 @@ Decrement the reference counter of the d .Fn libusb_open "libusb_device *dev" "libusb_device_handle **devh" Open a device and obtain a device_handle. Returns 0 on success, -LIBUSB_ERROR_NO_MEM on memory allocation problem, LIBUSB_ERROR_ACCESS -on permission problem, LIBUSB_ERROR_NO_DEVICE if the device has been -disconnected and a LIBUSB_ERROR code on error. +LIBUSB_ERROR_NO_MEM on memory allocation problems, LIBUSB_ERROR_ACCESS +on permissions problems, LIBUSB_ERROR_NO_DEVICE if the device has been +disconnected and a LIBUSB_ERROR code on other errors. .Pp .Ft libusb_device_handle * .Fn libusb_open_device_with_vid_pid "libusb_context *ctx" "uint16_t vid" "uint16_t pid" -Convenience function to open a device with is +A convenience function to open a device by vendor and product IDs .Fa vid and .Fa pid. @@ -150,7 +155,7 @@ and a LIBUSB_ERROR code on error. .Pp .Ft int .Fn libusb_set_configuration "libusb_device_handle *devh" "int config" -Set the active configuration +Set the active configuration to .Fa config for the device contained by .Fa devh. @@ -164,16 +169,16 @@ LIBUSB_ERROR code on failure. Claim an interface in a given libusb_handle .Fa devh. This is a non-blocking function. -It returns 0 success, LIBUSB_ERROR_NOT_FOUND +It returns 0 on success, LIBUSB_ERROR_NOT_FOUND if the requested interface does not exist, LIBUSB_ERROR_BUSY if a program or driver has claimed the interface, LIBUSB_ERROR_NO_DEVICE if the device has been disconnected and a LIBUSB_ERROR code on failure. .Pp .Ft int .Fn libusb_release_interface "libusb_device_handle *devh" "int interface_number" -This function release an interface. -All the claimed interface must be released -before closing a device. +This function releases an interface. +All the claimed interfaces on a device must be released +before closing the device. Returns 0 on success, LIBUSB_ERROR_NOT_FOUND if the interface was not claimed, LIBUSB_ERROR_NO_DEVICE if the device has been disconnected and LIBUSB_ERROR on failure. @@ -184,7 +189,7 @@ Activate an alternate setting for an int Returns 0 on success, LIBUSB_ERROR_NOT_FOUND if the interface was not claimed or the requested setting does not exist, LIBUSB_ERROR_NO_DEVICE if the device has been -disconnected and LIBUSB_ERROR code on failure. +disconnected and a LIBUSB_ERROR code on failure. .Pp .Ft int .Fn libusb_clear_halt "libusb_device_handle *devh" "unsigned char endpoint" @@ -202,31 +207,30 @@ been disconnected and a LIBUSB_ERROR cod .Pp .Ft int .Fn libusb_check_connected "libusb_device_handle *devh" -Test if USB device is still connected. +Test if the USB device is still connected. Returns 0 on success, -LIBUSB_ERROR_NO_DEVICE if has been disconnected and a LIBUSB_ERROR +LIBUSB_ERROR_NO_DEVICE if it has been disconnected and a LIBUSB_ERROR code on failure. .Pp .Ft int .Fn libusb_kernel_driver_active "libusb_device_handle *devh" "int interface" Determine if a driver is active on a interface. Returns 0 if no kernel driver -is active, returns 1 if a kernel driver is active, -returns LIBUSB_ERROR_NO_DEVICE -if the device has been disconnected and returns a LIBUSB_ERROR code on failure. +is active, 1 if a kernel driver is active, LIBUSB_ERROR_NO_DEVICE +if the device has been disconnected and a LIBUSB_ERROR code on failure. .Pp .Ft int .Fn libusb_get_driver "libusb_device_handle *devh" "int interface" "char *name" "int namelen" or .Ft int .Fn libusb_get_driver_np "libusb_device_handle *devh" "int interface" "char *name" "int namelen" -Gets the name of the driver attached to the given +Copy the name of the driver attached to the given .Fa device and .Fa interface -into the buffer given by +into the buffer .Fa name -and +of length .Fa namelen . Returns 0 on success, LIBUSB_ERROR_NOT_FOUND if no kernel driver is attached to the given interface and LIBUSB_ERROR_INVALID_PARAM if the interface does @@ -242,7 +246,7 @@ or .Ft int .Fn libusb_detach_kernel_driver_np "libusb_device_handle *devh" "int interface" Detach a kernel driver from an interface. -This is needed to claim an interface required by a kernel driver. +This is needed to claim an interface already claimed by a kernel driver. Returns 0 on success, LIBUSB_ERROR_NOT_FOUND if no kernel driver was active, LIBUSB_ERROR_INVALID_PARAM if the interface does not exist, LIBUSB_ERROR_NO_DEVICE if the device has been disconnected @@ -251,11 +255,11 @@ This function is non-portable. .Pp .Ft int .Fn libusb_attach_kernel_driver "libusb_device_handle *devh" "int interface" -Re-attach an interface kernel driver previously detached. +Re-attach an interface kernel driver that was previously detached. Returns 0 on success, LIBUSB_ERROR_INVALID_PARAM if the interface does not exist, LIBUSB_ERROR_NO_DEVICE -if the device has been disconnect, LIBUSB_ERROR_BUSY if the driver cannot be +if the device has been disconnected, LIBUSB_ERROR_BUSY if the driver cannot be attached because the interface is claimed by a program or driver and a LIBUSB_ERROR code on failure. .Pp @@ -273,24 +277,25 @@ failure. .Fn libsub_get_active_config_descriptor "libusb_device *dev" "struct libusb_config_descriptor **config" Get the USB configuration descriptor for the active configuration. Returns 0 on -success, returns LIBUSB_ERROR_NOT_FOUND if the device is in unconfigured state -and returns another LIBUSB_ERROR code on error. +success, LIBUSB_ERROR_NOT_FOUND if the device is in +an unconfigured state +and a LIBUSB_ERROR code on error. .Pp .Ft int .Fn libusb_get_config_descriptor "libusb_device *dev" "uint8_t config_index" "libusb_config_descriptor **config" -Get USB configuration descriptor based on its index +Get a USB configuration descriptor based on its index .Fa idx. Returns 0 on success, LIBUSB_ERROR_NOT_FOUND if the configuration does not exist -and returns another LIBUSB_ERROR code on error. +and a LIBUSB_ERROR code on error. .Pp .Ft int .Fn libusb_get_config_descriptor_by_value "libusb_device *dev" "uint8 bConfigurationValue" "libusb_config_descriptor **config" Get a USB configuration descriptor with a specific bConfigurationValue. This is -a non-blocking function which does not send request through the device. +a non-blocking function which does not send a request through the device. Returns 0 on success, LIBUSB_ERROR_NOT_FOUND if the configuration -does not exist and another +does not exist and a LIBUSB_ERROR code on failure. .Pp .Ft void @@ -299,17 +304,17 @@ Free a configuration descriptor. .Pp .Ft int .Fn libusb_get_string_descriptor_ascii "libusb_device_handle *devh" "uint8_t desc_idx" "unsigned char *data" "int length" -Retrieve a string descriptor in C style ascii. -Returns a positive number of bytes in the resulting ASCII string +Retrieve a string descriptor in C style ASCII. +Returns the positive number of bytes in the resulting ASCII string on success and a LIBUSB_ERROR code on failure. .Pp .Sh USB ASYNCHRONOUS I/O .Pp .Ft struct libusb_transfer * .Fn libusb_alloc_transfer "int iso_packets" -Allocate a transfer with -.Fa iso_packets -numbers of isochronous packet descriptors. +Allocate a transfer with the number of isochronous packet descriptors +specified by +.Fa iso_packets . Returns NULL on error. .Pp .Ft void @@ -320,13 +325,13 @@ Free a transfer. .Fn libusb_submit_transfer "struct libusb_transfer *tr" This function will submit a transfer and returns immediately. Returns 0 on success, LIBUSB_ERROR_NO_DEVICE if -the device has been disconnected and +the device has been disconnected and a LIBUSB_ERROR code on other failure. .Pp .Ft int .Fn libusb_cancel_transfer "struct libusb_transfer *tr" -This function asynchronously cancel a transfer. -Returns 0 on success and LIBUSB_ERROR code on failure. +This function asynchronously cancels a transfer. +Returns 0 on success and a LIBUSB_ERROR code on failure. .Pp .Sh USB SYNCHRONOUS I/O .Pp @@ -334,14 +339,14 @@ Returns 0 on success and LIBUSB_ERROR co .Fn libusb_control_transfer "libusb_device_handle *devh" "uint8_t bmRequestType" "uint8_t bRequest" "uint16_t wValue" "uint16_t wIndex" "unsigned char *data" "uint16_t wLength" "unsigned int timeout" Perform a USB control transfer. Returns the actual number of bytes -transferred on success in the range from and including zero until and +transferred on success, in the range from and including zero up to and including .Fa wLength . -On error a libusb error code is returned, for example -LIBUSB_ERROR_TIMEOUT if the transfer timeout, LIBUSB_ERROR_PIPE if the +On error a LIBUSB_ERROR code is returned, for example +LIBUSB_ERROR_TIMEOUT if the transfer timed out, LIBUSB_ERROR_PIPE if the control request was not supported, LIBUSB_ERROR_NO_DEVICE if the -device has been disconnected or another LIBUSB_ERROR code on other failures. -The libusb error codes are always negative. +device has been disconnected and another LIBUSB_ERROR code on other failures. +The LIBUSB_ERROR codes are all negative. .Pp .Ft int .Fn libusb_bulk_transfer "struct libusb_device_handle *devh" "unsigned char endpoint" "unsigned char *data" "int length" "int *transferred" "unsigned int timeout" @@ -349,10 +354,10 @@ Perform an USB bulk transfer. A timeout value of zero means no timeout. The timeout value is given in milliseconds. Returns 0 on success, LIBUSB_ERROR_TIMEOUT -if the transfer timeout, LIBUSB_ERROR_PIPE if the control request was not +if the transfer timed out, LIBUSB_ERROR_PIPE if the control request was not supported, LIBUSB_ERROR_OVERFLOW if the device offered more data, LIBUSB_ERROR_NO_DEVICE if the device has been disconnected and -LIBUSB_ERROR code on other failure. +a LIBUSB_ERROR code on other failure. .Pp .Ft int .Fn libusb_interrupt_transfer "struct libusb_device_handle *devh" "unsigned char endpoint" "unsigned char *data" "int length" "int *transferred" "unsigned int timeout" @@ -360,10 +365,10 @@ Perform an USB Interrupt transfer. A timeout value of zero means no timeout. The timeout value is given in milliseconds. Returns 0 on success, LIBUSB_ERROR_TIMEOUT -if the transfer timeout, LIBUSB_ERROR_PIPE if the control request was not +if the transfer timed out, LIBUSB_ERROR_PIPE if the control request was not supported, LIBUSB_ERROR_OVERFLOW if the device offered more data, LIBUSB_ERROR_NO_DEVICE if the device has been disconnected and -LIBUSB_ERROR code on other failure. +a LIBUSB_ERROR code on other failure. .Pp .Sh USB EVENTS .Pp @@ -381,7 +386,8 @@ This function is blocking. .Fn libusb_unlock_events "libusb_context *ctx" Release the event handling lock. This will wake up any thread blocked -on libusb_wait_for_event(). +on +.B libusb_wait_for_event() . .Pp .Ft int .Fn libusb_event_handling_ok "libusb_context *ctx" @@ -394,13 +400,13 @@ the events lock. .Ft int .Fn libusb_event_handler_active "libusb_context *ctx" Determine if an active thread is handling events. -Returns 1 if yes and 0 if there +Returns 1 if there is a thread handling events and 0 if there are no threads currently handling events. .Pp .Ft void .Fn libusb_lock_event_waiters "libusb_context *ctx" Acquire the event_waiters lock. -This lock is designed to be obtained under the +This lock is designed to be obtained in the situation where you want to be aware when events are completed, but some other thread is event handling so calling libusb_handle_events() is not allowed. .Pp @@ -417,7 +423,7 @@ This will block until the timeout expires or a transfer completes or a thread releases the event handling lock through libusb_unlock_events(). Returns 0 after a -transfer completes or another thread stops event handling, returns 1 if the +transfer completes or another thread stops event handling, and 1 if the timeout expired. .Pp .Ft int @@ -431,19 +437,19 @@ LIBUSB_ERROR code on failure. .Fn libusb_handle_events "libusb_context *ctx" Handle any pending events in blocking mode with a sensible timeout. Returns 0 -on success, returns a LIBUSB_ERROR code on failure. +on success and a LIBUSB_ERROR code on failure. .Pp .Ft int .Fn libusb_handle_events_locked "libusb_context *ctx" "struct timeval *tv" Handle any pending events by polling file desciptors, without checking if -another threads are already doing so. +another thread is already doing so. Must be called with the event lock held. .Pp .Ft int .Fn libusb_get_next_timeout "libusb_context *ctx" "struct timeval *tv" Determine the next internal timeout that libusb needs to handle. Returns 0 -if there are no pending timeouts, 1 if a timeout was returned, or LIBUSB_ERROR +if there are no pending timeouts, 1 if a timeout was returned, or a LIBUSB_ERROR code on failure. .Pp .Ft void From owner-svn-src-head@FreeBSD.ORG Mon Aug 22 23:39:40 2011 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 8FE6B106564A; Mon, 22 Aug 2011 23:39:40 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 65C288FC0C; Mon, 22 Aug 2011 23:39:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7MNde2l073340; Mon, 22 Aug 2011 23:39:40 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7MNdepu073338; Mon, 22 Aug 2011 23:39:40 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201108222339.p7MNdepu073338@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 22 Aug 2011 23:39: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: r225096 - head/sys/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: Mon, 22 Aug 2011 23:39:40 -0000 Author: pluknet Date: Mon Aug 22 23:39:40 2011 New Revision: 225096 URL: http://svn.freebsd.org/changeset/base/225096 Log: Fix if_addr_mtx recursion in mld6. mld_set_version() is called only from mld_v1_input_query() and mld_v2_input_query() both holding the if_addr_mtx lock, and then calling into mld_v2_cancel_link_timers() acquires it the second time, which results in mtx recursion. To avoid that, delay if_addr_mtx acquisition until after mld_set_version() is called; while here, further reduce locking scope to protect only the needed pieces: if_multiaddrs, in6m_lookup_locked(). PR: kern/158426 Reported by: Thomas , Tom Vijlbrief Tested by: Tom Vijlbrief Reviewed by: bz Approved by: re (kib) Modified: head/sys/netinet6/mld6.c Modified: head/sys/netinet6/mld6.c ============================================================================== --- head/sys/netinet6/mld6.c Mon Aug 22 23:27:23 2011 (r225095) +++ head/sys/netinet6/mld6.c Mon Aug 22 23:39:40 2011 (r225096) @@ -680,7 +680,6 @@ mld_v1_input_query(struct ifnet *ifp, co IN6_MULTI_LOCK(); MLD_LOCK(); - IF_ADDR_LOCK(ifp); /* * Switch to MLDv1 host compatibility mode. @@ -693,6 +692,7 @@ mld_v1_input_query(struct ifnet *ifp, co if (timer == 0) timer = 1; + IF_ADDR_LOCK(ifp); if (is_general_query) { /* * For each reporting group joined on this @@ -888,7 +888,6 @@ mld_v2_input_query(struct ifnet *ifp, co IN6_MULTI_LOCK(); MLD_LOCK(); - IF_ADDR_LOCK(ifp); mli = MLD_IFINFO(ifp); KASSERT(mli != NULL, ("%s: no mld_ifinfo for ifp %p", __func__, ifp)); @@ -936,14 +935,18 @@ mld_v2_input_query(struct ifnet *ifp, co * Queries for groups we are not a member of on this * link are simply ignored. */ + IF_ADDR_LOCK(ifp); inm = in6m_lookup_locked(ifp, &mld->mld_addr); - if (inm == NULL) + if (inm == NULL) { + IF_ADDR_UNLOCK(ifp); goto out_locked; + } if (nsrc > 0) { if (!ratecheck(&inm->in6m_lastgsrtv, &V_mld_gsrdelay)) { CTR1(KTR_MLD, "%s: GS query throttled.", __func__); + IF_ADDR_UNLOCK(ifp); goto out_locked; } } @@ -961,10 +964,10 @@ mld_v2_input_query(struct ifnet *ifp, co /* XXX Clear embedded scope ID as userland won't expect it. */ in6_clearscope(&mld->mld_addr); + IF_ADDR_UNLOCK(ifp); } out_locked: - IF_ADDR_UNLOCK(ifp); MLD_UNLOCK(); IN6_MULTI_UNLOCK(); From owner-svn-src-head@FreeBSD.ORG Tue Aug 23 08:47:27 2011 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 BFCE6106564A; Tue, 23 Aug 2011 08:47:27 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AFD0A8FC13; Tue, 23 Aug 2011 08:47:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7N8lROq092645; Tue, 23 Aug 2011 08:47:27 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7N8lRO2092643; Tue, 23 Aug 2011 08:47:27 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201108230847.p7N8lRO2092643@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 23 Aug 2011 08:47: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: r225104 - 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, 23 Aug 2011 08:47:27 -0000 Author: ae Date: Tue Aug 23 08:47:27 2011 New Revision: 225104 URL: http://svn.freebsd.org/changeset/base/225104 Log: Fix lock leak. Reported by: Alex Lyashkov Approved by: re (kib) MFC after: 1 week Modified: head/sys/ufs/ufs/ufs_extattr.c Modified: head/sys/ufs/ufs/ufs_extattr.c ============================================================================== --- head/sys/ufs/ufs/ufs_extattr.c Tue Aug 23 07:42:04 2011 (r225103) +++ head/sys/ufs/ufs/ufs_extattr.c Tue Aug 23 08:47:27 2011 (r225104) @@ -1031,14 +1031,14 @@ vop_setextattr { struct ufsmount *ump = VFSTOUFS(mp); int error; - ufs_extattr_uepm_lock(ump, ap->a_td); - /* * XXX: No longer a supported way to delete extended attributes. */ if (ap->a_uio == NULL) return (EINVAL); + ufs_extattr_uepm_lock(ump, ap->a_td); + error = ufs_extattr_set(ap->a_vp, ap->a_attrnamespace, ap->a_name, ap->a_uio, ap->a_cred, ap->a_td); From owner-svn-src-head@FreeBSD.ORG Tue Aug 23 13:17:10 2011 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 027E6106564A; Tue, 23 Aug 2011 13:17:10 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CCF3B8FC08; Tue, 23 Aug 2011 13:17:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7NDH9oj004089; Tue, 23 Aug 2011 13:17:09 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7NDH96I004087; Tue, 23 Aug 2011 13:17:09 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201108231317.p7NDH96I004087@svn.freebsd.org> From: Rick Macklem Date: Tue, 23 Aug 2011 13:17: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: r225109 - head/usr.bin/nfsstat 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, 23 Aug 2011 13:17:10 -0000 Author: rmacklem Date: Tue Aug 23 13:17:09 2011 New Revision: 225109 URL: http://svn.freebsd.org/changeset/base/225109 Log: Fix nfsstat(1) so that it prints out correct stats for the new NFS server when the "-w" option is used. The problem was spotted by hrs@ during testing where srvrpcnt[] must be indexed by NFSV4OP_XXX and not NFSPROC_XXX. Submitted by: hrs Approved by: re (bz) MFC after: 2 weeks Modified: head/usr.bin/nfsstat/nfsstat.c Modified: head/usr.bin/nfsstat/nfsstat.c ============================================================================== --- head/usr.bin/nfsstat/nfsstat.c Tue Aug 23 13:07:30 2011 (r225108) +++ head/usr.bin/nfsstat/nfsstat.c Tue Aug 23 13:17:09 2011 (r225109) @@ -1000,24 +1000,24 @@ exp_sidewaysintpr(u_int interval, int cl if (serverOnly) { printf("%s %6d %6d %6d %6d %6d %6d %6d %6d", ((clientOnly && serverOnly) ? "Server:" : ""), - nfsstats.srvrpccnt[NFSPROC_GETATTR] - - lastst.srvrpccnt[NFSPROC_GETATTR], - nfsstats.srvrpccnt[NFSPROC_LOOKUP] - - lastst.srvrpccnt[NFSPROC_LOOKUP], - nfsstats.srvrpccnt[NFSPROC_READLINK] - - lastst.srvrpccnt[NFSPROC_READLINK], - nfsstats.srvrpccnt[NFSPROC_READ] - - lastst.srvrpccnt[NFSPROC_READ], - nfsstats.srvrpccnt[NFSPROC_WRITE] - - lastst.srvrpccnt[NFSPROC_WRITE], - nfsstats.srvrpccnt[NFSPROC_RENAME] - - lastst.srvrpccnt[NFSPROC_RENAME], - nfsstats.srvrpccnt[NFSPROC_ACCESS] - - lastst.srvrpccnt[NFSPROC_ACCESS], - (nfsstats.srvrpccnt[NFSPROC_READDIR] - - lastst.srvrpccnt[NFSPROC_READDIR]) + - (nfsstats.srvrpccnt[NFSPROC_READDIRPLUS] - - lastst.srvrpccnt[NFSPROC_READDIRPLUS])); + nfsstats.srvrpccnt[NFSV4OP_GETATTR] - + lastst.srvrpccnt[NFSV4OP_GETATTR], + nfsstats.srvrpccnt[NFSV4OP_LOOKUP] - + lastst.srvrpccnt[NFSV4OP_LOOKUP], + nfsstats.srvrpccnt[NFSV4OP_READLINK] - + lastst.srvrpccnt[NFSV4OP_READLINK], + nfsstats.srvrpccnt[NFSV4OP_READ] - + lastst.srvrpccnt[NFSV4OP_READ], + nfsstats.srvrpccnt[NFSV4OP_WRITE] - + lastst.srvrpccnt[NFSV4OP_WRITE], + nfsstats.srvrpccnt[NFSV4OP_RENAME] - + lastst.srvrpccnt[NFSV4OP_RENAME], + nfsstats.srvrpccnt[NFSV4OP_ACCESS] - + lastst.srvrpccnt[NFSV4OP_ACCESS], + (nfsstats.srvrpccnt[NFSV4OP_READDIR] - + lastst.srvrpccnt[NFSV4OP_READDIR]) + + (nfsstats.srvrpccnt[NFSV4OP_READDIRPLUS] - + lastst.srvrpccnt[NFSV4OP_READDIRPLUS])); printf("\n"); lastst = nfsstats; } From owner-svn-src-head@FreeBSD.ORG Tue Aug 23 13:36:09 2011 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 D58C21065679; Tue, 23 Aug 2011 13:36:09 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C55D78FC22; Tue, 23 Aug 2011 13:36:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7NDa9cR004763; Tue, 23 Aug 2011 13:36:09 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7NDa9GL004761; Tue, 23 Aug 2011 13:36:09 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201108231336.p7NDa9GL004761@svn.freebsd.org> From: Adrian Chadd Date: Tue, 23 Aug 2011 13:36: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: r225111 - head/sys/dev/ath/ath_hal/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: Tue, 23 Aug 2011 13:36:09 -0000 Author: adrian Date: Tue Aug 23 13:36:09 2011 New Revision: 225111 URL: http://svn.freebsd.org/changeset/base/225111 Log: These timer registers are all 1uS in resolution in AR5416 or later. Previous hardware had some as TU, some as 1/8th TU. * Modify AR_NEXT_DBA and AR_NEXT_SWBA to use a new macro, ONE_EIGHTH_TU_TO_USEC(), which converts the 1/8th TU fields to USEC. This is just cosmetic and matches the Atheros reference driver. * Fix AR_NEXT_TBTT, which is USEC, not TU. Submitted by: paradyse@gmail.com Approved by: re (kib, blanket) Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c Tue Aug 23 13:25:29 2011 (r225110) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c Tue Aug 23 13:36:09 2011 (r225111) @@ -26,6 +26,7 @@ #include "ar5416/ar5416phy.h" #define TU_TO_USEC(_tu) ((_tu) << 10) +#define ONE_EIGHTH_TU_TO_USEC(_tu8) ((_tu8) << 7) /* * Initialize all of the hardware registers used to @@ -38,8 +39,8 @@ ar5416SetBeaconTimers(struct ath_hal *ah uint32_t bperiod; OS_REG_WRITE(ah, AR_NEXT_TBTT, TU_TO_USEC(bt->bt_nexttbtt)); - OS_REG_WRITE(ah, AR_NEXT_DBA, TU_TO_USEC(bt->bt_nextdba) >> 3); - OS_REG_WRITE(ah, AR_NEXT_SWBA, TU_TO_USEC(bt->bt_nextswba) >> 3); + OS_REG_WRITE(ah, AR_NEXT_DBA, ONE_EIGHTH_TU_TO_USEC(bt->bt_nextdba)); + OS_REG_WRITE(ah, AR_NEXT_SWBA, ONE_EIGHTH_TU_TO_USEC(bt->bt_nextswba)); OS_REG_WRITE(ah, AR_NEXT_NDP, TU_TO_USEC(bt->bt_nextatim)); bperiod = TU_TO_USEC(bt->bt_intval & HAL_BEACON_PERIOD); @@ -144,7 +145,7 @@ ar5416SetStaBeaconTimers(struct ath_hal /* NB: no cfp setting since h/w automatically takes care */ - OS_REG_WRITE(ah, AR_NEXT_TBTT, bs->bs_nexttbtt); + OS_REG_WRITE(ah, AR_NEXT_TBTT, TU_TO_USEC(bs->bs_nexttbtt)); /* * Start the beacon timers by setting the BEACON register From owner-svn-src-head@FreeBSD.ORG Tue Aug 23 13:44:56 2011 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 AF986106564A; Tue, 23 Aug 2011 13:44:56 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 953528FC14; Tue, 23 Aug 2011 13:44:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7NDiuGY005096; Tue, 23 Aug 2011 13:44:56 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7NDiuuh005094; Tue, 23 Aug 2011 13:44:56 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201108231344.p7NDiuuh005094@svn.freebsd.org> From: Rick Macklem Date: Tue, 23 Aug 2011 13:44: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: r225113 - head/usr.bin/nfsstat 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, 23 Aug 2011 13:44:56 -0000 Author: rmacklem Date: Tue Aug 23 13:44:56 2011 New Revision: 225113 URL: http://svn.freebsd.org/changeset/base/225113 Log: Fix nfsstat(1) so that it prints out correct stats for the new NFS server when the "-e" option is not used. The bug was that srvrpccnt[] was being indexed by NFSPROC_XXX when it needs to be indexed by NFSV4OP_XXX. Tested by: hrs Approved by: re (bz) Modified: head/usr.bin/nfsstat/nfsstat.c Modified: head/usr.bin/nfsstat/nfsstat.c ============================================================================== --- head/usr.bin/nfsstat/nfsstat.c Tue Aug 23 13:36:34 2011 (r225112) +++ head/usr.bin/nfsstat/nfsstat.c Tue Aug 23 13:44:56 2011 (r225113) @@ -444,14 +444,14 @@ intpr(int clientOnly, int serverOnly) nfsrvstats.srvrpccnt[NFSPROC_REMOVE]); else printf("%9d %9d %9d %9d %9d %9d %9d %9d\n", - ext_nfsstats.srvrpccnt[NFSPROC_GETATTR], - ext_nfsstats.srvrpccnt[NFSPROC_SETATTR], - ext_nfsstats.srvrpccnt[NFSPROC_LOOKUP], - ext_nfsstats.srvrpccnt[NFSPROC_READLINK], - ext_nfsstats.srvrpccnt[NFSPROC_READ], - ext_nfsstats.srvrpccnt[NFSPROC_WRITE], - ext_nfsstats.srvrpccnt[NFSPROC_CREATE], - ext_nfsstats.srvrpccnt[NFSPROC_REMOVE]); + ext_nfsstats.srvrpccnt[NFSV4OP_GETATTR], + ext_nfsstats.srvrpccnt[NFSV4OP_SETATTR], + ext_nfsstats.srvrpccnt[NFSV4OP_LOOKUP], + ext_nfsstats.srvrpccnt[NFSV4OP_READLINK], + ext_nfsstats.srvrpccnt[NFSV4OP_READ], + ext_nfsstats.srvrpccnt[NFSV4OP_WRITE], + ext_nfsstats.srvrpccnt[NFSV4OP_CREATE], + ext_nfsstats.srvrpccnt[NFSV4OP_REMOVE]); printf("%9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s\n", "Rename", "Link", "Symlink", "Mkdir", "Rmdir", "Readdir", "RdirPlus", "Access"); @@ -467,14 +467,14 @@ intpr(int clientOnly, int serverOnly) nfsrvstats.srvrpccnt[NFSPROC_ACCESS]); else printf("%9d %9d %9d %9d %9d %9d %9d %9d\n", - ext_nfsstats.srvrpccnt[NFSPROC_RENAME], - ext_nfsstats.srvrpccnt[NFSPROC_LINK], - ext_nfsstats.srvrpccnt[NFSPROC_SYMLINK], - ext_nfsstats.srvrpccnt[NFSPROC_MKDIR], - ext_nfsstats.srvrpccnt[NFSPROC_RMDIR], - ext_nfsstats.srvrpccnt[NFSPROC_READDIR], - ext_nfsstats.srvrpccnt[NFSPROC_READDIRPLUS], - ext_nfsstats.srvrpccnt[NFSPROC_ACCESS]); + ext_nfsstats.srvrpccnt[NFSV4OP_RENAME], + ext_nfsstats.srvrpccnt[NFSV4OP_LINK], + ext_nfsstats.srvrpccnt[NFSV4OP_SYMLINK], + ext_nfsstats.srvrpccnt[NFSV4OP_MKDIR], + ext_nfsstats.srvrpccnt[NFSV4OP_RMDIR], + ext_nfsstats.srvrpccnt[NFSV4OP_READDIR], + ext_nfsstats.srvrpccnt[NFSV4OP_READDIRPLUS], + ext_nfsstats.srvrpccnt[NFSV4OP_ACCESS]); printf("%9.9s %9.9s %9.9s %9.9s %9.9s\n", "Mknod", "Fsstat", "Fsinfo", "PathConf", "Commit"); if (run_v4 == 0) @@ -486,11 +486,11 @@ intpr(int clientOnly, int serverOnly) nfsrvstats.srvrpccnt[NFSPROC_COMMIT]); else printf("%9d %9d %9d %9d %9d\n", - ext_nfsstats.srvrpccnt[NFSPROC_MKNOD], - ext_nfsstats.srvrpccnt[NFSPROC_FSSTAT], - ext_nfsstats.srvrpccnt[NFSPROC_FSINFO], - ext_nfsstats.srvrpccnt[NFSPROC_PATHCONF], - ext_nfsstats.srvrpccnt[NFSPROC_COMMIT]); + ext_nfsstats.srvrpccnt[NFSV4OP_MKNOD], + ext_nfsstats.srvrpccnt[NFSV4OP_FSSTAT], + ext_nfsstats.srvrpccnt[NFSV4OP_FSINFO], + ext_nfsstats.srvrpccnt[NFSV4OP_PATHCONF], + ext_nfsstats.srvrpccnt[NFSV4OP_COMMIT]); printf("Server Ret-Failed\n"); if (run_v4 == 0) printf("%17d\n", nfsrvstats.srvrpc_errs); @@ -531,8 +531,8 @@ intpr(int clientOnly, int serverOnly) * only useful for NFSv2. */ printf("%9d %9d %9d\n", - ext_nfsstats.srvrpccnt[NFSPROC_WRITE], - ext_nfsstats.srvrpccnt[NFSPROC_WRITE], 0); + ext_nfsstats.srvrpccnt[NFSV4OP_WRITE], + ext_nfsstats.srvrpccnt[NFSV4OP_WRITE], 0); } } From owner-svn-src-head@FreeBSD.ORG Tue Aug 23 19:29:12 2011 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 AB1401065672; Tue, 23 Aug 2011 19:29:12 +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 3FDAA8FC1F; Tue, 23 Aug 2011 19:29:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7NJTCRQ016434; Tue, 23 Aug 2011 19:29:12 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7NJTCc4016432; Tue, 23 Aug 2011 19:29:12 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201108231929.p7NJTCc4016432@svn.freebsd.org> From: Xin LI Date: Tue, 23 Aug 2011 19:29: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: r225120 - head/etc/rc.d 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, 23 Aug 2011 19:29:12 -0000 Author: delphij Date: Tue Aug 23 19:29:11 2011 New Revision: 225120 URL: http://svn.freebsd.org/changeset/base/225120 Log: Honor WITHOUT_IPX when installing etc/rc.d/ipxrouted. MFC after: 1 week Approved by: re (kib) Modified: head/etc/rc.d/Makefile Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Tue Aug 23 14:37:42 2011 (r225119) +++ head/etc/rc.d/Makefile Tue Aug 23 19:29:11 2011 (r225120) @@ -16,7 +16,7 @@ FILES= DAEMON FILESYSTEMS LOGIN NETWORKI hostapd hostid hostid_save hostname \ inetd initrandom \ ip6addrctl ipfilter ipfs ipfw ipmon \ - ipnat ipsec ipxrouted \ + ipnat ipsec \ jail \ kadmind kerberos keyserv kld kldxref kpasswdd \ ldconfig local localpkg lockd lpd \ @@ -42,6 +42,10 @@ FILES= DAEMON FILESYSTEMS LOGIN NETWORKI ypset ypupdated ypxfrd \ zfs zvol +.if ${MK_IPX} != "no" +FILES+= ipxrouted +.endif + .if ${MK_OFED} != "no" FILES+= opensm .endif From owner-svn-src-head@FreeBSD.ORG Tue Aug 23 19:49:06 2011 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 846C21065676; Tue, 23 Aug 2011 19:49:06 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 746238FC1D; Tue, 23 Aug 2011 19:49:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7NJn6DW017067; Tue, 23 Aug 2011 19:49:06 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7NJn6YZ017065; Tue, 23 Aug 2011 19:49:06 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201108231949.p7NJn6YZ017065@svn.freebsd.org> From: Martin Matuska Date: Tue, 23 Aug 2011 19:49: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: r225121 - head/usr.sbin/makefs 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, 23 Aug 2011 19:49:06 -0000 Author: mm Date: Tue Aug 23 19:49:06 2011 New Revision: 225121 URL: http://svn.freebsd.org/changeset/base/225121 Log: Fix buffer overflow and possible ISO image corruption in wrong handling of "." character case in makefs ISO level 1 and 2 filename conversion. Filed as NetBSD PR #45285 http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=45285 Reviewed by: Christos Zoulas Approved by: re (kib) MFC after: 3 days Modified: head/usr.sbin/makefs/cd9660.c Modified: head/usr.sbin/makefs/cd9660.c ============================================================================== --- head/usr.sbin/makefs/cd9660.c Tue Aug 23 19:29:11 2011 (r225120) +++ head/usr.sbin/makefs/cd9660.c Tue Aug 23 19:49:06 2011 (r225121) @@ -1627,7 +1627,7 @@ cd9660_level1_convert_filename(const cha int extlen = 0; int found_ext = 0; - while (*oldname != '\0') { + while (*oldname != '\0' && extlen < 3) { /* Handle period first, as it is special */ if (*oldname == '.') { if (found_ext) { @@ -1644,10 +1644,8 @@ cd9660_level1_convert_filename(const cha *oldname == ',' && strlen(oldname) == 4) break; /* Enforce 12.3 / 8 */ - if (((namelen == 8) && !found_ext) || - (found_ext && extlen == 3)) { + if (namelen == 8 && !found_ext) break; - } if (islower((unsigned char)*oldname)) *newname++ = toupper((unsigned char)*oldname); @@ -1690,7 +1688,7 @@ cd9660_level2_convert_filename(const cha int extlen = 0; int found_ext = 0; - while (*oldname != '\0') { + while (*oldname != '\0' && namelen + extlen < 30) { /* Handle period first, as it is special */ if (*oldname == '.') { if (found_ext) { @@ -1710,8 +1708,6 @@ cd9660_level2_convert_filename(const cha if (diskStructure.archimedes_enabled && *oldname == ',' && strlen(oldname) == 4) break; - if ((namelen + extlen) == 30) - break; if (islower((unsigned char)*oldname)) *newname++ = toupper((unsigned char)*oldname); From owner-svn-src-head@FreeBSD.ORG Tue Aug 23 20:25:11 2011 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 8F3A3106566C; Tue, 23 Aug 2011 20:25:11 +0000 (UTC) (envelope-from marck@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7ECD88FC16; Tue, 23 Aug 2011 20:25:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7NKPBWo018177; Tue, 23 Aug 2011 20:25:11 GMT (envelope-from marck@svn.freebsd.org) Received: (from marck@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7NKPBBR018175; Tue, 23 Aug 2011 20:25:11 GMT (envelope-from marck@svn.freebsd.org) Message-Id: <201108232025.p7NKPBBR018175@svn.freebsd.org> From: Dmitry Morozovsky Date: Tue, 23 Aug 2011 20:25: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: r225122 - 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: Tue, 23 Aug 2011 20:25:11 -0000 Author: marck (doc committer) Date: Tue Aug 23 20:25:11 2011 New Revision: 225122 URL: http://svn.freebsd.org/changeset/base/225122 Log: Add kern.cam.boot_delay description (with reasonable default) to default/loader.conf This should help people installing ${OS} to USB devices, where there are frequently cases where kernel tries to mount root before actual umass sensing is finished. Reviewed by: mav Approved by: re (kib) MFC after: 1 week Modified: head/sys/boot/forth/loader.conf Modified: head/sys/boot/forth/loader.conf ============================================================================== --- head/sys/boot/forth/loader.conf Tue Aug 23 19:49:06 2011 (r225121) +++ head/sys/boot/forth/loader.conf Tue Aug 23 20:25:11 2011 (r225122) @@ -109,6 +109,8 @@ module_path="/boot/modules" # Set the mo #kern.ncallout="" # Set the maximum # of timer events #kern.ngroups="1023" # Set the maximum # of supplemental groups #kern.sgrowsiz="" # Set the amount to grow stack +#kern.cam.boot_delay="10000" # Delay (in ms) of root mount for CAM bus + # registration, useful for USB sticks as root #kern.cam.scsi_delay="2000" # Delay (in ms) before probing SCSI #kern.ipc.maxsockets="" # Set the maximum number of sockets avaliable #kern.ipc.nmbclusters="" # Set the number of mbuf clusters From owner-svn-src-head@FreeBSD.ORG Wed Aug 24 00:45:54 2011 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 6C590106564A; Wed, 24 Aug 2011 00:45:54 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4292B8FC08; Wed, 24 Aug 2011 00:45:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7O0jsci026350; Wed, 24 Aug 2011 00:45:54 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7O0jsuR026347; Wed, 24 Aug 2011 00:45:54 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201108240045.p7O0jsuR026347@svn.freebsd.org> From: Adrian Chadd Date: Wed, 24 Aug 2011 00:45: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: r225125 - head/sys/dev/ath/ath_hal/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: Wed, 24 Aug 2011 00:45:54 -0000 Author: adrian Date: Wed Aug 24 00:45:53 2011 New Revision: 225125 URL: http://svn.freebsd.org/changeset/base/225125 Log: TIM/Timer fixes for AR5416 and later: * Fix SLEEP1/SLEEP2 register definitions; the CAB/Beacon timeout fields have changed in AR5416 and later * The TIM_PERIOD and DTIM_PERIOD registers are now microsecond fields, not TU. Obtained from: Linux ath9k, Atheros reference Approved by: re (kib, blanket) Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c Tue Aug 23 23:33:38 2011 (r225124) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c Wed Aug 24 00:45:53 2011 (r225125) @@ -222,15 +222,19 @@ ar5416SetStaBeaconTimers(struct ath_hal OS_REG_WRITE(ah, AR_NEXT_TIM, TU_TO_USEC(nextTbtt - SLEEP_SLOP)); /* cab timeout is now in 1/8 TU */ - OS_REG_WRITE(ah, AR_SLEEP1, + OS_REG_WRITE(ah, AR5416_SLEEP1, SM((CAB_TIMEOUT_VAL << 3), AR5416_SLEEP1_CAB_TIMEOUT) - | AR_SLEEP1_ASSUME_DTIM); + | AR5416_SLEEP1_ASSUME_DTIM); + + /* XXX autosleep? Use min beacon timeout; check ath9k -adrian */ /* beacon timeout is now in 1/8 TU */ - OS_REG_WRITE(ah, AR_SLEEP2, + OS_REG_WRITE(ah, AR5416_SLEEP2, SM((BEACON_TIMEOUT_VAL << 3), AR5416_SLEEP2_BEACON_TIMEOUT)); - OS_REG_WRITE(ah, AR_TIM_PERIOD, beaconintval); - OS_REG_WRITE(ah, AR_DTIM_PERIOD, dtimperiod); + /* TIM_PERIOD and DTIM_PERIOD are now in uS. */ + OS_REG_WRITE(ah, AR_TIM_PERIOD, TU_TO_USEC(beaconintval)); + OS_REG_WRITE(ah, AR_DTIM_PERIOD, TU_TO_USEC(dtimperiod)); + OS_REG_SET_BIT(ah, AR_TIMER_MODE, AR_TIMER_MODE_TBTT | AR_TIMER_MODE_TIM | AR_TIMER_MODE_DTIM); HALDEBUG(ah, HAL_DEBUG_BEACON, "%s: next DTIM %d\n", Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Tue Aug 23 23:33:38 2011 (r225124) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Wed Aug 24 00:45:53 2011 (r225125) @@ -79,6 +79,13 @@ #endif /* AH_SUPPORT_AR9130 */ #define AR_RESET_TSF 0x8020 + +/* + * AR_SLEEP1 / AR_SLEEP2 are in the same place as in + * AR5212, however the fields have changed. + */ +#define AR5416_SLEEP1 0x80d4 +#define AR5416_SLEEP2 0x80d8 #define AR_RXFIFO_CFG 0x8114 #define AR_PHY_ERR_1 0x812c #define AR_PHY_ERR_MASK_1 0x8130 /* mask for AR_PHY_ERR_1 */ @@ -402,6 +409,7 @@ #define AR9271_AN_RF2G6_OFFS_S 20 /* Sleep control */ +#define AR5416_SLEEP1_ASSUME_DTIM 0x00080000 #define AR5416_SLEEP1_CAB_TIMEOUT 0xFFE00000 /* Cab timeout (TU) */ #define AR5416_SLEEP1_CAB_TIMEOUT_S 22 From owner-svn-src-head@FreeBSD.ORG Wed Aug 24 08:53:34 2011 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 5AF6C1065672; Wed, 24 Aug 2011 08:53:34 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B0EC8FC1C; Wed, 24 Aug 2011 08:53:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7O8rYG9041436; Wed, 24 Aug 2011 08:53:34 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7O8rYQo041434; Wed, 24 Aug 2011 08:53:34 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201108240853.p7O8rYQo041434@svn.freebsd.org> From: Adrian Chadd Date: Wed, 24 Aug 2011 08:53: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: r225139 - 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: Wed, 24 Aug 2011 08:53:34 -0000 Author: adrian Date: Wed Aug 24 08:53:33 2011 New Revision: 225139 URL: http://svn.freebsd.org/changeset/base/225139 Log: This patch fixes beacon frame sequence number generation. The code didn't set a sequence number; it didn't show up earlier because the hardware most people use for hostap (ie, AR5212 series stuff) sets the sequence numbers up in hardware. Later hardware (AR5416, etc) which can do 11n and aggregation require sequence numbers to be generated in software. Submitted by: paradyse@gmail.com Approved by: re (kib) Modified: head/sys/net80211/ieee80211_output.c Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Wed Aug 24 08:38:44 2011 (r225138) +++ head/sys/net80211/ieee80211_output.c Wed Aug 24 08:53:33 2011 (r225139) @@ -2792,6 +2792,8 @@ ieee80211_beacon_update(struct ieee80211 struct ieee80211com *ic = ni->ni_ic; int len_changed = 0; uint16_t capinfo; + struct ieee80211_frame *wh; + ieee80211_seq seqno; IEEE80211_LOCK(ic); /* @@ -2823,6 +2825,12 @@ ieee80211_beacon_update(struct ieee80211 return 1; /* just assume length changed */ } + wh = mtod(m, struct ieee80211_frame *); + seqno = ni->ni_txseqs[IEEE80211_NONQOS_TID]++; + *(uint16_t *)&wh->i_seq[0] = + htole16(seqno << IEEE80211_SEQ_SEQ_SHIFT); + M_SEQNO_SET(m, seqno); + /* XXX faster to recalculate entirely or just changes? */ capinfo = ieee80211_getcapinfo(vap, ni->ni_chan); *bo->bo_caps = htole16(capinfo); From owner-svn-src-head@FreeBSD.ORG Wed Aug 24 09:08:08 2011 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 4F11A106566C; Wed, 24 Aug 2011 09:08:08 +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 3F65A8FC16; Wed, 24 Aug 2011 09:08:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7O988QB041910; Wed, 24 Aug 2011 09:08:08 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7O9881P041908; Wed, 24 Aug 2011 09:08:08 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201108240908.p7O9881P041908@svn.freebsd.org> From: Alexander Motin Date: Wed, 24 Aug 2011 09:08:08 +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: r225140 - head/sys/dev/ahci 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, 24 Aug 2011 09:08:08 -0000 Author: mav Date: Wed Aug 24 09:08:07 2011 New Revision: 225140 URL: http://svn.freebsd.org/changeset/base/225140 Log: Add ID for ASMedia ASM1061 2-port PCIe 2.0 x1 6Gb/s SATA controller. Approved by: re (blackend) MFC after: 1 week Modified: head/sys/dev/ahci/ahci.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Wed Aug 24 08:53:33 2011 (r225139) +++ head/sys/dev/ahci/ahci.c Wed Aug 24 09:08:07 2011 (r225140) @@ -128,6 +128,7 @@ static struct { {0x43931002, 0x00, "ATI IXP700", 0}, {0x43941002, 0x00, "ATI IXP800", 0}, {0x43951002, 0x00, "ATI IXP800", 0}, + {0x06121b21, 0x00, "ASMedia ASM1061", 0}, {0x26528086, 0x00, "Intel ICH6", AHCI_Q_NOFORCE}, {0x26538086, 0x00, "Intel ICH6M", AHCI_Q_NOFORCE}, {0x26818086, 0x00, "Intel ESB2", 0}, From owner-svn-src-head@FreeBSD.ORG Wed Aug 24 10:37:02 2011 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 7E98E106564A; Wed, 24 Aug 2011 10:37:02 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) by mx1.freebsd.org (Postfix) with ESMTP id C3A938FC12; Wed, 24 Aug 2011 10:37:01 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1QwApc-0009uE-74; Wed, 24 Aug 2011 14:37:12 +0400 Date: Wed, 24 Aug 2011 14:37:12 +0400 From: Slawa Olhovchenkov To: Alexander Motin Message-ID: <20110824103712.GA38495@zxy.spb.ru> References: <201105310922.p4V9MqYY016057@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201105310922.p4V9MqYY016057@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r222520 - head/sys/cam/ata 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, 24 Aug 2011 10:37:02 -0000 On Tue, May 31, 2011 at 09:22:52AM +0000, Alexander Motin wrote: > Author: mav > Date: Tue May 31 09:22:52 2011 > New Revision: 222520 > URL: http://svn.freebsd.org/changeset/base/222520 > > Log: > Add quirks to hint 4K physical sector (Advanced Format) for ATA disks not > reporting it properly (none? of known disks now). > > Hitachi and WDC AF disks seem could be identified more or less formally. > For Seagate and Samsung enumerate some found models/series. > For other disks it can be forced with kern.cam.ada.X.quirks=1 tunable. May be right time to introduce new module, 'quirks'? For dynamic loading quirk tables for any drivers (ata, usb, umass etc.)? From owner-svn-src-head@FreeBSD.ORG Wed Aug 24 12:18:29 2011 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 BC69F106564A; Wed, 24 Aug 2011 12:18:29 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AD3418FC12; Wed, 24 Aug 2011 12:18:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7OCITWT053856; Wed, 24 Aug 2011 12:18:29 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7OCITW1053854; Wed, 24 Aug 2011 12:18:29 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201108241218.p7OCITW1053854@svn.freebsd.org> From: Glen Barber Date: Wed, 24 Aug 2011 12:18:29 +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: r225142 - 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: Wed, 24 Aug 2011 12:18:29 -0000 Author: gjb (doc committer) Date: Wed Aug 24 12:18:29 2011 New Revision: 225142 URL: http://svn.freebsd.org/changeset/base/225142 Log: Reword sentence noting UPDATING entries prior to October 2007 are only available in older FreeBSD releases. PR: 159220 Submitted by: arundel Patch by: Benjamin Kaduk (kaduk % mit ! edu) OK'd by: imp (via -doc@) MFC after: 1 week Approved by: re (kib) Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed Aug 24 09:54:21 2011 (r225141) +++ head/UPDATING Wed Aug 24 12:18:29 2011 (r225142) @@ -1456,9 +1456,10 @@ COMMON ITEMS: FORMAT: This file contains a list, in reverse chronological order, of major -breakages in tracking -current. Not all things will be listed here, -and it only starts on October 16, 2004. Updating files can found in -previous releases if your system is older than this. +breakages in tracking -current. It is not guaranteed to be a complete +list of such breakages, and only contains entries since October 10, 2007. +If you need to see UPDATING entries from before that date, you will need +to fetch an UPDATING file from an older FreeBSD release. Copyright information: From owner-svn-src-head@FreeBSD.ORG Wed Aug 24 14:11:01 2011 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 299E0106566B; Wed, 24 Aug 2011 14:11:01 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 194588FC18; Wed, 24 Aug 2011 14:11:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7OEB0ZM057966; Wed, 24 Aug 2011 14:11:00 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7OEB03r057961; Wed, 24 Aug 2011 14:11:00 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201108241411.p7OEB03r057961@svn.freebsd.org> From: Adrian Chadd Date: Wed, 24 Aug 2011 14:11: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: r225145 - 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: Wed, 24 Aug 2011 14:11:01 -0000 Author: adrian Date: Wed Aug 24 14:11:00 2011 New Revision: 225145 URL: http://svn.freebsd.org/changeset/base/225145 Log: Fix a missing initialisation of bt_flags when setting up the TDMA beacon. The AR5212 HAL didn't check this field; timers are enabled a different way. The AR5416 HAL however did, and since this field was uninitialised, it had whatever was on the stack at the time. This lead to "unpredictable" behaviour. This allows TDMA to work on the AR5416 and later chipsets. Thanks to: paradyse@gmail.com Approved by: re (kib, blanket) Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Wed Aug 24 14:09:32 2011 (r225144) +++ head/sys/dev/ath/if_ath.c Wed Aug 24 14:11:00 2011 (r225145) @@ -5485,6 +5485,8 @@ ath_tdma_settimers(struct ath_softc *sc, bt.bt_nextdba = (nexttbtt<<3) - sc->sc_tdmadbaprep; bt.bt_nextswba = (nexttbtt<<3) - sc->sc_tdmaswbaprep; bt.bt_nextatim = nexttbtt+1; + /* Enables TBTT, DBA, SWBA timers by default */ + bt.bt_flags = 0; ath_hal_beaconsettimers(ah, &bt); } From owner-svn-src-head@FreeBSD.ORG Wed Aug 24 20:05:13 2011 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 6EAFF1065672; Wed, 24 Aug 2011 20:05:13 +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 5C68F8FC0A; Wed, 24 Aug 2011 20:05:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7OK5D7b068722; Wed, 24 Aug 2011 20:05:13 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7OK5DMd068712; Wed, 24 Aug 2011 20:05:13 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201108242005.p7OK5DMd068712@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 24 Aug 2011 20:05:13 +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: r225152 - head/libexec/rtld-elf 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, 24 Aug 2011 20:05:13 -0000 Author: kib Date: Wed Aug 24 20:05:13 2011 New Revision: 225152 URL: http://svn.freebsd.org/changeset/base/225152 Log: Rtld links with the specially built pic static libc library to get some C runtime services, like printf(). Unfortunately, the multithread-safeness measures in the libc do not work in rtld environment. Rip the kernel printf() implementation and use it in the rtld instead of libc version. This printf does not require any shared global data and thus is mt-safe. Systematically use rtld_printf() and related functions, remove the calls to err(3). Note that stdio is still pulled from libc due to libmap implementaion using fopen(). This is safe but unoptimal, and can be changed later. Reported and tested by: pgj Diagnosed and reviewed by: kan (previous version) Approved by: re (bz) Added: head/libexec/rtld-elf/rtld_printf.c (contents, props changed) head/libexec/rtld-elf/rtld_printf.h (contents, props changed) Modified: head/libexec/rtld-elf/Makefile head/libexec/rtld-elf/debug.c head/libexec/rtld-elf/malloc.c head/libexec/rtld-elf/rtld.c head/libexec/rtld-elf/rtld.h head/libexec/rtld-elf/rtld_lock.c head/libexec/rtld-elf/xmalloc.c Modified: head/libexec/rtld-elf/Makefile ============================================================================== --- head/libexec/rtld-elf/Makefile Wed Aug 24 19:27:49 2011 (r225151) +++ head/libexec/rtld-elf/Makefile Wed Aug 24 20:05:13 2011 (r225152) @@ -5,7 +5,7 @@ MK_SSP= no PROG?= ld-elf.so.1 SRCS= rtld_start.S \ - reloc.c rtld.c rtld_lock.c map_object.c \ + reloc.c rtld.c rtld_lock.c rtld_printf.c map_object.c \ malloc.c xmalloc.c debug.c libmap.c MAN= rtld.1 CSTD?= gnu99 Modified: head/libexec/rtld-elf/debug.c ============================================================================== --- head/libexec/rtld-elf/debug.c Wed Aug 24 19:27:49 2011 (r225151) +++ head/libexec/rtld-elf/debug.c Wed Aug 24 20:05:13 2011 (r225152) @@ -34,6 +34,7 @@ #include "debug.h" #include "rtld.h" +#include "rtld_printf.h" static const char rel_header[] = " symbol name r_info r_offset st_value st_size address value\n" @@ -49,9 +50,8 @@ debug_printf(const char *format, ...) va_list ap; va_start(ap, format); - fflush(stdout); - vfprintf(stderr, format, ap); - putc('\n', stderr); + rtld_vfdprintf(STDERR_FILENO, format, ap); + rtld_fdputchar(STDERR_FILENO, '\n'); va_end(ap); } @@ -71,28 +71,28 @@ void dump_obj_relocations (Obj_Entry *obj) { - printf("Object \"%s\", relocbase %p\n", obj->path, obj->relocbase); + rtld_printf("Object \"%s\", relocbase %p\n", obj->path, obj->relocbase); if (obj->relsize) { - printf("Non-PLT Relocations: %ld\n", + rtld_printf("Non-PLT Relocations: %ld\n", (obj->relsize / sizeof(Elf_Rel))); dump_Elf_Rel(obj, obj->rel, obj->relsize); } if (obj->relasize) { - printf("Non-PLT Relocations with Addend: %ld\n", + rtld_printf("Non-PLT Relocations with Addend: %ld\n", (obj->relasize / sizeof(Elf_Rela))); dump_Elf_Rela(obj, obj->rela, obj->relasize); } if (obj->pltrelsize) { - printf("PLT Relocations: %ld\n", + rtld_printf("PLT Relocations: %ld\n", (obj->pltrelsize / sizeof(Elf_Rel))); dump_Elf_Rel(obj, obj->pltrel, obj->pltrelsize); } if (obj->pltrelasize) { - printf("PLT Relocations with Addend: %ld\n", + rtld_printf("PLT Relocations with Addend: %ld\n", (obj->pltrelasize / sizeof(Elf_Rela))); dump_Elf_Rela(obj, obj->pltrela, obj->pltrelasize); } @@ -106,12 +106,12 @@ dump_Elf_Rel (Obj_Entry *obj, const Elf_ const Elf_Sym *sym; Elf_Addr *dstaddr; - printf("%s", rel_header); + rtld_putstr(rel_header); rellim = (const Elf_Rel *)((const char *)rel0 + relsize); for (rel = rel0; rel < rellim; rel++) { dstaddr = (Elf_Addr *)(obj->relocbase + rel->r_offset); sym = obj->symtab + ELF_R_SYM(rel->r_info); - printf(rel_format, + rtld_printf(rel_format, obj->strtab + sym->st_name, (u_long)rel->r_info, (u_long)rel->r_offset, (u_long)sym->st_value, (int)sym->st_size, @@ -128,12 +128,12 @@ dump_Elf_Rela (Obj_Entry *obj, const Elf const Elf_Sym *sym; Elf_Addr *dstaddr; - printf("%s", rel_header); + rtld_putstr(rel_header); relalim = (const Elf_Rela *)((const char *)rela0 + relasize); for (rela = rela0; rela < relalim; rela++) { dstaddr = (Elf_Addr *)(obj->relocbase + rela->r_offset); sym = obj->symtab + ELF_R_SYM(rela->r_info); - printf(rel_format, + rtld_printf(rel_format, obj->strtab + sym->st_name, (u_long)rela->r_info, (u_long)rela->r_offset, (u_long)sym->st_value, (int)sym->st_size, Modified: head/libexec/rtld-elf/malloc.c ============================================================================== --- head/libexec/rtld-elf/malloc.c Wed Aug 24 19:27:49 2011 (r225151) +++ head/libexec/rtld-elf/malloc.c Wed Aug 24 20:05:13 2011 (r225152) @@ -49,7 +49,6 @@ static char *rcsid = "$FreeBSD$"; #include #include -#include #include #include #include @@ -59,6 +58,7 @@ static char *rcsid = "$FreeBSD$"; #include #include #include +#include "rtld_printf.h" #ifndef BSD #define MAP_COPY MAP_PRIVATE #define MAP_FILE 0 @@ -150,8 +150,7 @@ botch(s) #endif /* Debugging stuff */ -static void xprintf(const char *, ...); -#define TRACE() xprintf("TRACE %s:%d\n", __FILE__, __LINE__) +#define TRACE() rtld_printf("TRACE %s:%d\n", __FILE__, __LINE__) extern int pagesize; @@ -503,7 +502,8 @@ int n; caddr_t addr = (caddr_t) (((long)pagepool_start + pagesz - 1) & ~(pagesz - 1)); if (munmap(addr, pagepool_end - addr) != 0) - warn("morepages: munmap %p", addr); + rtld_fdprintf(STDERR_FILENO, "morepages: munmap %p", + addr); } offset = (long)pagepool_start - ((long)pagepool_start & ~(pagesz - 1)); @@ -511,7 +511,7 @@ int n; if ((pagepool_start = mmap(0, n * pagesz, PROT_READ|PROT_WRITE, MAP_ANON|MAP_COPY, fd, 0)) == (caddr_t)-1) { - xprintf("Cannot map anonymous memory"); + rtld_printf("Cannot map anonymous memory\n"); return 0; } pagepool_end = pagepool_start + n * pagesz; @@ -522,18 +522,3 @@ int n; #endif return n; } - -/* - * Non-mallocing printf, for use by malloc itself. - */ -static void -xprintf(const char *fmt, ...) -{ - char buf[256]; - va_list ap; - - va_start(ap, fmt); - vsprintf(buf, fmt, ap); - (void)write(STDOUT_FILENO, buf, strlen(buf)); - va_end(ap); -} Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Wed Aug 24 19:27:49 2011 (r225151) +++ head/libexec/rtld-elf/rtld.c Wed Aug 24 20:05:13 2011 (r225152) @@ -60,6 +60,7 @@ #include "rtld.h" #include "libmap.h" #include "rtld_tls.h" +#include "rtld_printf.h" #ifndef COMPAT_32BIT #define PATH_RTLD "/libexec/ld-elf.so.1" @@ -603,7 +604,7 @@ _rtld_error(const char *fmt, ...) va_list ap; va_start(ap, fmt); - vsnprintf(buf, sizeof buf, fmt, ap); + rtld_vsnprintf(buf, sizeof buf, fmt, ap); error_message = buf; va_end(ap); } @@ -723,7 +724,8 @@ die(void) if (msg == NULL) msg = "Fatal error"; - errx(1, "%s", msg); + rtld_fdputstr(STDERR_FILENO, msg); + _exit(1); } /* @@ -3187,7 +3189,7 @@ trace_loaded_objects(Obj_Entry *obj) bool is_lib; if (list_containers && obj->needed != NULL) - printf("%s:\n", obj->path); + rtld_printf("%s:\n", obj->path); for (needed = obj->needed; needed; needed = needed->next) { if (needed->obj != NULL) { if (needed->obj->traced && !list_containers) @@ -3204,17 +3206,17 @@ trace_loaded_objects(Obj_Entry *obj) while ((c = *fmt++) != '\0') { switch (c) { default: - putchar(c); + rtld_putchar(c); continue; case '\\': switch (c = *fmt) { case '\0': continue; case 'n': - putchar('\n'); + rtld_putchar('\n'); break; case 't': - putchar('\t'); + rtld_putchar('\t'); break; } break; @@ -3224,30 +3226,31 @@ trace_loaded_objects(Obj_Entry *obj) continue; case '%': default: - putchar(c); + rtld_putchar(c); break; case 'A': - printf("%s", main_local); + rtld_putstr(main_local); break; case 'a': - printf("%s", obj_main->path); + rtld_putstr(obj_main->path); break; case 'o': - printf("%s", name); + rtld_putstr(name); break; #if 0 case 'm': - printf("%d", sodp->sod_major); + rtld_printf("%d", sodp->sod_major); break; case 'n': - printf("%d", sodp->sod_minor); + rtld_printf("%d", sodp->sod_minor); break; #endif case 'p': - printf("%s", path); + rtld_putstr(path); break; case 'x': - printf("%p", needed->obj ? needed->obj->mapbase : 0); + rtld_printf("%p", needed->obj ? needed->obj->mapbase : + 0); break; } break; Modified: head/libexec/rtld-elf/rtld.h ============================================================================== --- head/libexec/rtld-elf/rtld.h Wed Aug 24 19:27:49 2011 (r225151) +++ head/libexec/rtld-elf/rtld.h Wed Aug 24 20:05:13 2011 (r225152) @@ -34,6 +34,7 @@ #include #include +#include #include #include Modified: head/libexec/rtld-elf/rtld_lock.c ============================================================================== --- head/libexec/rtld-elf/rtld_lock.c Wed Aug 24 19:27:49 2011 (r225151) +++ head/libexec/rtld-elf/rtld_lock.c Wed Aug 24 20:05:13 2011 (r225152) @@ -182,8 +182,6 @@ rtld_lock_t rtld_bind_lock = &rtld_locks rtld_lock_t rtld_libc_lock = &rtld_locks[1]; rtld_lock_t rtld_phdr_lock = &rtld_locks[2]; -#define print_ebp(str) do {register long ebp asm("ebp"); printf("%s 0x%0lx\n", str, ebp);} while (0) - void rlock_acquire(rtld_lock_t lock, RtldLockState *lockstate) { Added: head/libexec/rtld-elf/rtld_printf.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/libexec/rtld-elf/rtld_printf.c Wed Aug 24 20:05:13 2011 (r225152) @@ -0,0 +1,482 @@ +/*- + * Copyright (c) 1986, 1988, 1991, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * Copyright (c) 2011 Konstantin Belousov + * + * 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. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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$ + */ + +#include +#include +#include +#include +#include +#include +#include +#include "rtld_printf.h" + +#define MAXNBUF (sizeof(intmax_t) * NBBY + 1) + +struct snprintf_arg { + char *str; + char *buf; + size_t remain; + size_t buf_total; + int fd; +}; + +static void +snprintf_func(int ch, struct snprintf_arg *const info) +{ + + if (info->remain >= 2) { + *info->str++ = ch; + info->remain--; + } +} + +static void +printf_out(struct snprintf_arg *info) +{ + + if (info->remain == info->buf_total) + return; + write(info->fd, info->buf, info->buf_total - info->remain); + info->str = info->buf; + info->remain = info->buf_total; +} + +static void +printf_func(int ch, struct snprintf_arg *const info) +{ + + if (info->remain > 0) { + *info->str++ = ch; + info->remain--; + } else + printf_out(info); +} + +static char const hex2ascii_data[] = "0123456789abcdefghijklmnopqrstuvwxyz"; +#define hex2ascii(hex) (hex2ascii_data[hex]) + +static __inline int +imax(int a, int b) +{ + + return (a > b ? a : b); +} + +static char * +ksprintn(char *nbuf, uintmax_t num, int base, int *lenp, int upper) +{ + char *p, c; + + p = nbuf; + *p = '\0'; + do { + c = hex2ascii(num % base); + *++p = upper ? toupper(c) : c; + } while (num /= base); + if (lenp) + *lenp = p - nbuf; + return (p); +} + +static int +kvprintf(char const *fmt, void (*func)(int c, struct snprintf_arg *const arg), + struct snprintf_arg *arg, int radix, va_list ap) +{ +#define PCHAR(c) func((c), arg) + char nbuf[MAXNBUF]; + const char *p, *percent, *q; + u_char *up; + int ch, n; + uintmax_t num; + int base, lflag, qflag, tmp, width, ladjust, sharpflag, neg, sign, dot; + int cflag, hflag, jflag, tflag, zflag; + int dwidth, upper; + char padc; + int stop = 0, retval = 0; + + num = 0; + + if (fmt == NULL) + fmt = "(fmt null)\n"; + + if (radix < 2 || radix > 36) + radix = 10; + + for (;;) { + padc = ' '; + width = 0; + while ((ch = (u_char)*fmt++) != '%' || stop) { + if (ch == '\0') + return (retval); + PCHAR(ch); + } + percent = fmt - 1; + qflag = 0; lflag = 0; ladjust = 0; sharpflag = 0; neg = 0; + sign = 0; dot = 0; dwidth = 0; upper = 0; + cflag = 0; hflag = 0; jflag = 0; tflag = 0; zflag = 0; +reswitch: switch (ch = (u_char)*fmt++) { + case '.': + dot = 1; + goto reswitch; + case '#': + sharpflag = 1; + goto reswitch; + case '+': + sign = 1; + goto reswitch; + case '-': + ladjust = 1; + goto reswitch; + case '%': + PCHAR(ch); + break; + case '*': + if (!dot) { + width = va_arg(ap, int); + if (width < 0) { + ladjust = !ladjust; + width = -width; + } + } else { + dwidth = va_arg(ap, int); + } + goto reswitch; + case '0': + if (!dot) { + padc = '0'; + goto reswitch; + } + case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + for (n = 0;; ++fmt) { + n = n * 10 + ch - '0'; + ch = *fmt; + if (ch < '0' || ch > '9') + break; + } + if (dot) + dwidth = n; + else + width = n; + goto reswitch; + case 'b': + num = (u_int)va_arg(ap, int); + p = va_arg(ap, char *); + for (q = ksprintn(nbuf, num, *p++, NULL, 0); *q;) + PCHAR(*q--); + + if (num == 0) + break; + + for (tmp = 0; *p;) { + n = *p++; + if (num & (1 << (n - 1))) { + PCHAR(tmp ? ',' : '<'); + for (; (n = *p) > ' '; ++p) + PCHAR(n); + tmp = 1; + } else + for (; *p > ' '; ++p) + continue; + } + if (tmp) + PCHAR('>'); + break; + case 'c': + PCHAR(va_arg(ap, int)); + break; + case 'D': + up = va_arg(ap, u_char *); + p = va_arg(ap, char *); + if (!width) + width = 16; + while(width--) { + PCHAR(hex2ascii(*up >> 4)); + PCHAR(hex2ascii(*up & 0x0f)); + up++; + if (width) + for (q=p;*q;q++) + PCHAR(*q); + } + break; + case 'd': + case 'i': + base = 10; + sign = 1; + goto handle_sign; + case 'h': + if (hflag) { + hflag = 0; + cflag = 1; + } else + hflag = 1; + goto reswitch; + case 'j': + jflag = 1; + goto reswitch; + case 'l': + if (lflag) { + lflag = 0; + qflag = 1; + } else + lflag = 1; + goto reswitch; + case 'n': + if (jflag) + *(va_arg(ap, intmax_t *)) = retval; + else if (qflag) + *(va_arg(ap, quad_t *)) = retval; + else if (lflag) + *(va_arg(ap, long *)) = retval; + else if (zflag) + *(va_arg(ap, size_t *)) = retval; + else if (hflag) + *(va_arg(ap, short *)) = retval; + else if (cflag) + *(va_arg(ap, char *)) = retval; + else + *(va_arg(ap, int *)) = retval; + break; + case 'o': + base = 8; + goto handle_nosign; + case 'p': + base = 16; + sharpflag = (width == 0); + sign = 0; + num = (uintptr_t)va_arg(ap, void *); + goto number; + case 'q': + qflag = 1; + goto reswitch; + case 'r': + base = radix; + if (sign) + goto handle_sign; + goto handle_nosign; + case 's': + p = va_arg(ap, char *); + if (p == NULL) + p = "(null)"; + if (!dot) + n = strlen (p); + else + for (n = 0; n < dwidth && p[n]; n++) + continue; + + width -= n; + + if (!ladjust && width > 0) + while (width--) + PCHAR(padc); + while (n--) + PCHAR(*p++); + if (ladjust && width > 0) + while (width--) + PCHAR(padc); + break; + case 't': + tflag = 1; + goto reswitch; + case 'u': + base = 10; + goto handle_nosign; + case 'X': + upper = 1; + case 'x': + base = 16; + goto handle_nosign; + case 'y': + base = 16; + sign = 1; + goto handle_sign; + case 'z': + zflag = 1; + goto reswitch; +handle_nosign: + sign = 0; + if (jflag) + num = va_arg(ap, uintmax_t); + else if (qflag) + num = va_arg(ap, u_quad_t); + else if (tflag) + num = va_arg(ap, ptrdiff_t); + else if (lflag) + num = va_arg(ap, u_long); + else if (zflag) + num = va_arg(ap, size_t); + else if (hflag) + num = (u_short)va_arg(ap, int); + else if (cflag) + num = (u_char)va_arg(ap, int); + else + num = va_arg(ap, u_int); + goto number; +handle_sign: + if (jflag) + num = va_arg(ap, intmax_t); + else if (qflag) + num = va_arg(ap, quad_t); + else if (tflag) + num = va_arg(ap, ptrdiff_t); + else if (lflag) + num = va_arg(ap, long); + else if (zflag) + num = va_arg(ap, ssize_t); + else if (hflag) + num = (short)va_arg(ap, int); + else if (cflag) + num = (char)va_arg(ap, int); + else + num = va_arg(ap, int); +number: + if (sign && (intmax_t)num < 0) { + neg = 1; + num = -(intmax_t)num; + } + p = ksprintn(nbuf, num, base, &n, upper); + tmp = 0; + if (sharpflag && num != 0) { + if (base == 8) + tmp++; + else if (base == 16) + tmp += 2; + } + if (neg) + tmp++; + + if (!ladjust && padc == '0') + dwidth = width - tmp; + width -= tmp + imax(dwidth, n); + dwidth -= n; + if (!ladjust) + while (width-- > 0) + PCHAR(' '); + if (neg) + PCHAR('-'); + if (sharpflag && num != 0) { + if (base == 8) { + PCHAR('0'); + } else if (base == 16) { + PCHAR('0'); + PCHAR('x'); + } + } + while (dwidth-- > 0) + PCHAR('0'); + + while (*p) + PCHAR(*p--); + + if (ladjust) + while (width-- > 0) + PCHAR(' '); + + break; + default: + while (percent < fmt) + PCHAR(*percent++); + /* + * Since we ignore an formatting argument it is no + * longer safe to obey the remaining formatting + * arguments as the arguments will no longer match + * the format specs. + */ + stop = 1; + break; + } + } +#undef PCHAR +} + +int +rtld_vsnprintf(char *buf, size_t bufsize, const char *fmt, va_list ap) +{ + struct snprintf_arg info; + int retval; + + info.buf = info.str = buf; + info.buf_total = info.remain = bufsize; + info.fd = -1; + retval = kvprintf(fmt, snprintf_func, &info, 10, ap); + if (info.remain >= 1) + *info.str++ = '\0'; + return (retval); +} + +int +rtld_vfdprintf(int fd, const char *fmt, va_list ap) +{ + char buf[512]; + struct snprintf_arg info; + int retval; + + info.buf = info.str = buf; + info.buf_total = info.remain = sizeof(buf); + info.fd = fd; + retval = kvprintf(fmt, printf_func, &info, 10, ap); + printf_out(&info); + return (retval); +} + +int +rtld_fdprintf(int fd, const char *fmt, ...) +{ + va_list ap; + int retval; + + va_start(ap, fmt); + retval = rtld_vfdprintf(fd, fmt, ap); + va_end(ap); + return (retval); +} + +void +rtld_fdputstr(int fd, const char *str) +{ + + write(fd, str, strlen(str)); +} + +void +rtld_fdputchar(int fd, int c) +{ + char c1; + + c1 = c; + write(fd, &c1, 1); +} Added: head/libexec/rtld-elf/rtld_printf.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/libexec/rtld-elf/rtld_printf.h Wed Aug 24 20:05:13 2011 (r225152) @@ -0,0 +1,44 @@ +/*- + * Copyright 2011 Konstantin Belousov . + * 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 ``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 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$ + */ + +#ifndef RTLD_PRINTF_H +#define RTLD_PRINTF_H 1 + +#include +#include + +int rtld_vsnprintf(char *buf, size_t bufsize, const char *fmt, va_list ap); +int rtld_vfdprintf(int fd, const char *fmt, va_list ap); +int rtld_fdprintf(int fd, const char *fmt, ...) __printflike(2, 3); +void rtld_fdputstr(int fd, const char *str); +void rtld_fdputchar(int fd, int c); + +#define rtld_printf(...) rtld_fdprintf(STDOUT_FILENO, __VA_ARGS__) +#define rtld_putstr(str) rtld_fdputstr(STDOUT_FILENO, (str)) +#define rtld_putchar(c) rtld_fdputchar(STDOUT_FILENO, (c)) + +#endif Modified: head/libexec/rtld-elf/xmalloc.c ============================================================================== --- head/libexec/rtld-elf/xmalloc.c Wed Aug 24 19:27:49 2011 (r225151) +++ head/libexec/rtld-elf/xmalloc.c Wed Aug 24 20:05:13 2011 (r225152) @@ -25,10 +25,12 @@ * $FreeBSD$ */ -#include #include #include #include +#include +#include "rtld.h" +#include "rtld_printf.h" void *xcalloc(size_t); void *xmalloc(size_t); @@ -44,8 +46,10 @@ void * xmalloc(size_t size) { void *p = malloc(size); - if (p == NULL) - err(1, "Out of memory"); + if (p == NULL) { + rtld_fdputstr(STDERR_FILENO, "Out of memory\n"); + _exit(1); + } return p; } @@ -53,7 +57,9 @@ char * xstrdup(const char *s) { char *p = strdup(s); - if (p == NULL) - err(1, "Out of memory"); + if (p == NULL) { + rtld_fdputstr(STDERR_FILENO, "Out of memory\n"); + _exit(1); + } return p; } From owner-svn-src-head@FreeBSD.ORG Wed Aug 24 22:07:38 2011 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 E4B561065673; Wed, 24 Aug 2011 22:07:38 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D44698FC13; Wed, 24 Aug 2011 22:07:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7OM7c7n072509; Wed, 24 Aug 2011 22:07:38 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7OM7cEu072507; Wed, 24 Aug 2011 22:07:38 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201108242207.p7OM7cEu072507@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 24 Aug 2011 22:07: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: r225153 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 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, 24 Aug 2011 22:07:39 -0000 Author: pjd Date: Wed Aug 24 22:07:38 2011 New Revision: 225153 URL: http://svn.freebsd.org/changeset/base/225153 Log: We need to unlock and destroy vnode attached to znode which we are freeing. Reviewed by: kib Approved by: re (bz) MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Wed Aug 24 20:05:13 2011 (r225152) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Wed Aug 24 22:07:38 2011 (r225153) @@ -627,6 +627,18 @@ zfs_znode_dmu_fini(znode_t *zp) zp->z_sa_hdl = NULL; } +static void +zfs_vnode_forget(vnode_t *vp) +{ + + VOP_UNLOCK(vp, 0); + VI_LOCK(vp); + vp->v_usecount--; + vp->v_iflag |= VI_DOOMED; + vp->v_data = NULL; + vdropl(vp); +} + /* * Construct a new znode/vnode and intialize. * @@ -688,6 +700,8 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_bu if (sa_bulk_lookup(zp->z_sa_hdl, bulk, count) != 0 || zp->z_gen == 0) { if (hdl == NULL) sa_handle_destroy(zp->z_sa_hdl); + zfs_vnode_forget(vp); + zp->z_vnode = NULL; kmem_cache_free(znode_cache, zp); return (NULL); } From owner-svn-src-head@FreeBSD.ORG Thu Aug 25 04:31:20 2011 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 C4379106566C; Thu, 25 Aug 2011 04:31:20 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B45038FC14; Thu, 25 Aug 2011 04:31:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7P4VKua084701; Thu, 25 Aug 2011 04:31:20 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7P4VK0E084699; Thu, 25 Aug 2011 04:31:20 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <201108250431.p7P4VK0E084699@svn.freebsd.org> From: Qing Li Date: Thu, 25 Aug 2011 04:31: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: r225163 - 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: Thu, 25 Aug 2011 04:31:20 -0000 Author: qingli Date: Thu Aug 25 04:31:20 2011 New Revision: 225163 URL: http://svn.freebsd.org/changeset/base/225163 Log: When the RADIX_MPATH kernel option is enabled, the RADIX_MPATH code tries to find the first route node of an ECMP chain before executing the route command. If the system has a default route, and the specific route argument to the command does not exist in the routing table, then the default route would be reached. The current code does not verify the reached node matches the given route argument, therefore erroneous removed the entry. This patch fixes that bug. Approved by: re MFC after: 3 days Modified: head/sys/net/radix_mpath.c Modified: head/sys/net/radix_mpath.c ============================================================================== --- head/sys/net/radix_mpath.c Thu Aug 25 01:47:26 2011 (r225162) +++ head/sys/net/radix_mpath.c Thu Aug 25 04:31:20 2011 (r225163) @@ -96,10 +96,7 @@ rt_mpath_matchgate(struct rtentry *rt, s { struct radix_node *rn; - if (!rn_mpath_next((struct radix_node *)rt)) - return rt; - - if (!gate) + if (!gate || !rt->rt_gateway) return NULL; /* beyond here, we use rn as the master copy */ From owner-svn-src-head@FreeBSD.ORG Thu Aug 25 08:17:40 2011 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 4F7861065670; Thu, 25 Aug 2011 08:17:40 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E2F28FC15; Thu, 25 Aug 2011 08:17:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7P8HeSx093737; Thu, 25 Aug 2011 08:17:40 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7P8Heko093730; Thu, 25 Aug 2011 08:17:40 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201108250817.p7P8Heko093730@svn.freebsd.org> From: Martin Matuska Date: Thu, 25 Aug 2011 08:17: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: r225166 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs kern 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: Thu, 25 Aug 2011 08:17:40 -0000 Author: mm Date: Thu Aug 25 08:17:39 2011 New Revision: 225166 URL: http://svn.freebsd.org/changeset/base/225166 Log: Generalize ffs_pages_remove() into vn_pages_remove(). Remove mapped pages for all dataset vnodes in zfs_rezget() using new vn_pages_remove() to fix mmapped files changed by zfs rollback or zfs receive -F. PR: kern/160035, kern/156933 Reviewed by: kib, pjd Approved by: re (kib) MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c head/sys/kern/vfs_vnops.c head/sys/sys/vnode.h head/sys/ufs/ffs/ffs_extern.h head/sys/ufs/ffs/ffs_inode.c head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Thu Aug 25 07:28:07 2011 (r225165) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Thu Aug 25 08:17:39 2011 (r225166) @@ -1273,6 +1273,7 @@ zfs_rezget(znode_t *zp) zfsvfs_t *zfsvfs = zp->z_zfsvfs; dmu_object_info_t doi; dmu_buf_t *db; + vnode_t *vp; uint64_t obj_num = zp->z_id; uint64_t mode, size; sa_bulk_attr_t bulk[8]; @@ -1348,8 +1349,9 @@ zfs_rezget(znode_t *zp) * that for example regular file was replaced with directory * which has the same object number. */ - if (ZTOV(zp) != NULL && - ZTOV(zp)->v_type != IFTOVT((mode_t)zp->z_mode)) { + vp = ZTOV(zp); + if (vp != NULL && + vp->v_type != IFTOVT((mode_t)zp->z_mode)) { zfs_znode_dmu_fini(zp); ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num); return (EIO); @@ -1357,8 +1359,11 @@ zfs_rezget(znode_t *zp) zp->z_unlinked = (zp->z_links == 0); zp->z_blksz = doi.doi_data_block_size; - if (zp->z_size != size && ZTOV(zp) != NULL) - vnode_pager_setsize(ZTOV(zp), zp->z_size); + if (vp != NULL) { + vn_pages_remove(vp, 0, 0); + if (zp->z_size != size) + vnode_pager_setsize(vp, zp->z_size); + } ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num); Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Thu Aug 25 07:28:07 2011 (r225165) +++ head/sys/kern/vfs_vnops.c Thu Aug 25 08:17:39 2011 (r225166) @@ -64,6 +64,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + static fo_rdwr_t vn_read; static fo_rdwr_t vn_write; static fo_truncate_t vn_truncate; @@ -1398,3 +1401,15 @@ vn_chown(struct file *fp, uid_t uid, gid VFS_UNLOCK_GIANT(vfslocked); return (error); } + +void +vn_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, 0); + VM_OBJECT_UNLOCK(object); +} Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Thu Aug 25 07:28:07 2011 (r225165) +++ head/sys/sys/vnode.h Thu Aug 25 08:17:39 2011 (r225166) @@ -640,6 +640,7 @@ int _vn_lock(struct vnode *vp, int flags int vn_open(struct nameidata *ndp, int *flagp, int cmode, struct file *fp); int vn_open_cred(struct nameidata *ndp, int *flagp, int cmode, u_int vn_open_flags, struct ucred *cred, struct file *fp); +void vn_pages_remove(struct vnode *vp, vm_pindex_t start, vm_pindex_t end); int vn_pollrecord(struct vnode *vp, struct thread *p, int events); int vn_rdwr(enum uio_rw rw, struct vnode *vp, void *base, int len, off_t offset, enum uio_seg segflg, int ioflg, Modified: head/sys/ufs/ffs/ffs_extern.h ============================================================================== --- head/sys/ufs/ffs/ffs_extern.h Thu Aug 25 07:28:07 2011 (r225165) +++ head/sys/ufs/ffs/ffs_extern.h Thu Aug 25 08:17:39 2011 (r225166) @@ -79,7 +79,6 @@ int ffs_isfreeblock(struct fs *, u_char void ffs_load_inode(struct buf *, struct inode *, struct fs *, ino_t); int ffs_mountroot(void); void ffs_oldfscompat_write(struct fs *, struct ufsmount *); -void ffs_pages_remove(struct vnode *vp, vm_pindex_t start, vm_pindex_t end); int ffs_reallocblks(struct vop_reallocblks_args *); int ffs_realloccg(struct inode *, ufs2_daddr_t, ufs2_daddr_t, ufs2_daddr_t, int, int, int, struct ucred *, struct buf **); Modified: head/sys/ufs/ffs/ffs_inode.c ============================================================================== --- head/sys/ufs/ffs/ffs_inode.c Thu Aug 25 07:28:07 2011 (r225165) +++ head/sys/ufs/ffs/ffs_inode.c Thu Aug 25 08:17:39 2011 (r225166) @@ -120,18 +120,6 @@ ffs_update(vp, waitfor) } } -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, 0); - 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 */ @@ -219,7 +207,7 @@ ffs_truncate(vp, length, flags, cred, td (void) chkdq(ip, -extblocks, NOCRED, 0); #endif vinvalbuf(vp, V_ALT, 0, 0); - ffs_pages_remove(vp, + vn_pages_remove(vp, OFF_TO_IDX(lblktosize(fs, -extblocks)), 0); osize = ip->i_din2->di_extsize; ip->i_din2->di_blocks -= extblocks; Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Thu Aug 25 07:28:07 2011 (r225165) +++ head/sys/ufs/ffs/ffs_softdep.c Thu Aug 25 08:17:39 2011 (r225166) @@ -6541,7 +6541,7 @@ trunc_pages(ip, length, extblocks, flags fs = ip->i_fs; extend = OFF_TO_IDX(lblktosize(fs, -extblocks)); if ((flags & IO_EXT) != 0) - ffs_pages_remove(vp, extend, 0); + vn_pages_remove(vp, extend, 0); if ((flags & IO_NORMAL) == 0) return; BO_LOCK(&vp->v_bufobj); @@ -6567,7 +6567,7 @@ trunc_pages(ip, length, extblocks, flags end = OFF_TO_IDX(lblktosize(fs, lbn)); } else end = extend; - ffs_pages_remove(vp, OFF_TO_IDX(OFF_MAX), end); + vn_pages_remove(vp, OFF_TO_IDX(OFF_MAX), end); } /* From owner-svn-src-head@FreeBSD.ORG Thu Aug 25 08:35:10 2011 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 34A10106564A; Thu, 25 Aug 2011 08:35:10 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2383C8FC1F; Thu, 25 Aug 2011 08:35:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7P8ZARr094396; Thu, 25 Aug 2011 08:35:10 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7P8ZADj094386; Thu, 25 Aug 2011 08:35:10 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201108250835.p7P8ZADj094386@svn.freebsd.org> From: Martin Matuska Date: Thu, 25 Aug 2011 08:35: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: r225167 - 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: Thu, 25 Aug 2011 08:35:10 -0000 Author: mm Date: Thu Aug 25 08:35:09 2011 New Revision: 225167 URL: http://svn.freebsd.org/changeset/base/225167 Log: Import bugfix for reading and extracting of FreeBSD ISO images with tar. Upstream revision 3645 (merge of 3642): Change the mechanism handling a rr_moved directory, which is Rockridge extension that can exceed the limitation of a maximum directory depth of ISO 9660. - Stop reading all entries at a time. - Connect "CL" entry to "RE" entry dynamically, which "CL" and "RE" have information to rebuild a full directory tree. - Tweak some related tests since we use Headsort for re-ordering entries and it cannot make a steady order when the keies of the entries are the same. http://code.google.com/p/libarchive/issues/detail?id=168 Reviewed by: kientzle Approved by: re (kib) Obtained from: libarchive (release/2.8, svn rev 3645) MFC after: 3 days Added: head/lib/libarchive/test/test_read_format_iso_2.iso.Z.uu (contents, props changed) Modified: head/lib/libarchive/archive_read_support_format_iso9660.c head/lib/libarchive/test/test_read_format_iso_gz.c head/lib/libarchive/test/test_read_format_isojoliet_bz2.c head/lib/libarchive/test/test_read_format_isojoliet_long.c head/lib/libarchive/test/test_read_format_isojoliet_rr.c head/lib/libarchive/test/test_read_format_isorr_bz2.c head/lib/libarchive/test/test_read_format_isorr_new_bz2.c head/lib/libarchive/test/test_read_format_isozisofs_bz2.c Modified: head/lib/libarchive/archive_read_support_format_iso9660.c ============================================================================== --- head/lib/libarchive/archive_read_support_format_iso9660.c Thu Aug 25 08:17:39 2011 (r225166) +++ head/lib/libarchive/archive_read_support_format_iso9660.c Thu Aug 25 08:35:09 2011 (r225167) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2003-2007 Tim Kientzle * Copyright (c) 2009 Andreas Henriksson - * Copyright (c) 2009 Michihiro NAKAJIMA + * Copyright (c) 2009-2011 Michihiro NAKAJIMA * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -261,13 +261,17 @@ struct file_info { struct file_info *use_next; struct file_info *parent; struct file_info *next; + struct file_info *re_next; int subdirs; uint64_t key; /* Heap Key. */ uint64_t offset; /* Offset on disk. */ uint64_t size; /* File size in bytes. */ uint32_t ce_offset; /* Offset of CE. */ uint32_t ce_size; /* Size of CE. */ + char rr_moved; /* Flag to rr_moved. */ + char rr_moved_has_re_only; char re; /* Having RRIP "RE" extension. */ + char re_descendant; uint64_t cl_offset; /* Having RRIP "CL" extension. */ int birthtime_is_set; time_t birthtime; /* File created time. */ @@ -294,7 +298,10 @@ struct file_info { struct content *first; struct content **last; } contents; - char exposed; + struct { + struct file_info *first; + struct file_info **last; + } rede_files; }; struct heap_queue { @@ -317,8 +324,6 @@ struct iso9660 { unsigned char suspOffset; struct file_info *rr_moved; - struct heap_queue re_dirs; - struct heap_queue cl_files; struct read_ce_queue { struct read_ce_req { uint64_t offset;/* Offset of CE on disk. */ @@ -337,6 +342,10 @@ struct iso9660 { struct file_info *first; struct file_info **last; } cache_files; + struct { + struct file_info *first; + struct file_info **last; + } re_files; uint64_t current_position; ssize_t logical_block_size; @@ -377,7 +386,8 @@ static int isJolietSVD(struct iso9660 *, static int isSVD(struct iso9660 *, const unsigned char *); static int isEVD(struct iso9660 *, const unsigned char *); static int isPVD(struct iso9660 *, const unsigned char *); -static struct file_info *next_cache_entry(struct iso9660 *iso9660); +static int next_cache_entry(struct archive_read *, struct iso9660 *, + struct file_info **); static int next_entry_seek(struct archive_read *a, struct iso9660 *iso9660, struct file_info **pfile); static struct file_info * @@ -400,10 +410,12 @@ static void parse_rockridge_ZF1(struct f static void register_file(struct iso9660 *, struct file_info *); static void release_files(struct iso9660 *); static unsigned toi(const void *p, int n); +static inline void re_add_entry(struct iso9660 *, struct file_info *); +static inline struct file_info * re_get_entry(struct iso9660 *); +static inline int rede_add_entry(struct file_info *); +static inline struct file_info * rede_get_entry(struct file_info *); static inline void cache_add_entry(struct iso9660 *iso9660, struct file_info *file); -static inline void cache_add_to_next_of_parent(struct iso9660 *iso9660, - struct file_info *file); static inline struct file_info *cache_get_entry(struct iso9660 *iso9660); static void heap_add_entry(struct heap_queue *heap, struct file_info *file, uint64_t key); @@ -430,6 +442,8 @@ archive_read_support_format_iso9660(stru iso9660->magic = ISO9660_MAGIC; iso9660->cache_files.first = NULL; iso9660->cache_files.last = &(iso9660->cache_files.first); + iso9660->re_files.first = NULL; + iso9660->re_files.last = &(iso9660->re_files.first); /* Enable to support Joliet extensions by default. */ iso9660->opt_support_joliet = 1; /* Enable to support Rock Ridge extensions by default. */ @@ -975,42 +989,38 @@ read_children(struct archive_read *a, st child = parse_file_info(a, parent, p); if (child == NULL) return (ARCHIVE_FATAL); - if (child->cl_offset) - heap_add_entry(&(iso9660->cl_files), - child, child->cl_offset); - else { - if (child->multi_extent || multi != NULL) { - struct content *con; - - if (multi == NULL) { - multi = child; - multi->contents.first = NULL; - multi->contents.last = - &(multi->contents.first); - } - con = malloc(sizeof(struct content)); - if (con == NULL) { - archive_set_error( - &a->archive, ENOMEM, - "No memory for " - "multi extent"); - return (ARCHIVE_FATAL); - } - con->offset = child->offset; - con->size = child->size; - con->next = NULL; - *multi->contents.last = con; - multi->contents.last = &(con->next); - if (multi == child) - add_entry(iso9660, child); - else { - multi->size += child->size; - if (!child->multi_extent) - multi = NULL; - } - } else + if (child->cl_offset == 0 && + (child->multi_extent || multi != NULL)) { + struct content *con; + + if (multi == NULL) { + multi = child; + multi->contents.first = NULL; + multi->contents.last = + &(multi->contents.first); + } + con = malloc(sizeof(struct content)); + if (con == NULL) { + archive_set_error( + &a->archive, ENOMEM, + "No memory for " + "multi extent"); + return (ARCHIVE_FATAL); + } + con->offset = child->offset; + con->size = child->size; + con->next = NULL; + *multi->contents.last = con; + multi->contents.last = &(con->next); + if (multi == child) add_entry(iso9660, child); - } + else { + multi->size += child->size; + if (!child->multi_extent) + multi = NULL; + } + } else + add_entry(iso9660, child); } } @@ -1022,102 +1032,12 @@ read_children(struct archive_read *a, st } static int -relocate_dir(struct iso9660 *iso9660, struct file_info *file) -{ - struct file_info *re; - - re = heap_get_entry(&(iso9660->re_dirs)); - while (re != NULL && re->offset < file->cl_offset) { - /* This case is wrong pattern. - * But dont't reject this directory entry to be robust. */ - cache_add_entry(iso9660, re); - re = heap_get_entry(&(iso9660->re_dirs)); - } - if (re == NULL) - /* This case is wrong pattern. */ - return (0); - if (re->offset == file->cl_offset) { - re->parent->subdirs--; - re->parent = file->parent; - re->parent->subdirs++; - cache_add_to_next_of_parent(iso9660, re); - return (1); - } else - /* This case is wrong pattern. */ - heap_add_entry(&(iso9660->re_dirs), re, re->offset); - return (0); -} - -static int -read_entries(struct archive_read *a) -{ - struct iso9660 *iso9660; - struct file_info *file; - int r; - - iso9660 = (struct iso9660 *)(a->format->data); - - while ((file = next_entry(iso9660)) != NULL && - (file->mode & AE_IFMT) == AE_IFDIR) { - r = read_children(a, file); - if (r != ARCHIVE_OK) - return (r); - - if (iso9660->seenRockridge && - file->parent != NULL && - file->parent->parent == NULL && - iso9660->rr_moved == NULL && - (strcmp(file->name.s, "rr_moved") == 0 || - strcmp(file->name.s, ".rr_moved") == 0)) { - iso9660->rr_moved = file; - } else if (file->re) - heap_add_entry(&(iso9660->re_dirs), file, - file->offset); - else - cache_add_entry(iso9660, file); - } - if (file != NULL) - add_entry(iso9660, file); - - if (iso9660->rr_moved != NULL) { - /* - * Relocate directory which rr_moved has. - */ - while ((file = heap_get_entry(&(iso9660->cl_files))) != NULL) - relocate_dir(iso9660, file); - - /* If rr_moved directory still has children, - * Add rr_moved into pending_files to show - */ - if (iso9660->rr_moved->subdirs) { - cache_add_entry(iso9660, iso9660->rr_moved); - /* If entries which have "RE" extension are still - * remaining(this case is unlikely except ISO image - * is broken), the entries won't be exposed. */ - while ((file = heap_get_entry(&(iso9660->re_dirs))) != NULL) - cache_add_entry(iso9660, file); - } else - iso9660->rr_moved->parent->subdirs--; - } else { - /* - * In case ISO image is broken. If the name of rr_moved - * directory has been changed by damage, subdirectories - * of rr_moved entry won't be exposed. - */ - while ((file = heap_get_entry(&(iso9660->re_dirs))) != NULL) - cache_add_entry(iso9660, file); - } - - return (ARCHIVE_OK); -} - -static int archive_read_format_iso9660_read_header(struct archive_read *a, struct archive_entry *entry) { struct iso9660 *iso9660; struct file_info *file; - int r, rd_r; + int r, rd_r = ARCHIVE_OK; iso9660 = (struct iso9660 *)(a->format->data); @@ -1207,11 +1127,7 @@ archive_read_format_iso9660_read_header( a->archive.archive_format_name = "ISO9660 with Rockridge extensions"; } - rd_r = read_entries(a); - if (rd_r == ARCHIVE_FATAL) - return (ARCHIVE_FATAL); - } else - rd_r = ARCHIVE_OK; + } /* Get the next entry that appears after the current offset. */ r = next_entry_seek(a, iso9660, &file); @@ -1324,7 +1240,6 @@ archive_read_format_iso9660_read_header( /* Directory data has been read completely. */ iso9660->entry_bytes_remaining = 0; iso9660->entry_sparse_offset = 0; - file->exposed = 1; } if (rd_r != ARCHIVE_OK) @@ -1651,10 +1566,6 @@ archive_read_format_iso9660_cleanup(stru archive_string_free(&iso9660->previous_pathname); if (iso9660->pending_files.files) free(iso9660->pending_files.files); - if (iso9660->re_dirs.files) - free(iso9660->re_dirs.files); - if (iso9660->cl_files.files) - free(iso9660->cl_files.files); #ifdef HAVE_ZLIB_H free(iso9660->entry_zisofs.uncompressed_buffer); free(iso9660->entry_zisofs.block_pointers); @@ -1735,6 +1646,8 @@ parse_file_info(struct archive_read *a, file->size = fsize; file->mtime = isodate7(isodirrec + DR_date_offset); file->ctime = file->atime = file->mtime; + file->rede_files.first = NULL; + file->rede_files.last = &(file->rede_files.first); p = isodirrec + DR_name_offset; /* Rockridge extensions (if any) follow name. Compute this @@ -1873,9 +1786,40 @@ parse_file_info(struct archive_read *a, file->nlinks = 1;/* Reset nlink. we'll calculate it later. */ /* Tell file's parent how many children that parent has. */ - if (parent != NULL && (flags & 0x02) && file->cl_offset == 0) + if (parent != NULL && (flags & 0x02)) parent->subdirs++; + if (iso9660->seenRockridge) { + if (parent != NULL && parent->parent == NULL && + (flags & 0x02) && iso9660->rr_moved == NULL && + (strcmp(file->name.s, "rr_moved") == 0 || + strcmp(file->name.s, ".rr_moved") == 0)) { + iso9660->rr_moved = file; + file->rr_moved = 1; + file->rr_moved_has_re_only = 1; + file->re = 0; + parent->subdirs--; + } else if (file->re) { + /* This file's parent is not rr_moved, clear invalid + * "RE" mark. */ + if (parent == NULL || parent->rr_moved == 0) + file->re = 0; + else if ((flags & 0x02) == 0) { + file->rr_moved_has_re_only = 0; + file->re = 0; + } + } else if (parent != NULL && parent->rr_moved) + file->rr_moved_has_re_only = 0; + else if (parent != NULL && (flags & 0x02) && + (parent->re || parent->re_descendant)) + file->re_descendant = 1; + if (file->cl_offset != 0) { + parent->subdirs++; + /* To be appeared before other dirs. */ + file->offset = file->number = file->cl_offset; + } + } + #if DEBUG /* DEBUGGING: Warn about attributes I don't yet fully support. */ if ((flags & ~0x02) != 0) { @@ -2489,10 +2433,12 @@ next_entry_seek(struct archive_read *a, struct file_info **pfile) { struct file_info *file; + int r; - *pfile = file = next_cache_entry(iso9660); - if (file == NULL) - return (ARCHIVE_EOF); + r = next_cache_entry(a, iso9660, pfile); + if (r != ARCHIVE_OK) + return (r); + file = *pfile; /* Don't waste time seeking for zero-length bodies. */ if (file->size == 0) @@ -2513,8 +2459,9 @@ next_entry_seek(struct archive_read *a, return (ARCHIVE_OK); } -static struct file_info * -next_cache_entry(struct iso9660 *iso9660) +static int +next_cache_entry(struct archive_read *a, struct iso9660 *iso9660, + struct file_info **pfile) { struct file_info *file; struct { @@ -2526,21 +2473,128 @@ next_cache_entry(struct iso9660 *iso9660 file = cache_get_entry(iso9660); if (file != NULL) { - while (file->parent != NULL && !file->parent->exposed) { - /* If file's parent is not exposed, it's moved - * to next entry of its parent. */ - cache_add_to_next_of_parent(iso9660, file); - file = cache_get_entry(iso9660); - } - return (file); + *pfile = file; + return (ARCHIVE_OK); } - file = next_entry(iso9660); - if (file == NULL) - return (NULL); + for (;;) { + struct file_info *re, *d; + + *pfile = file = next_entry(iso9660); + if (file == NULL) { + /* + * If directory entries all which are descendant of + * rr_moved are stil remaning, expose their. + */ + if (iso9660->re_files.first != NULL && + iso9660->rr_moved != NULL && + iso9660->rr_moved->rr_moved_has_re_only) + /* Expose "rr_moved" entry. */ + cache_add_entry(iso9660, iso9660->rr_moved); + while ((re = re_get_entry(iso9660)) != NULL) { + /* Expose its descendant dirs. */ + while ((d = rede_get_entry(re)) != NULL) + cache_add_entry(iso9660, d); + } + if (iso9660->cache_files.first != NULL) + return (next_cache_entry(a, iso9660, pfile)); + return (ARCHIVE_EOF); + } + + if (file->cl_offset) { + struct file_info *first_re = NULL; + int nexted_re = 0; + + /* + * Find "RE" dir for the current file, which + * has "CL" flag. + */ + while ((re = re_get_entry(iso9660)) + != first_re) { + if (first_re == NULL) + first_re = re; + if (re->offset == file->cl_offset) { + re->parent->subdirs--; + re->parent = file->parent; + re->re = 0; + if (re->parent->re_descendant) { + nexted_re = 1; + re->re_descendant = 1; + if (rede_add_entry(re) < 0) + goto fatal_rr; + /* Move a list of descendants + * to a new ancestor. */ + while ((d = rede_get_entry( + re)) != NULL) + if (rede_add_entry(d) + < 0) + goto fatal_rr; + break; + } + /* Replace the current file + * with "RE" dir */ + *pfile = file = re; + /* Expose its descendant */ + while ((d = rede_get_entry( + file)) != NULL) + cache_add_entry( + iso9660, d); + break; + } else + re_add_entry(iso9660, re); + } + if (nexted_re) { + /* + * Do not expose this at this time + * because we have not gotten its full-path + * name yet. + */ + continue; + } + } else if ((file->mode & AE_IFMT) == AE_IFDIR) { + int r; + + /* Read file entries in this dir. */ + r = read_children(a, file); + if (r != ARCHIVE_OK) + return (r); + + /* + * Handle a special dir of Rockridge extensions, + * "rr_moved". + */ + if (file->rr_moved) { + /* + * If this has only the subdirectories which + * have "RE" flags, do not expose at this time. + */ + if (file->rr_moved_has_re_only) + continue; + /* Otherwise expose "rr_moved" entry. */ + } else if (file->re) { + /* + * Do not expose this at this time + * because we have not gotten its full-path + * name yet. + */ + re_add_entry(iso9660, file); + continue; + } else if (file->re_descendant) { + /* + * Do not expose this at this time + * because we have not gotten its full-path + * name yet. + */ + if (rede_add_entry(file) < 0) + goto fatal_rr; + continue; + } + } + break; + } if ((file->mode & AE_IFMT) != AE_IFREG || file->number == -1) - return (file); + return (ARCHIVE_OK); count = 0; number = file->number; @@ -2573,8 +2627,10 @@ next_cache_entry(struct iso9660 *iso9660 file = next_entry(iso9660); } - if (count == 0) - return (file); + if (count == 0) { + *pfile = file; + return ((file == NULL)?ARCHIVE_EOF:ARCHIVE_OK); + } if (file->number == -1) { file->next = NULL; *empty_files.last = file; @@ -2599,24 +2655,75 @@ next_cache_entry(struct iso9660 *iso9660 *iso9660->cache_files.last = empty_files.first; iso9660->cache_files.last = empty_files.last; } - return (cache_get_entry(iso9660)); + *pfile = cache_get_entry(iso9660); + return ((*pfile == NULL)?ARCHIVE_EOF:ARCHIVE_OK); + +fatal_rr: + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Failed to connect 'CL' pointer to 'RE' rr_moved pointer of" + "Rockridge extensions"); + return (ARCHIVE_FATAL); } static inline void -cache_add_entry(struct iso9660 *iso9660, struct file_info *file) +re_add_entry(struct iso9660 *iso9660, struct file_info *file) { - file->next = NULL; - *iso9660->cache_files.last = file; - iso9660->cache_files.last = &(file->next); + file->re_next = NULL; + *iso9660->re_files.last = file; + iso9660->re_files.last = &(file->re_next); +} + +static inline struct file_info * +re_get_entry(struct iso9660 *iso9660) +{ + struct file_info *file; + + if ((file = iso9660->re_files.first) != NULL) { + iso9660->re_files.first = file->re_next; + if (iso9660->re_files.first == NULL) + iso9660->re_files.last = + &(iso9660->re_files.first); + } + return (file); +} + +static inline int +rede_add_entry(struct file_info *file) +{ + struct file_info *re; + + re = file->parent; + while (re != NULL && !re->re) + re = re->parent; + if (re == NULL) + return (-1); + + file->re_next = NULL; + *re->rede_files.last = file; + re->rede_files.last = &(file->re_next); + return (0); +} + +static inline struct file_info * +rede_get_entry(struct file_info *re) +{ + struct file_info *file; + + if ((file = re->rede_files.first) != NULL) { + re->rede_files.first = file->re_next; + if (re->rede_files.first == NULL) + re->rede_files.last = + &(re->rede_files.first); + } + return (file); } static inline void -cache_add_to_next_of_parent(struct iso9660 *iso9660, struct file_info *file) +cache_add_entry(struct iso9660 *iso9660, struct file_info *file) { - file->next = file->parent->next; - file->parent->next = file; - if (iso9660->cache_files.last == &(file->parent->next)) - iso9660->cache_files.last = &(file->next); + file->next = NULL; + *iso9660->cache_files.last = file; + iso9660->cache_files.last = &(file->next); } static inline struct file_info * Added: head/lib/libarchive/test/test_read_format_iso_2.iso.Z.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libarchive/test/test_read_format_iso_2.iso.Z.uu Thu Aug 25 08:35:09 2011 (r225167) @@ -0,0 +1,37 @@ +$FreeBSD$ + +begin 644 test_read_format_iso_2.iso.Z +M'YV0``(*'$BPH,&#"!,J7,BPH<.'$"-*G$BQHL6+&#-JW,BQH\>/($.*'$FR +MI,F3*%.J7,FRIO8,.*'4NVK-FS:-.J7//JW/'D"-+GDRYLN7+F#-KWLRY +ML^?/H$.+'DVZM.G3J%.K7LVZM>O7L&/+GDV[MNW;N'/KWLV[M^_?P(,+'TZ\ +MN/'CR),K7\Z\N?/GT*-+GTZ]NO7KV+-KW\Z]N_?OX,.+'T^^O/GSZ-.K7\^^ +MO?OW\./+GT^_OOW[^//KW\^_O_^_`0Q!!`PPQ!```$Z408<04Q`!PH,01BCA +MA!16:.&%$!Z404$;>G0@``%\>"`""`#@04$>2)#0!`.)```%!<%8HD`EEF+C +MC:4($)"(!V+HXX]`!BGDD$06:>212":IY)),-NGDDU!&*>645%9II8\R%!@# +M##C$0(,,,6Q)PPP$DI-EF%QZ"::89,)`#H%PQBDGG&=NV>67:(Y9YH?_]>GG +MGX7](R"!!@)JZ*&()JKHHL<="...`AU80:0`!`$B`!=0.@2CG';JZ:>@A@H8 +MGR]>:FI`DP9@*:F9!BCJJ[#&*NNLM#[EXJ,#R3A0C3C:J*.I(0)P:XP`S!@0 +MK[W^RF,`+DY*T*3&%@O`&P@X4($"!I"C[(ZJNI@I09E&6R*UUBJP@+:0@NAJ +MK>RVZ^Z[\$;7;$'0[CIMM==FNZVZPI9*D*XT`M"KK^F&&(`)`%A0D`4&%&0` +MN?F20RF(!`CAP@XQQ*OQQAQW['%S:)3!!AMO*/#QR2BGK/+*G7I;4+CV0FPN +MNL`>..R_T@8\<(X%AX@P!@5AT#!!#^,[\\0!$$#$Q1FS[/334$M]MILM^WVVW#'+??<=-=M]]UXYZWW +MWGSW[???@`N^>:<=^[Y +MYZ"'+OKHI)=N^NFHIZ[ZZJRW[OKKL,O_/+,-^_\\]!'+_WTU%=O_?789Z_]]MQW[_WWX(BGK_[Z[+?O_OOPQR___/37;__]^.>O__[\]^___P`,H``'2,`"&O"`"$R@ +M`A?(P`8Z\($0C*`$)TC!"EKP@AC,H`8WR,$.>O"#(`RA"$=(PA*:\(0H3*$* +M5\C"%KKPA3",H0QG2,,:VO"&.,RA#G?(PQ[Z\(=`#*(0ATC$(AKQB$A,HA*7 +MR,0F.O&)4(RB%*=(Q2I:\8I8S*(6M\C%+GKQBV`,HQC'2,8RFO&,:$RC&M?( +MQC:Z\8UPC*,O.;X`RG.,=)SG*:\YSH3*^,RG/O?)SW[Z\Y\`#:A`!TK0@AKTH`A-J$(7RM"&.O2A +M$(VH1"=*T8I:]*(8S:A&-\K1CGKTHR`-J4A'2M*2FO2D*$VI2E?*TI:Z]*4P +MC:E,9TK3FMKTICC-J4YWRM.>^O2G0`VJ4(=*U*(:]:A(3:I2E\K4ICKUJ5"- +MJE2G2M6J6O6J6,VJ5K?*U:YZ]:M@#:M8QTK6LIKUK&A-JUK7RM:VNO6M<`TG +` +end Modified: head/lib/libarchive/test/test_read_format_iso_gz.c ============================================================================== --- head/lib/libarchive/test/test_read_format_iso_gz.c Thu Aug 25 08:17:39 2011 (r225166) +++ head/lib/libarchive/test/test_read_format_iso_gz.c Thu Aug 25 08:35:09 2011 (r225167) @@ -25,7 +25,8 @@ #include "test.h" __FBSDID("$FreeBSD$"); -DEFINE_TEST(test_read_format_iso_gz) +static void +test1(void) { struct archive_entry *ae; struct archive *a; @@ -49,4 +50,50 @@ DEFINE_TEST(test_read_format_iso_gz) assertEqualInt(ARCHIVE_OK, archive_read_finish(a)); } +static +void test2(void) +{ + struct archive_entry *ae; + struct archive *a; + const char *name = "test_read_format_iso_2.iso.Z"; + + extract_reference_file(name); + + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_support_compression_all(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_support_format_all(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_open_filename(a, name, 512)); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_next_header(a, &ae)); + assertEqualString(".", archive_entry_pathname(ae)); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_next_header(a, &ae)); + assertEqualString("A", archive_entry_pathname(ae)); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_next_header(a, &ae)); + assertEqualString("A/B", archive_entry_pathname(ae)); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_next_header(a, &ae)); + assertEqualString("C", archive_entry_pathname(ae)); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_next_header(a, &ae)); + assertEqualString("C/D", archive_entry_pathname(ae)); + assertEqualIntA(a, ARCHIVE_EOF, + archive_read_next_header(a, &ae)); + assertEqualInt(archive_compression(a), + ARCHIVE_COMPRESSION_COMPRESS); + assertEqualInt(archive_format(a), ARCHIVE_FORMAT_ISO9660); + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_finish(a)); +} + +DEFINE_TEST(test_read_format_iso_gz) +{ + test1(); + test2(); +} + Modified: head/lib/libarchive/test/test_read_format_isojoliet_bz2.c ============================================================================== --- head/lib/libarchive/test/test_read_format_isojoliet_bz2.c Thu Aug 25 08:17:39 2011 (r225166) +++ head/lib/libarchive/test/test_read_format_isojoliet_bz2.c Thu Aug 25 08:35:09 2011 (r225167) @@ -95,7 +95,7 @@ DEFINE_TEST(test_read_format_isojoliet_b /* A regular file with two names ("hardlink" gets returned * first, so it's not marked as a hardlink). */ assertEqualInt(0, archive_read_next_header(a, &ae)); - assertEqualString("long-joliet-file-name.textfile", + assertEqualString("hardlink", archive_entry_pathname(ae)); assertEqualInt(AE_IFREG, archive_entry_filetype(ae)); assert(archive_entry_hardlink(ae) == NULL); @@ -108,9 +108,10 @@ DEFINE_TEST(test_read_format_isojoliet_b /* Second name for the same regular file (this happens to be * returned second, so does get marked as a hardlink). */ assertEqualInt(0, archive_read_next_header(a, &ae)); - assertEqualString("hardlink", archive_entry_pathname(ae)); - assertEqualInt(AE_IFREG, archive_entry_filetype(ae)); assertEqualString("long-joliet-file-name.textfile", + archive_entry_pathname(ae)); + assertEqualInt(AE_IFREG, archive_entry_filetype(ae)); + assertEqualString("hardlink", archive_entry_hardlink(ae)); assert(!archive_entry_size_is_set(ae)); Modified: head/lib/libarchive/test/test_read_format_isojoliet_long.c ============================================================================== --- head/lib/libarchive/test/test_read_format_isojoliet_long.c Thu Aug 25 08:17:39 2011 (r225166) +++ head/lib/libarchive/test/test_read_format_isojoliet_long.c Thu Aug 25 08:35:09 2011 (r225167) @@ -111,7 +111,7 @@ DEFINE_TEST(test_read_format_isojoliet_l pathname[102] = '3'; pathname[103] = '\0'; assertEqualInt(0, archive_read_next_header(a, &ae)); - assertEqualString(pathname, archive_entry_pathname(ae)); + assertEqualString("hardlink", archive_entry_pathname(ae)); assertEqualInt(AE_IFREG, archive_entry_filetype(ae)); assert(archive_entry_hardlink(ae) == NULL); assertEqualInt(6, archive_entry_size(ae)); @@ -123,9 +123,9 @@ DEFINE_TEST(test_read_format_isojoliet_l /* Second name for the same regular file (this happens to be * returned second, so does get marked as a hardlink). */ assertEqualInt(0, archive_read_next_header(a, &ae)); - assertEqualString("hardlink", archive_entry_pathname(ae)); + assertEqualString(pathname, archive_entry_pathname(ae)); assertEqualInt(AE_IFREG, archive_entry_filetype(ae)); - assertEqualString(pathname, archive_entry_hardlink(ae)); + assertEqualString("hardlink", archive_entry_hardlink(ae)); assert(!archive_entry_size_is_set(ae)); /* End of archive. */ Modified: head/lib/libarchive/test/test_read_format_isojoliet_rr.c ============================================================================== --- head/lib/libarchive/test/test_read_format_isojoliet_rr.c Thu Aug 25 08:17:39 2011 (r225166) +++ head/lib/libarchive/test/test_read_format_isojoliet_rr.c Thu Aug 25 08:35:09 2011 (r225167) @@ -98,7 +98,7 @@ DEFINE_TEST(test_read_format_isojoliet_r /* A regular file with two names ("hardlink" gets returned * first, so it's not marked as a hardlink). */ assertEqualInt(0, archive_read_next_header(a, &ae)); - assertEqualString("long-joliet-file-name.textfile", + assertEqualString("hardlink", archive_entry_pathname(ae)); assertEqualInt(AE_IFREG, archive_entry_filetype(ae)); assert(archive_entry_hardlink(ae) == NULL); @@ -120,9 +120,10 @@ DEFINE_TEST(test_read_format_isojoliet_r /* Second name for the same regular file (this happens to be * returned second, so does get marked as a hardlink). */ assertEqualInt(0, archive_read_next_header(a, &ae)); - assertEqualString("hardlink", archive_entry_pathname(ae)); - assertEqualInt(AE_IFREG, archive_entry_filetype(ae)); assertEqualString("long-joliet-file-name.textfile", + archive_entry_pathname(ae)); + assertEqualInt(AE_IFREG, archive_entry_filetype(ae)); + assertEqualString("hardlink", archive_entry_hardlink(ae)); assert(!archive_entry_size_is_set(ae)); assertEqualInt(86401, archive_entry_mtime(ae)); Modified: head/lib/libarchive/test/test_read_format_isorr_bz2.c ============================================================================== --- head/lib/libarchive/test/test_read_format_isorr_bz2.c Thu Aug 25 08:17:39 2011 (r225166) +++ head/lib/libarchive/test/test_read_format_isorr_bz2.c Thu Aug 25 08:35:09 2011 (r225167) @@ -97,9 +97,9 @@ DEFINE_TEST(test_read_format_isorr_bz2) assertEqualInt(2, archive_entry_stat(ae)->st_nlink); assertEqualInt(1, archive_entry_uid(ae)); assertEqualInt(2, archive_entry_gid(ae)); - } else if (strcmp("hardlink", archive_entry_pathname(ae)) == 0) { + } else if (strcmp("file", archive_entry_pathname(ae)) == 0) { /* A regular file. */ - assertEqualString("hardlink", archive_entry_pathname(ae)); + assertEqualString("file", archive_entry_pathname(ae)); assertEqualInt(AE_IFREG, archive_entry_filetype(ae)); assertEqualInt(12345684, archive_entry_size(ae)); assertEqualInt(0, @@ -111,16 +111,16 @@ DEFINE_TEST(test_read_format_isorr_bz2) assertEqualInt(2, archive_entry_stat(ae)->st_nlink); assertEqualInt(1, archive_entry_uid(ae)); assertEqualInt(2, archive_entry_gid(ae)); - } else if (strcmp("file", archive_entry_pathname(ae)) == 0) { + } else if (strcmp("hardlink", archive_entry_pathname(ae)) == 0) { /* A hardlink to the regular file. */ /* Note: If "hardlink" gets returned before "file", * then "hardlink" will get returned as a regular file * and "file" will get returned as the hardlink. * This test should tolerate that, since it's a * perfectly permissible thing for libarchive to do. */ - assertEqualString("file", archive_entry_pathname(ae)); + assertEqualString("hardlink", archive_entry_pathname(ae)); assertEqualInt(AE_IFREG, archive_entry_filetype(ae)); - assertEqualString("hardlink", archive_entry_hardlink(ae)); + assertEqualString("file", archive_entry_hardlink(ae)); assertEqualInt(0, archive_entry_size_is_set(ae)); assertEqualInt(0, archive_entry_size(ae)); assertEqualInt(86401, archive_entry_mtime(ae)); Modified: head/lib/libarchive/test/test_read_format_isorr_new_bz2.c ============================================================================== --- head/lib/libarchive/test/test_read_format_isorr_new_bz2.c Thu Aug 25 08:17:39 2011 (r225166) +++ head/lib/libarchive/test/test_read_format_isorr_new_bz2.c Thu Aug 25 08:35:09 2011 (r225167) @@ -98,9 +98,9 @@ DEFINE_TEST(test_read_format_isorr_new_b assertEqualInt(2, archive_entry_stat(ae)->st_nlink); assertEqualInt(1, archive_entry_uid(ae)); assertEqualInt(2, archive_entry_gid(ae)); - } else if (strcmp("hardlink", archive_entry_pathname(ae)) == 0) { + } else if (strcmp("file", archive_entry_pathname(ae)) == 0) { /* A regular file. */ - assertEqualString("hardlink", archive_entry_pathname(ae)); + assertEqualString("file", archive_entry_pathname(ae)); assertEqualInt(AE_IFREG, archive_entry_filetype(ae)); assertEqualInt(12345684, archive_entry_size(ae)); assertEqualInt(0, @@ -112,16 +112,16 @@ DEFINE_TEST(test_read_format_isorr_new_b assertEqualInt(2, archive_entry_stat(ae)->st_nlink); assertEqualInt(1, archive_entry_uid(ae)); assertEqualInt(2, archive_entry_gid(ae)); - } else if (strcmp("file", archive_entry_pathname(ae)) == 0) { + } else if (strcmp("hardlink", archive_entry_pathname(ae)) == 0) { /* A hardlink to the regular file. */ /* Note: If "hardlink" gets returned before "file", * then "hardlink" will get returned as a regular file * and "file" will get returned as the hardlink. * This test should tolerate that, since it's a * perfectly permissible thing for libarchive to do. */ - assertEqualString("file", archive_entry_pathname(ae)); + assertEqualString("hardlink", archive_entry_pathname(ae)); assertEqualInt(AE_IFREG, archive_entry_filetype(ae)); - assertEqualString("hardlink", archive_entry_hardlink(ae)); + assertEqualString("file", archive_entry_hardlink(ae)); assertEqualInt(0, archive_entry_size_is_set(ae)); assertEqualInt(0, archive_entry_size(ae)); assertEqualInt(86401, archive_entry_mtime(ae)); Modified: head/lib/libarchive/test/test_read_format_isozisofs_bz2.c ============================================================================== --- head/lib/libarchive/test/test_read_format_isozisofs_bz2.c Thu Aug 25 08:17:39 2011 (r225166) +++ head/lib/libarchive/test/test_read_format_isozisofs_bz2.c Thu Aug 25 08:35:09 2011 (r225167) @@ -96,10 +96,10 @@ DEFINE_TEST(test_read_format_isozisofs_b assertEqualInt(2, archive_entry_stat(ae)->st_nlink); assertEqualInt(1, archive_entry_uid(ae)); assertEqualInt(2, archive_entry_gid(ae)); - } else if (strcmp("hardlink", archive_entry_pathname(ae)) == 0) { + } else if (strcmp("file", archive_entry_pathname(ae)) == 0) { int r; /* A regular file. */ - assertEqualString("hardlink", archive_entry_pathname(ae)); + assertEqualString("file", archive_entry_pathname(ae)); assertEqualInt(AE_IFREG, archive_entry_filetype(ae)); assertEqualInt(12345684, archive_entry_size(ae)); r = archive_read_data_block(a, &p, &size, &offset); @@ -111,23 +111,23 @@ DEFINE_TEST(test_read_format_isozisofs_b assertEqualMem(p, "hello\n", 6); } assertEqualInt(86401, archive_entry_mtime(ae)); + assertEqualInt(86401, archive_entry_atime(ae)); assertEqualInt(2, archive_entry_stat(ae)->st_nlink); assertEqualInt(1, archive_entry_uid(ae)); assertEqualInt(2, archive_entry_gid(ae)); - } else if (strcmp("file", archive_entry_pathname(ae)) == 0) { + } else if (strcmp("hardlink", archive_entry_pathname(ae)) == 0) { /* A hardlink to the regular file. */ /* Note: If "hardlink" gets returned before "file", * then "hardlink" will get returned as a regular file * and "file" will get returned as the hardlink. * This test should tolerate that, since it's a * perfectly permissible thing for libarchive to do. */ - assertEqualString("file", archive_entry_pathname(ae)); + assertEqualString("hardlink", archive_entry_pathname(ae)); assertEqualInt(AE_IFREG, archive_entry_filetype(ae)); - assertEqualString("hardlink", archive_entry_hardlink(ae)); + assertEqualString("file", archive_entry_hardlink(ae)); assertEqualInt(0, archive_entry_size_is_set(ae)); assertEqualInt(0, archive_entry_size(ae)); assertEqualInt(86401, archive_entry_mtime(ae)); - assertEqualInt(86401, archive_entry_atime(ae)); assertEqualInt(2, archive_entry_stat(ae)->st_nlink); assertEqualInt(1, archive_entry_uid(ae)); assertEqualInt(2, archive_entry_gid(ae)); From owner-svn-src-head@FreeBSD.ORG Thu Aug 25 08:47:38 2011 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 B1627106566B; Thu, 25 Aug 2011 08:47:38 +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 A17898FC19; Thu, 25 Aug 2011 08:47:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7P8lcUq094791; Thu, 25 Aug 2011 08:47:38 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7P8lcNb094789; Thu, 25 Aug 2011 08:47:38 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201108250847.p7P8lcNb094789@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 25 Aug 2011 08:47: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: r225168 - head/usr.sbin/mfiutil 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, 25 Aug 2011 08:47:38 -0000 Author: bz Date: Thu Aug 25 08:47:38 2011 New Revision: 225168 URL: http://svn.freebsd.org/changeset/base/225168 Log: If a drive is not part of the array (i.e. missing) we need to print the new line after the pd state information as well, so move it to the outside of the block. Submitted by: Mark Johnston at Sandvine Inc MFC atfer: 3 days Approved by: re (kib) Modified: head/usr.sbin/mfiutil/mfi_show.c Modified: head/usr.sbin/mfiutil/mfi_show.c ============================================================================== --- head/usr.sbin/mfiutil/mfi_show.c Thu Aug 25 08:35:09 2011 (r225167) +++ head/usr.sbin/mfiutil/mfi_show.c Thu Aug 25 08:47:38 2011 (r225168) @@ -330,8 +330,8 @@ show_config(int ac, char **av) mfi_pdstate(ar->pd[j].fw_state)); else print_pd(&pinfo, -1); - printf("\n"); } + printf("\n"); } p += config->array_size; } From owner-svn-src-head@FreeBSD.ORG Thu Aug 25 09:20:14 2011 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 743C21065670; Thu, 25 Aug 2011 09:20:14 +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 5A6038FC0C; Thu, 25 Aug 2011 09:20:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7P9KESw095796; Thu, 25 Aug 2011 09:20:14 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7P9KECb095791; Thu, 25 Aug 2011 09:20:14 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201108250920.p7P9KECb095791@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 25 Aug 2011 09:20: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: r225169 - in head/sys: kern netinet 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: Thu, 25 Aug 2011 09:20:14 -0000 Author: bz Date: Thu Aug 25 09:20:13 2011 New Revision: 225169 URL: http://svn.freebsd.org/changeset/base/225169 Log: Increase the defaults for the maximum socket buffer limit, and the maximum TCP send and receive buffer limits from 256kB to 2MB. For sb_max_adj we need to add the cast as already used in the sysctl handler to not overflow the type doing the maths. Note that this is just the defaults. They will allow more memory to be consumed per socket/connection if needed but not change the default "idle" memory consumption. All values are still tunable by sysctls. Suggested by: gnn Discussed on: arch (Mar and Aug 2011) MFC after: 3 weeks Approved by: re (kib) Modified: head/sys/kern/uipc_sockbuf.c head/sys/netinet/tcp_input.c head/sys/netinet/tcp_output.c head/sys/sys/sockbuf.h Modified: head/sys/kern/uipc_sockbuf.c ============================================================================== --- head/sys/kern/uipc_sockbuf.c Thu Aug 25 08:47:38 2011 (r225168) +++ head/sys/kern/uipc_sockbuf.c Thu Aug 25 09:20:13 2011 (r225169) @@ -61,7 +61,7 @@ void (*aio_swake)(struct socket *, struc u_long sb_max = SB_MAX; u_long sb_max_adj = - SB_MAX * MCLBYTES / (MSIZE + MCLBYTES); /* adjusted sb_max */ + (quad_t)SB_MAX * MCLBYTES / (MSIZE + MCLBYTES); /* adjusted sb_max */ static u_long sb_efficiency = 8; /* parameter for sbreserve() */ Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Thu Aug 25 08:47:38 2011 (r225168) +++ head/sys/netinet/tcp_input.c Thu Aug 25 09:20:13 2011 (r225169) @@ -195,7 +195,7 @@ SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, &VNET_NAME(tcp_autorcvbuf_inc), 0, "Incrementor step size of automatic receive buffer"); -VNET_DEFINE(int, tcp_autorcvbuf_max) = 256*1024; +VNET_DEFINE(int, tcp_autorcvbuf_max) = 2*1024*1024; #define V_tcp_autorcvbuf_max VNET(tcp_autorcvbuf_max) SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, recvbuf_max, CTLFLAG_RW, &VNET_NAME(tcp_autorcvbuf_max), 0, Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Thu Aug 25 08:47:38 2011 (r225168) +++ head/sys/netinet/tcp_output.c Thu Aug 25 09:20:13 2011 (r225169) @@ -117,7 +117,7 @@ SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, &VNET_NAME(tcp_autosndbuf_inc), 0, "Incrementor step size of automatic send buffer"); -VNET_DEFINE(int, tcp_autosndbuf_max) = 256*1024; +VNET_DEFINE(int, tcp_autosndbuf_max) = 2*1024*1024; #define V_tcp_autosndbuf_max VNET(tcp_autosndbuf_max) SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, sendbuf_max, CTLFLAG_RW, &VNET_NAME(tcp_autosndbuf_max), 0, Modified: head/sys/sys/sockbuf.h ============================================================================== --- head/sys/sys/sockbuf.h Thu Aug 25 08:47:38 2011 (r225168) +++ head/sys/sys/sockbuf.h Thu Aug 25 09:20:13 2011 (r225169) @@ -37,7 +37,7 @@ #include #include -#define SB_MAX (256*1024) /* default for max chars in sockbuf */ +#define SB_MAX (2*1024*1024) /* default for max chars in sockbuf */ /* * Constants for sb_flags field of struct sockbuf. From owner-svn-src-head@FreeBSD.ORG Thu Aug 25 09:38:34 2011 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 265261065673; Thu, 25 Aug 2011 09:38:34 +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 1646A8FC1F; Thu, 25 Aug 2011 09:38:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7P9cX3M096416; Thu, 25 Aug 2011 09:38:33 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7P9cXb7096414; Thu, 25 Aug 2011 09:38:33 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201108250938.p7P9cXb7096414@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 25 Aug 2011 09:38: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: r225171 - head/sys/contrib/pf/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: Thu, 25 Aug 2011 09:38:34 -0000 Author: bz Date: Thu Aug 25 09:38:33 2011 New Revision: 225171 URL: http://svn.freebsd.org/changeset/base/225171 Log: Use the correct byte order for the ip_divert(4) mbuf tag port meta information in pf(4). Submitted by: Yaocl (chunlinyao gmail.com), forum post 145106 Approved by: re (kib) Modified: head/sys/contrib/pf/net/pf.c Modified: head/sys/contrib/pf/net/pf.c ============================================================================== --- head/sys/contrib/pf/net/pf.c Thu Aug 25 09:29:28 2011 (r225170) +++ head/sys/contrib/pf/net/pf.c Thu Aug 25 09:38:33 2011 (r225171) @@ -6967,7 +6967,8 @@ done: ipfwtag = m_tag_alloc(MTAG_IPFW_RULE, 0, sizeof(struct ipfw_rule_ref), M_NOWAIT | M_ZERO); if (ipfwtag != NULL) { - ((struct ipfw_rule_ref *)(ipfwtag+1))->info = r->divert.port; + ((struct ipfw_rule_ref *)(ipfwtag+1))->info = + ntohs(r->divert.port); ((struct ipfw_rule_ref *)(ipfwtag+1))->rulenum = dir; m_tag_prepend(m, ipfwtag); From owner-svn-src-head@FreeBSD.ORG Thu Aug 25 10:00:39 2011 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 3ED291065673; Thu, 25 Aug 2011 10:00:39 +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 1B8898FC1B; Thu, 25 Aug 2011 10:00:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7PA0cgx097196; Thu, 25 Aug 2011 10:00:39 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7PA0c89097193; Thu, 25 Aug 2011 10:00:38 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201108251000.p7PA0c89097193@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 25 Aug 2011 10:00: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: r225172 - head/lib/libc/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: Thu, 25 Aug 2011 10:00:39 -0000 Author: kib Date: Thu Aug 25 10:00:38 2011 New Revision: 225172 URL: http://svn.freebsd.org/changeset/base/225172 Log: Clarify the behaviour of sigwait() on signal interruption, and note the difference between sigwait() and sigtimedwait()/sigwaitinfo(). Approved by: re (bz) Modified: head/lib/libc/sys/sigwait.2 head/lib/libc/sys/sigwaitinfo.2 Modified: head/lib/libc/sys/sigwait.2 ============================================================================== --- head/lib/libc/sys/sigwait.2 Thu Aug 25 09:38:33 2011 (r225171) +++ head/lib/libc/sys/sigwait.2 Thu Aug 25 10:00:38 2011 (r225172) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 11, 2005 +.Dd August 24, 2011 .Dt SIGWAIT 2 .Os .Sh NAME @@ -82,6 +82,14 @@ selected, it will be the lowest numbered The selection order between realtime and non-realtime signals, or between multiple pending non-realtime signals, is unspecified. +.Sh IMPLEMENTATION NOTES +The +.Fn sigwait +function is implemented as a wrapper around the +.Fn __sys_sigwait +system call, which retries the call on +.Er EINTR +error. .Sh RETURN VALUES If successful, .Fn sigwait Modified: head/lib/libc/sys/sigwaitinfo.2 ============================================================================== --- head/lib/libc/sys/sigwaitinfo.2 Thu Aug 25 09:38:33 2011 (r225171) +++ head/lib/libc/sys/sigwaitinfo.2 Thu Aug 25 10:00:38 2011 (r225172) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 11, 2005 +.Dd August 24, 2011 .Dt SIGTIMEDWAIT 2 .Os .Sh NAME @@ -116,6 +116,16 @@ except that the selected signal number s member, and the cause of the signal shall be stored in the .Va si_code member. +Besides this, the +.Fn sigwaitinfo +and +.Fn sigtimedwait +system calls may return +.Er EINTR +if interrupted by signal, which is not allowed for the +.Fn sigwait +function. +.Pp If any value is queued to the selected signal, the first such queued value is dequeued and, if the info argument is .Pf non- Dv NULL , From owner-svn-src-head@FreeBSD.ORG Thu Aug 25 15:51:55 2011 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 224EC1065674; Thu, 25 Aug 2011 15:51:55 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0FB978FC1A; Thu, 25 Aug 2011 15:51:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7PFpseJ009634; Thu, 25 Aug 2011 15:51:54 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7PFpslj009617; Thu, 25 Aug 2011 15:51:54 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201108251551.p7PFpslj009617@svn.freebsd.org> From: Attilio Rao Date: Thu, 25 Aug 2011 15:51: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: r225177 - in head: share/man/man9 sys/kern sys/net sys/security/audit sys/sys sys/x86/acpica 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, 25 Aug 2011 15:51:55 -0000 Author: attilio Date: Thu Aug 25 15:51:54 2011 New Revision: 225177 URL: http://svn.freebsd.org/changeset/base/225177 Log: Fix a deficiency in the selinfo interface: If a selinfo object is recorded (via selrecord()) and then it is quickly destroyed, with the waiters missing the opportunity to awake, at the next iteration they will find the selinfo object destroyed, causing a PF#. That happens because the selinfo interface has no way to drain the waiters before to destroy the registered selinfo object. Also this race is quite rare to get in practice, because it would require a selrecord(), a poll request by another thread and a quick destruction of the selrecord()'ed selinfo object. Fix this by adding the seldrain() routine which should be called before to destroy the selinfo objects (in order to avoid such case), and fix the present cases where it might have already been called. Sometimes, the context is safe enough to prevent this type of race, like it happens in device drivers which installs selinfo objects on poll callbacks. There, the destruction of the selinfo object happens at driver detach time, when all the filedescriptors should be already closed, thus there cannot be a race. For this case, mfi(4) device driver can be set as an example, as it implements a full correct logic for preventing this from happening. Sponsored by: Sandvine Incorporated Reported by: rstone Tested by: pluknet Reviewed by: jhb, kib Approved by: re (bz) MFC after: 3 weeks Modified: head/share/man/man9/Makefile head/share/man/man9/selrecord.9 head/sys/kern/kern_event.c head/sys/kern/sys_generic.c head/sys/kern/sys_pipe.c head/sys/kern/tty.c head/sys/kern/tty_pts.c head/sys/kern/uipc_mqueue.c head/sys/kern/uipc_socket.c head/sys/kern/vfs_subr.c head/sys/net/bpf.c head/sys/net/if_tap.c head/sys/net/if_tun.c head/sys/security/audit/audit_pipe.c head/sys/sys/selinfo.h head/sys/x86/acpica/acpi_apm.c Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Thu Aug 25 12:28:41 2011 (r225176) +++ head/share/man/man9/Makefile Thu Aug 25 15:51:54 2011 (r225177) @@ -1075,7 +1075,7 @@ MLINKS+=scheduler.9 curpriority_cmp.9 \ scheduler.9 setrunnable.9 \ scheduler.9 updatepri.9 MLINKS+=securelevel_gt.9 securelevel_ge.9 -MLINKS+=selrecord.9 selwakeup.9 +MLINKS+=seldrain.9 selrecord.9 selwakeup.9 MLINKS+=sema.9 sema_destroy.9 \ sema.9 sema_init.9 \ sema.9 sema_post.9 \ Modified: head/share/man/man9/selrecord.9 ============================================================================== --- head/share/man/man9/selrecord.9 Thu Aug 25 12:28:41 2011 (r225176) +++ head/share/man/man9/selrecord.9 Thu Aug 25 15:51:54 2011 (r225177) @@ -26,10 +26,11 @@ .\" .\" $FreeBSD$ .\" -.Dd June 13, 2007 +.Dd August 25, 2011 .Dt SELRECORD 9 .Os .Sh NAME +.Nm seldrain , .Nm selrecord , .Nm selwakeup .Nd "record and wakeup select requests" @@ -37,14 +38,17 @@ .In sys/param.h .In sys/selinfo.h .Ft void +.Fn seldrain "struct selinfo *sip" +.Ft void .Fn selrecord "struct thread *td" "struct selinfo *sip" .Ft void .Fn selwakeup "struct selinfo *sip" .Sh DESCRIPTION +.Fn seldrain , .Fn selrecord and .Fn selwakeup -are the two central functions used by +are the three central functions used by .Xr select 2 , .Xr poll 2 and the objects that are being selected on. @@ -86,6 +90,15 @@ and .Xr poll 2 when they wake up. .Pp +.Fn seldrain +will flush the waiters queue on a specified object before its +destruction. +The object handling code must ensure that +.Fa *sip +cannot be used once +.Fn seldrain +has been called. +.Pp The contents of .Fa *sip must be zeroed, such as by softc initialization, before any call to @@ -98,6 +111,10 @@ acquires and releases .Va sellock and may acquire and release .Va sched_lock . +.Fn seldrain +could usually be just a wrapper for +.Fn selwakeup , +but consumers should not generally rely on this feature. .Sh SEE ALSO .Xr poll 2 , .Xr select 2 Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Thu Aug 25 12:28:41 2011 (r225176) +++ head/sys/kern/kern_event.c Thu Aug 25 15:51:54 2011 (r225177) @@ -1704,6 +1704,7 @@ kqueue_close(struct file *fp, struct thr SLIST_REMOVE(&fdp->fd_kqlist, kq, kqueue, kq_list); FILEDESC_XUNLOCK(fdp); + seldrain(&kq->kq_sel); knlist_destroy(&kq->kq_sel.si_note); mtx_destroy(&kq->kq_lock); kq->kq_fdp = NULL; Modified: head/sys/kern/sys_generic.c ============================================================================== --- head/sys/kern/sys_generic.c Thu Aug 25 12:28:41 2011 (r225176) +++ head/sys/kern/sys_generic.c Thu Aug 25 15:51:54 2011 (r225177) @@ -1490,6 +1490,23 @@ selfdfree(struct seltd *stp, struct self uma_zfree(selfd_zone, sfp); } +/* Drain the waiters tied to all the selfd belonging the specified selinfo. */ +void +seldrain(sip) + struct selinfo *sip; +{ + + /* + * This feature is already provided by doselwakeup(), thus it is + * enough to go for it. + * Eventually, the context, should take care to avoid races + * between thread calling select()/poll() and file descriptor + * detaching, but, again, the races are just the same as + * selwakeup(). + */ + doselwakeup(sip, -1); +} + /* * Record a select request. */ Modified: head/sys/kern/sys_pipe.c ============================================================================== --- head/sys/kern/sys_pipe.c Thu Aug 25 12:28:41 2011 (r225176) +++ head/sys/kern/sys_pipe.c Thu Aug 25 15:51:54 2011 (r225177) @@ -1517,6 +1517,7 @@ pipeclose(cpipe) */ knlist_clear(&cpipe->pipe_sel.si_note, 1); cpipe->pipe_present = PIPE_FINALIZED; + seldrain(&cpipe->pipe_sel); knlist_destroy(&cpipe->pipe_sel.si_note); /* Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Thu Aug 25 12:28:41 2011 (r225176) +++ head/sys/kern/tty.c Thu Aug 25 15:51:54 2011 (r225177) @@ -1022,6 +1022,8 @@ tty_dealloc(void *arg) MPASS(ttyinq_getsize(&tp->t_inq) == 0); MPASS(ttyoutq_getsize(&tp->t_outq) == 0); + seldrain(&tp->t_inpoll); + seldrain(&tp->t_outpoll); knlist_destroy(&tp->t_inpoll.si_note); knlist_destroy(&tp->t_outpoll.si_note); Modified: head/sys/kern/tty_pts.c ============================================================================== --- head/sys/kern/tty_pts.c Thu Aug 25 12:28:41 2011 (r225176) +++ head/sys/kern/tty_pts.c Thu Aug 25 15:51:54 2011 (r225177) @@ -688,6 +688,8 @@ ptsdrv_free(void *softc) racct_sub_cred(psc->pts_cred, RACCT_NPTS, 1); crfree(psc->pts_cred); + seldrain(&psc->pts_inpoll); + seldrain(&psc->pts_outpoll); knlist_destroy(&psc->pts_inpoll.si_note); knlist_destroy(&psc->pts_outpoll.si_note); Modified: head/sys/kern/uipc_mqueue.c ============================================================================== --- head/sys/kern/uipc_mqueue.c Thu Aug 25 12:28:41 2011 (r225176) +++ head/sys/kern/uipc_mqueue.c Thu Aug 25 15:51:54 2011 (r225177) @@ -1562,6 +1562,8 @@ mqueue_free(struct mqueue *mq) } mtx_destroy(&mq->mq_mutex); + seldrain(&mq->mq_rsel); + seldrain(&mq->mq_wsel); knlist_destroy(&mq->mq_rsel.si_note); knlist_destroy(&mq->mq_wsel.si_note); uma_zfree(mqueue_zone, mq); Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Thu Aug 25 12:28:41 2011 (r225176) +++ head/sys/kern/uipc_socket.c Thu Aug 25 15:51:54 2011 (r225177) @@ -661,6 +661,8 @@ sofree(struct socket *so) */ sbdestroy(&so->so_snd, so); sbdestroy(&so->so_rcv, so); + seldrain(&so->so_snd.sb_sel); + seldrain(&so->so_rcv.sb_sel); knlist_destroy(&so->so_rcv.sb_sel.si_note); knlist_destroy(&so->so_snd.sb_sel.si_note); sodealloc(so); Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Thu Aug 25 12:28:41 2011 (r225176) +++ head/sys/kern/vfs_subr.c Thu Aug 25 15:51:54 2011 (r225177) @@ -3312,6 +3312,7 @@ vbusy(struct vnode *vp) static void destroy_vpollinfo(struct vpollinfo *vi) { + seldrain(&vi->vpi_selinfo); knlist_destroy(&vi->vpi_selinfo.si_note); mtx_destroy(&vi->vpi_lock); uma_zfree(vnodepoll_zone, vi); Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Thu Aug 25 12:28:41 2011 (r225176) +++ head/sys/net/bpf.c Thu Aug 25 15:51:54 2011 (r225177) @@ -652,10 +652,10 @@ bpf_dtor(void *data) if (d->bd_bif) bpf_detachd(d); mtx_unlock(&bpf_mtx); - selwakeuppri(&d->bd_sel, PRINET); #ifdef MAC mac_bpfdesc_destroy(d); #endif /* MAC */ + seldrain(&d->bd_sel); knlist_destroy(&d->bd_sel.si_note); callout_drain(&d->bd_callout); bpf_freed(d); Modified: head/sys/net/if_tap.c ============================================================================== --- head/sys/net/if_tap.c Thu Aug 25 12:28:41 2011 (r225176) +++ head/sys/net/if_tap.c Thu Aug 25 15:51:54 2011 (r225177) @@ -214,6 +214,7 @@ tap_destroy(struct tap_softc *tp) KASSERT(!(tp->tap_flags & TAP_OPEN), ("%s flags is out of sync", ifp->if_xname)); + seldrain(&tp->tap_rsel); knlist_destroy(&tp->tap_rsel.si_note); destroy_dev(tp->tap_dev); ether_ifdetach(ifp); Modified: head/sys/net/if_tun.c ============================================================================== --- head/sys/net/if_tun.c Thu Aug 25 12:28:41 2011 (r225176) +++ head/sys/net/if_tun.c Thu Aug 25 15:51:54 2011 (r225177) @@ -259,6 +259,7 @@ tun_destroy(struct tun_softc *tp) if_detach(TUN2IFP(tp)); if_free(TUN2IFP(tp)); destroy_dev(dev); + seldrain(&tp->tun_rsel); knlist_destroy(&tp->tun_rsel.si_note); mtx_destroy(&tp->tun_mtx); cv_destroy(&tp->tun_cv); Modified: head/sys/security/audit/audit_pipe.c ============================================================================== --- head/sys/security/audit/audit_pipe.c Thu Aug 25 12:28:41 2011 (r225176) +++ head/sys/security/audit/audit_pipe.c Thu Aug 25 15:51:54 2011 (r225177) @@ -646,6 +646,7 @@ audit_pipe_free(struct audit_pipe *ap) cv_destroy(&ap->ap_cv); AUDIT_PIPE_SX_LOCK_DESTROY(ap); AUDIT_PIPE_LOCK_DESTROY(ap); + seldrain(&ap->ap_selinfo); knlist_destroy(&ap->ap_selinfo.si_note); TAILQ_REMOVE(&audit_pipe_list, ap, ap_list); free(ap, M_AUDIT_PIPE); Modified: head/sys/sys/selinfo.h ============================================================================== --- head/sys/sys/selinfo.h Thu Aug 25 12:28:41 2011 (r225176) +++ head/sys/sys/selinfo.h Thu Aug 25 15:51:54 2011 (r225177) @@ -51,6 +51,7 @@ struct selinfo { #define SEL_WAITING(si) (!TAILQ_EMPTY(&(si)->si_tdlist)) #ifdef _KERNEL +void seldrain(struct selinfo *sip); void selrecord(struct thread *selector, struct selinfo *sip); void selwakeup(struct selinfo *sip); void selwakeuppri(struct selinfo *sip, int pri); Modified: head/sys/x86/acpica/acpi_apm.c ============================================================================== --- head/sys/x86/acpica/acpi_apm.c Thu Aug 25 12:28:41 2011 (r225176) +++ head/sys/x86/acpica/acpi_apm.c Thu Aug 25 15:51:54 2011 (r225177) @@ -297,6 +297,7 @@ apmclose(struct cdev *dev, int flag, int /* Remove this clone's data from the list and free it. */ ACPI_LOCK(acpi); STAILQ_REMOVE(&acpi_sc->apm_cdevs, clone, apm_clone_data, entries); + seldrain(&clone->sel_read); knlist_destroy(&clone->sel_read.si_note); ACPI_UNLOCK(acpi); free(clone, M_APMDEV); From owner-svn-src-head@FreeBSD.ORG Thu Aug 25 17:42:28 2011 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 2D6931065673; Thu, 25 Aug 2011 17:42:28 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1CDB88FC12; Thu, 25 Aug 2011 17:42:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7PHgSlK013076; Thu, 25 Aug 2011 17:42:28 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7PHgRXe013074; Thu, 25 Aug 2011 17:42:27 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201108251742.p7PHgRXe013074@svn.freebsd.org> From: Attilio Rao Date: Thu, 25 Aug 2011 17:42: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: r225181 - head/share/man/man9 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, 25 Aug 2011 17:42:28 -0000 Author: attilio Date: Thu Aug 25 17:42:27 2011 New Revision: 225181 URL: http://svn.freebsd.org/changeset/base/225181 Log: Fix an error in the generation of the manpage after r225177. Sponsored by: Sandvine Incorporated Submitted by: jkim Approved by: re (bz) MFC after: 3 weeks X-MFC: r225177 Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Thu Aug 25 17:35:10 2011 (r225180) +++ head/share/man/man9/Makefile Thu Aug 25 17:42:27 2011 (r225181) @@ -1075,7 +1075,8 @@ MLINKS+=scheduler.9 curpriority_cmp.9 \ scheduler.9 setrunnable.9 \ scheduler.9 updatepri.9 MLINKS+=securelevel_gt.9 securelevel_ge.9 -MLINKS+=seldrain.9 selrecord.9 selwakeup.9 +MLINKS+=selrecord.9 seldrain.9 \ + selrecord.9 selwakeup.9 MLINKS+=sema.9 sema_destroy.9 \ sema.9 sema_init.9 \ sema.9 sema_post.9 \ From owner-svn-src-head@FreeBSD.ORG Thu Aug 25 21:20:12 2011 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 611981065675; Thu, 25 Aug 2011 21:20:12 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4FBC18FC0A; Thu, 25 Aug 2011 21:20:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7PLKCST019696; Thu, 25 Aug 2011 21:20:12 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7PLKC3d019693; Thu, 25 Aug 2011 21:20:12 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201108252120.p7PLKC3d019693@svn.freebsd.org> From: Christian Brueffer Date: Thu, 25 Aug 2011 21:20: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: r225184 - in head/release/doc: en_US.ISO8859-1/hardware share/misc 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, 25 Aug 2011 21:20:12 -0000 Author: brueffer Date: Thu Aug 25 21:20:11 2011 New Revision: 225184 URL: http://svn.freebsd.org/changeset/base/225184 Log: Auto-generate hardware notes for vxge(4). Approved by: re (kib) Modified: head/release/doc/en_US.ISO8859-1/hardware/article.sgml head/release/doc/share/misc/dev.archlist.txt Modified: head/release/doc/en_US.ISO8859-1/hardware/article.sgml ============================================================================== --- head/release/doc/en_US.ISO8859-1/hardware/article.sgml Thu Aug 25 18:03:29 2011 (r225183) +++ head/release/doc/en_US.ISO8859-1/hardware/article.sgml Thu Aug 25 21:20:11 2011 (r225184) @@ -987,6 +987,8 @@ &hwlist.vx; + &hwlist.vxge; + &hwlist.wb; &hwlist.xe; Modified: head/release/doc/share/misc/dev.archlist.txt ============================================================================== --- head/release/doc/share/misc/dev.archlist.txt Thu Aug 25 18:03:29 2011 (r225183) +++ head/release/doc/share/misc/dev.archlist.txt Thu Aug 25 21:20:11 2011 (r225184) @@ -161,6 +161,7 @@ uvisor i386,pc98,amd64 uvscom i386,pc98,amd64 vpo i386 vx i386,pc98,ia64,amd64 +vxge i386,amd64 wb i386,pc98,amd64 xe i386,amd64 zyd i386,amd64 From owner-svn-src-head@FreeBSD.ORG Fri Aug 26 14:05:48 2011 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 C1B35106566B; Fri, 26 Aug 2011 14:05:48 +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 B11FB8FC0C; Fri, 26 Aug 2011 14:05:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7QE5man057825; Fri, 26 Aug 2011 14:05:48 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7QE5mLR057823; Fri, 26 Aug 2011 14:05:48 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201108261405.p7QE5mLR057823@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 26 Aug 2011 14:05: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: r225189 - head/etc 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, 26 Aug 2011 14:05:48 -0000 Author: nwhitehorn Date: Fri Aug 26 14:05:48 2011 New Revision: 225189 URL: http://svn.freebsd.org/changeset/base/225189 Log: Fix path to the handbook and provide a hint about how to install it if it was not added at installation time. Approved by: re (blackend) Modified: head/etc/motd Modified: head/etc/motd ============================================================================== --- head/etc/motd Fri Aug 26 10:39:33 2011 (r225188) +++ head/etc/motd Fri Aug 26 14:05:48 2011 (r225189) @@ -10,8 +10,10 @@ o Security advisories and updated errat o The Handbook and FAQ documents are at http://www.FreeBSD.org/ and, along with the mailing lists, can be searched by going to - http://www.FreeBSD.org/search/. If the doc distribution has - been installed, they're also available formatted in /usr/share/doc. + http://www.FreeBSD.org/search/. If the doc package has been installed + (or fetched via pkg_add -r lang-freebsd-doc, where lang is the + 2-letter language code, e.g. en), they are also available formatted + in /usr/local/share/doc/freebsd. If you still have a question or problem, please take the output of `uname -a', along with any relevant error messages, and email it From owner-svn-src-head@FreeBSD.ORG Fri Aug 26 15:24:54 2011 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 968C4106566C; Fri, 26 Aug 2011 15:24:54 +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 8548E8FC0A; Fri, 26 Aug 2011 15:24:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7QFOsfW060271; Fri, 26 Aug 2011 15:24:54 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7QFOso8060269; Fri, 26 Aug 2011 15:24:54 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201108261524.p7QFOso8060269@svn.freebsd.org> From: Olivier Houchard Date: Fri, 26 Aug 2011 15:24: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: r225190 - head/gnu/usr.bin/gdb/arch/arm 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, 26 Aug 2011 15:24:54 -0000 Author: cognet Date: Fri Aug 26 15:24:54 2011 New Revision: 225190 URL: http://svn.freebsd.org/changeset/base/225190 Log: Do not include if we're building a cross-debugger, ptrace isn't used anyway, and it breaks the build, since sys/ptrace.h now includes Approved by: re Modified: head/gnu/usr.bin/gdb/arch/arm/armfbsd-nat.c Modified: head/gnu/usr.bin/gdb/arch/arm/armfbsd-nat.c ============================================================================== --- head/gnu/usr.bin/gdb/arch/arm/armfbsd-nat.c Fri Aug 26 14:05:48 2011 (r225189) +++ head/gnu/usr.bin/gdb/arch/arm/armfbsd-nat.c Fri Aug 26 15:24:54 2011 (r225190) @@ -32,8 +32,8 @@ #include "arm-tdep.h" #include -#include #ifndef CROSS_DEBUGGER +#include #include #include #endif From owner-svn-src-head@FreeBSD.ORG Fri Aug 26 16:03:34 2011 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 CBAEB106566B; Fri, 26 Aug 2011 16:03:34 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA8158FC12; Fri, 26 Aug 2011 16:03:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7QG3Ydf061536; Fri, 26 Aug 2011 16:03:34 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7QG3YbF061534; Fri, 26 Aug 2011 16:03:34 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <201108261603.p7QG3YbF061534@svn.freebsd.org> From: Jamie Gritton Date: Fri, 26 Aug 2011 16:03: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: r225191 - 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, 26 Aug 2011 16:03:34 -0000 Author: jamie Date: Fri Aug 26 16:03:34 2011 New Revision: 225191 URL: http://svn.freebsd.org/changeset/base/225191 Log: Delay the recursive decrement of pr_uref when jails are made invisible but not removed; decrement it instead when the child jail actually goes away. This avoids letting the counter go below zero in the case where dying (pr_uref==0) jails are "resurrected", and an associated KASSERT panic. Submitted by: Steven Hartland Approved by: re (bz) MFC after: 1 week Modified: head/sys/kern/kern_jail.c Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Fri Aug 26 15:24:54 2011 (r225190) +++ head/sys/kern/kern_jail.c Fri Aug 26 16:03:34 2011 (r225191) @@ -2470,32 +2470,11 @@ prison_deref(struct prison *pr, int flag if (!(flags & PD_LOCKED)) mtx_lock(&pr->pr_mtx); - /* Decrement the user references in a separate loop. */ - if (flags & PD_DEUREF) { - for (tpr = pr;; tpr = tpr->pr_parent) { - if (tpr != pr) - mtx_lock(&tpr->pr_mtx); - if (--tpr->pr_uref > 0) - break; - KASSERT(tpr != &prison0, ("prison0 pr_uref=0")); - mtx_unlock(&tpr->pr_mtx); - } - /* Done if there were only user references to remove. */ - if (!(flags & PD_DEREF)) { - mtx_unlock(&tpr->pr_mtx); - if (flags & PD_LIST_SLOCKED) - sx_sunlock(&allprison_lock); - else if (flags & PD_LIST_XLOCKED) - sx_xunlock(&allprison_lock); - return; - } - if (tpr != pr) { - mtx_unlock(&tpr->pr_mtx); - mtx_lock(&pr->pr_mtx); - } - } - for (;;) { + if (flags & PD_DEUREF) { + pr->pr_uref--; + KASSERT(prison0.pr_uref != 0, ("prison0 pr_uref=0")); + } if (flags & PD_DEREF) pr->pr_ref--; /* If the prison still has references, nothing else to do. */ @@ -2551,7 +2530,7 @@ prison_deref(struct prison *pr, int flag /* Removing a prison frees a reference on its parent. */ pr = ppr; mtx_lock(&pr->pr_mtx); - flags = PD_DEREF; + flags = PD_DEREF | PD_DEUREF; } } From owner-svn-src-head@FreeBSD.ORG Fri Aug 26 17:08:23 2011 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 1EE5B1065672; Fri, 26 Aug 2011 17:08: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 E85C18FC08; Fri, 26 Aug 2011 17:08:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7QH8M7Y063595; Fri, 26 Aug 2011 17:08:22 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7QH8MAW063591; Fri, 26 Aug 2011 17:08:22 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201108261708.p7QH8MAW063591@svn.freebsd.org> From: John Baldwin Date: Fri, 26 Aug 2011 17:08: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: r225194 - in head/sys: amd64/amd64 amd64/conf 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: Fri, 26 Aug 2011 17:08:23 -0000 Author: jhb Date: Fri Aug 26 17:08:22 2011 New Revision: 225194 URL: http://svn.freebsd.org/changeset/base/225194 Log: Make NKPT a kernel option on amd64 so that it can be set to a non-default value from kernel config files. Reviewed by: alc Approved by: re (kib) MFC after: 1 week Modified: head/sys/amd64/amd64/minidump_machdep.c head/sys/amd64/conf/NOTES head/sys/conf/options.amd64 Modified: head/sys/amd64/amd64/minidump_machdep.c ============================================================================== --- head/sys/amd64/amd64/minidump_machdep.c Fri Aug 26 17:02:53 2011 (r225193) +++ head/sys/amd64/amd64/minidump_machdep.c Fri Aug 26 17:08:22 2011 (r225194) @@ -27,6 +27,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_pmap.h" #include "opt_watchdog.h" #include Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Fri Aug 26 17:02:53 2011 (r225193) +++ head/sys/amd64/conf/NOTES Fri Aug 26 17:08:22 2011 (r225194) @@ -490,6 +490,14 @@ options ENABLE_ALART # Control alarm o # options PMAP_SHPGPERPROC=201 +# +# Number of initial kernel page table pages used for early bootstrap. +# This number should include enough pages to map the kernel and any +# modules or other data loaded with the kernel by the loader. Each +# page table page maps 2MB. +# +options NKPT=31 + ##################################################################### # ABI Emulation Modified: head/sys/conf/options.amd64 ============================================================================== --- head/sys/conf/options.amd64 Fri Aug 26 17:02:53 2011 (r225193) +++ head/sys/conf/options.amd64 Fri Aug 26 17:08:22 2011 (r225194) @@ -10,6 +10,7 @@ PERFMON PMAP_SHPGPERPROC opt_pmap.h MPTABLE_FORCE_HTT MP_WATCHDOG +NKPT opt_pmap.h # Options for emulators. These should only be used at config time, so # they are handled like options for static filesystems From owner-svn-src-head@FreeBSD.ORG Fri Aug 26 17:35:22 2011 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 736D3106566C; Fri, 26 Aug 2011 17:35:22 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 61AA78FC08; Fri, 26 Aug 2011 17:35:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7QHZMPM064461; Fri, 26 Aug 2011 17:35:22 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7QHZMMf064458; Fri, 26 Aug 2011 17:35:22 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201108261735.p7QHZMMf064458@svn.freebsd.org> From: Christian Brueffer Date: Fri, 26 Aug 2011 17:35: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: r225196 - 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, 26 Aug 2011 17:35:22 -0000 Author: brueffer Date: Fri Aug 26 17:35:22 2011 New Revision: 225196 URL: http://svn.freebsd.org/changeset/base/225196 Log: Fix the manpage section number, thus unbreaking the hardware notes build. (1) Also hook up vxge(4) to the build. Submitted by: simon (1) Approved by: re (blackend) Modified: head/share/man/man4/Makefile head/share/man/man4/vxge.4 Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Fri Aug 26 17:28:29 2011 (r225195) +++ head/share/man/man4/Makefile Fri Aug 26 17:35:22 2011 (r225196) @@ -500,6 +500,7 @@ MAN= aac.4 \ vpo.4 \ vr.4 \ vte.4 \ + ${_vxge.4} \ watchdog.4 \ wb.4 \ wi.4 \ @@ -645,6 +646,7 @@ MLINKS+=vge.4 if_vge.4 MLINKS+=vlan.4 if_vlan.4 MLINKS+=vpo.4 imm.4 MLINKS+=vr.4 if_vr.4 +MLINKS+=${_vxge.4} ${_if_vxge.4} MLINKS+=watchdog.4 SW_WATCHDOG.4 MLINKS+=wb.4 if_wb.4 MLINKS+=wi.4 if_wi.4 @@ -685,6 +687,7 @@ _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_vxge.4= if_vxge.4 _if_wpi.4= if_wpi.4 _ipmi.4= ipmi.4 _io.4= io.4 @@ -696,6 +699,7 @@ _nfsmb.4= nfsmb.4 _nve.4= nve.4 _nvram.4= nvram.4 _nxge.4= nxge.4 +_vxge.4= vxge.4 _padlock.4= padlock.4 _rr232x.4= rr232x.4 _speaker.4= speaker.4 Modified: head/share/man/man4/vxge.4 ============================================================================== --- head/share/man/man4/vxge.4 Fri Aug 26 17:28:29 2011 (r225195) +++ head/share/man/man4/vxge.4 Fri Aug 26 17:35:22 2011 (r225196) @@ -25,7 +25,7 @@ .\" $FreeBSD$ .\" .Dd March 16, 2011 -.Dt VXGE 1 +.Dt VXGE 4 .Os .Sh NAME .Nm vxge From owner-svn-src-head@FreeBSD.ORG Fri Aug 26 18:00:08 2011 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 67BB5106564A; Fri, 26 Aug 2011 18:00:08 +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 298458FC16; Fri, 26 Aug 2011 18:00:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7QI088L065298; Fri, 26 Aug 2011 18:00:08 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7QI08LJ065295; Fri, 26 Aug 2011 18:00:08 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201108261800.p7QI08LJ065295@svn.freebsd.org> From: Xin LI Date: Fri, 26 Aug 2011 18:00:08 +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: r225199 - 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, 26 Aug 2011 18:00:08 -0000 Author: delphij Date: Fri Aug 26 18:00:07 2011 New Revision: 225199 URL: http://svn.freebsd.org/changeset/base/225199 Log: Fix format strings for KTR_STATE in 4BSD ad ULE schedulers. Submitted by: Ivan Klymenko PR: kern/159904, kern/159905 MFC after: 2 weeks Approved by: re (kib) Modified: head/sys/kern/sched_4bsd.c head/sys/kern/sched_ule.c Modified: head/sys/kern/sched_4bsd.c ============================================================================== --- head/sys/kern/sched_4bsd.c Fri Aug 26 17:45:56 2011 (r225198) +++ head/sys/kern/sched_4bsd.c Fri Aug 26 18:00:07 2011 (r225199) @@ -720,7 +720,7 @@ sched_exit(struct proc *p, struct thread { KTR_STATE1(KTR_SCHED, "thread", sched_tdname(td), "proc exit", - "prio:td", td->td_priority); + "prio:%d", td->td_priority); PROC_LOCK_ASSERT(p, MA_OWNED); sched_exit_thread(FIRST_THREAD_IN_PROC(p), td); @@ -731,7 +731,7 @@ sched_exit_thread(struct thread *td, str { KTR_STATE1(KTR_SCHED, "thread", sched_tdname(child), "exit", - "prio:td", child->td_priority); + "prio:%d", child->td_priority); thread_lock(td); td->td_estcpu = ESTCPULIM(td->td_estcpu + child->td_estcpu); thread_unlock(td); Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Fri Aug 26 17:45:56 2011 (r225198) +++ head/sys/kern/sched_ule.c Fri Aug 26 18:00:07 2011 (r225199) @@ -2022,7 +2022,7 @@ sched_exit(struct proc *p, struct thread struct thread *td; KTR_STATE1(KTR_SCHED, "thread", sched_tdname(child), "proc exit", - "prio:td", child->td_priority); + "prio:%d", child->td_priority); PROC_LOCK_ASSERT(p, MA_OWNED); td = FIRST_THREAD_IN_PROC(p); sched_exit_thread(td, child); @@ -2039,7 +2039,7 @@ sched_exit_thread(struct thread *td, str { KTR_STATE1(KTR_SCHED, "thread", sched_tdname(child), "thread exit", - "prio:td", child->td_priority); + "prio:%d", child->td_priority); /* * Give the child's runtime to the parent without returning the * sleep time as a penalty to the parent. This causes shells that From owner-svn-src-head@FreeBSD.ORG Fri Aug 26 19:44:40 2011 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 8CCC3106564A; Fri, 26 Aug 2011 19:44:40 +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 433878FC0A; Fri, 26 Aug 2011 19:44:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7QJie8D068376; Fri, 26 Aug 2011 19:44:40 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7QJie2n068374; Fri, 26 Aug 2011 19:44:40 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201108261944.p7QJie2n068374@svn.freebsd.org> From: John Baldwin Date: Fri, 26 Aug 2011 19:44: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: r225200 - 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, 26 Aug 2011 19:44:40 -0000 Author: jhb Date: Fri Aug 26 19:44:39 2011 New Revision: 225200 URL: http://svn.freebsd.org/changeset/base/225200 Log: - Replace references to sio(4) with uart(4) instead. - We no longer use the same data structure in as NetBSD in pucdata.c. - ppc(4) has had a puc(4) attachment for a while now. Approved by: re (blackend) MFC after: 3 days Modified: head/share/man/man4/puc.4 Modified: head/share/man/man4/puc.4 ============================================================================== --- head/share/man/man4/puc.4 Fri Aug 26 18:00:07 2011 (r225199) +++ head/share/man/man4/puc.4 Fri Aug 26 19:44:39 2011 (r225200) @@ -35,11 +35,11 @@ Communications driver .Sh SYNOPSIS .Cd "device pci" .Cd "device puc" -.Cd "device sio" +.Cd "device uart" .Cd "device ppc" .Sh DESCRIPTION This driver acts as a shim to connect PCI serial and parallel ports to the -.Xr sio 4 +.Xr uart 4 and .Xr ppc 4 driver. @@ -49,14 +49,9 @@ The list of supported devices is in Support for new cards should be added there. .Sh SEE ALSO .Xr ppc 4 , -.Xr sio 4 +.Xr uart 4 .Sh HISTORY This driver took the idea from the .Nx .Xr puc 4 -driver and still uses the same structure to describe cards, to ease exchanging -card info. -.Sh BUGS -Only serial ports are supported through the -.Xr sio 4 -driver at the moment. +driver. From owner-svn-src-head@FreeBSD.ORG Fri Aug 26 21:22:35 2011 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 48DFA1065673; Fri, 26 Aug 2011 21:22: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 38A668FC08; Fri, 26 Aug 2011 21:22:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7QLMZQE071326; Fri, 26 Aug 2011 21:22:35 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7QLMZXW071323; Fri, 26 Aug 2011 21:22:35 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201108262122.p7QLMZXW071323@svn.freebsd.org> From: John Baldwin Date: Fri, 26 Aug 2011 21:22: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: r225201 - in head/sys: amd64/conf 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: Fri, 26 Aug 2011 21:22:35 -0000 Author: jhb Date: Fri Aug 26 21:22:34 2011 New Revision: 225201 URL: http://svn.freebsd.org/changeset/base/225201 Log: Enable the puc(4) driver on amd64 and i386 in GENERIC. This allows devices supported by puc(4) to work "out of the box" since puc.ko does not work "out of the box". Reviewed by: marcel Approved by: re (kib) MFC after: 1 week Modified: head/sys/amd64/conf/GENERIC head/sys/i386/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Fri Aug 26 19:44:39 2011 (r225200) +++ head/sys/amd64/conf/GENERIC Fri Aug 26 21:22:34 2011 (r225201) @@ -186,10 +186,7 @@ device plip # TCP/IP over parallel device ppi # Parallel port interface device #device vpo # Requires scbus and da -# If you've got a "dumb" serial or parallel PCI card that is -# supported by the puc(4) glue driver, uncomment the following -# line to enable it (connects to sio, uart and/or ppc drivers): -#device puc +device puc # Multi I/O cards and multi-channel UARTs # PCI Ethernet NICs. device bxe # Broadcom BCM57710/BCM57711/BCM57711E 10Gb Ethernet Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Fri Aug 26 19:44:39 2011 (r225200) +++ head/sys/i386/conf/GENERIC Fri Aug 26 21:22:34 2011 (r225201) @@ -196,10 +196,7 @@ device plip # TCP/IP over parallel device ppi # Parallel port interface device #device vpo # Requires scbus and da -# If you've got a "dumb" serial or parallel PCI card that is -# supported by the puc(4) glue driver, uncomment the following -# line to enable it (connects to sio, uart and/or ppc drivers): -#device puc +device puc # Multi I/O cards and multi-channel UARTs # PCI Ethernet NICs. device bxe # Broadcom BCM57710/BCM57711/BCM57711E 10Gb Ethernet From owner-svn-src-head@FreeBSD.ORG Fri Aug 26 21:46:37 2011 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 1ACA0106566B; Fri, 26 Aug 2011 21:46:37 +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 0863B8FC13; Fri, 26 Aug 2011 21:46:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7QLkbWl072094; Fri, 26 Aug 2011 21:46:37 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7QLkaBG072083; Fri, 26 Aug 2011 21:46:36 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201108262146.p7QLkaBG072083@svn.freebsd.org> From: Robert Watson Date: Fri, 26 Aug 2011 21:46: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: r225203 - in head/sys: dev/cfe dev/dcons dev/ofw dev/sio dev/syscons dev/uart kern pc98/cbus powerpc/mambo 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, 26 Aug 2011 21:46:37 -0000 Author: rwatson Date: Fri Aug 26 21:46:36 2011 New Revision: 225203 URL: http://svn.freebsd.org/changeset/base/225203 Log: Attempt to make break-to-debugger and alternative break-to-debugger more accessible: (1) Always compile in support for breaking into the debugger if options KDB is present in the kernel. (2) Disable both by default, but allow them to be enabled via tunables and sysctls debug.kdb.break_to_debugger and debug.kdb.alt_break_to_debugger. (3) options BREAK_TO_DEBUGGER and options ALT_BREAK_TO_DEBUGGER continue to behave as before -- only now instead of compiling in break-to-debugger support, they change the default values of the above sysctls to enable those features by default. Current kernel configurations should, therefore, continue to behave as expected. (4) Migrate alternative break-to-debugger state machine logic out of individual device drivers into centralised KDB code. This has a number of upsides, but also one downside: it's now tricky to release sio spin locks when entering the debugger, so we don't. However, similar logic does not exist in other device drivers, including uart. (5) dcons requires some special handling; unlike other console types, it allows overriding KDB's own debugger selection, so we need a new interface to KDB to allow that to work. GENERIC kernels in -CURRENT will now support break-to-debugger as long as appropriate boot/run-time options are set, which should improve the debuggability of BETA kernels significantly. MFC after: 3 weeks Reviewed by: kib, nwhitehorn Approved by: re (bz) Modified: head/sys/dev/cfe/cfe_console.c head/sys/dev/dcons/dcons_os.c head/sys/dev/ofw/ofw_console.c head/sys/dev/sio/sio.c head/sys/dev/syscons/syscons.c head/sys/dev/uart/uart_core.c head/sys/kern/subr_kdb.c head/sys/pc98/cbus/sio.c head/sys/powerpc/mambo/mambo_console.c head/sys/sys/kdb.h Modified: head/sys/dev/cfe/cfe_console.c ============================================================================== --- head/sys/dev/cfe/cfe_console.c Fri Aug 26 21:27:21 2011 (r225202) +++ head/sys/dev/cfe/cfe_console.c Fri Aug 26 21:46:36 2011 (r225203) @@ -67,7 +67,7 @@ static int polltime; static struct callout_handle cfe_timeouthandle = CALLOUT_HANDLE_INITIALIZER(&cfe_timeouthandle); -#if defined(KDB) && defined(ALT_BREAK_TO_DEBUGGER) +#if defined(KDB) static int alt_break_state; #endif @@ -191,24 +191,8 @@ cfe_cngetc(struct consdev *cp) unsigned char ch; if (cfe_read(conhandle, &ch, 1) == 1) { -#if defined(KDB) && defined(ALT_BREAK_TO_DEBUGGER) - int kdb_brk; - - if ((kdb_brk = kdb_alt_break(ch, &alt_break_state)) != 0) { - switch (kdb_brk) { - case KDB_REQ_DEBUGGER: - kdb_enter(KDB_WHY_BREAK, - "Break sequence on console"); - break; - case KDB_REQ_PANIC: - kdb_panic("Panic sequence on console"); - break; - case KDB_REQ_REBOOT: - kdb_reboot(); - break; - - } - } +#if defined(KDB) + kdb_alt_break(ch, &alt_break_state); #endif return (ch); } Modified: head/sys/dev/dcons/dcons_os.c ============================================================================== --- head/sys/dev/dcons/dcons_os.c Fri Aug 26 21:27:21 2011 (r225202) +++ head/sys/dev/dcons/dcons_os.c Fri Aug 26 21:46:36 2011 (r225203) @@ -133,38 +133,21 @@ static struct ttydevsw dcons_ttydevsw = .tsw_outwakeup = dcons_outwakeup, }; -#if (defined(GDB) || defined(DDB)) && defined(ALT_BREAK_TO_DEBUGGER) +#if (defined(GDB) || defined(DDB)) static int dcons_check_break(struct dcons_softc *dc, int c) { - int kdb_brk; if (c < 0) return (c); - if ((kdb_brk = kdb_alt_break(c, &dc->brk_state)) != 0) { - switch (kdb_brk) { - case KDB_REQ_DEBUGGER: - if ((dc->flags & DC_GDB) != 0) { #ifdef GDB - if (gdb_cur == &dcons_gdb_dbgport) { - kdb_dbbe_select("gdb"); - kdb_enter(KDB_WHY_BREAK, - "Break sequence on dcons gdb port"); - } + if ((dc->flags & DC_GDB) != 0 && gdb_cur == &dcons_gdb_dbgport) + kdb_alt_break_gdb(c, &dc->brk_state); + else #endif - } else - kdb_enter(KDB_WHY_BREAK, - "Break sequence on dcons console port"); - break; - case KDB_REQ_PANIC: - kdb_panic("Panic sequence on dcons console port"); - break; - case KDB_REQ_REBOOT: - kdb_reboot(); - break; - } - } + kdb_alt_break(c, &dc->brk_state); + return (c); } #else Modified: head/sys/dev/ofw/ofw_console.c ============================================================================== --- head/sys/dev/ofw/ofw_console.c Fri Aug 26 21:27:21 2011 (r225202) +++ head/sys/dev/ofw/ofw_console.c Fri Aug 26 21:46:36 2011 (r225203) @@ -64,7 +64,7 @@ static int polltime; static struct callout_handle ofw_timeouthandle = CALLOUT_HANDLE_INITIALIZER(&ofw_timeouthandle); -#if defined(KDB) && defined(ALT_BREAK_TO_DEBUGGER) +#if defined(KDB) static int alt_break_state; #endif @@ -199,24 +199,8 @@ ofw_cngetc(struct consdev *cp) unsigned char ch; if (OF_read(stdin, &ch, 1) > 0) { -#if defined(KDB) && defined(ALT_BREAK_TO_DEBUGGER) - int kdb_brk; - - if ((kdb_brk = kdb_alt_break(ch, &alt_break_state)) != 0) { - switch (kdb_brk) { - case KDB_REQ_DEBUGGER: - kdb_enter(KDB_WHY_BREAK, - "Break sequence on console"); - break; - case KDB_REQ_PANIC: - kdb_panic("Panic sequence on console"); - break; - case KDB_REQ_REBOOT: - kdb_reboot(); - break; - - } - } +#if defined(KDB) + kdb_alt_break(ch, &alt_break_state); #endif return (ch); } Modified: head/sys/dev/sio/sio.c ============================================================================== --- head/sys/dev/sio/sio.c Fri Aug 26 21:27:21 2011 (r225202) +++ head/sys/dev/sio/sio.c Fri Aug 26 21:46:36 2011 (r225203) @@ -228,7 +228,7 @@ struct com_s { struct pps_state pps; int pps_bit; -#ifdef ALT_BREAK_TO_DEBUGGER +#ifdef KDB int alt_brk_state; #endif @@ -1102,8 +1102,7 @@ determined_type: ; } if (ret) device_printf(dev, "could not activate interrupt\n"); -#if defined(KDB) && (defined(BREAK_TO_DEBUGGER) || \ - defined(ALT_BREAK_TO_DEBUGGER)) +#if defined(KDB) /* * Enable interrupts for early break-to-debugger support * on the console. @@ -1196,8 +1195,7 @@ comclose(tp) com->poll_output = FALSE; sio_setreg(com, com_cfcr, com->cfcr_image &= ~CFCR_SBREAK); -#if defined(KDB) && (defined(BREAK_TO_DEBUGGER) || \ - defined(ALT_BREAK_TO_DEBUGGER)) +#if defined(KDB) /* * Leave interrupts enabled and don't clear DTR if this is the * console. This allows us to detect break-to-debugger events @@ -1483,9 +1481,8 @@ siointr1(com) u_char modem_status; u_char *ioptr; u_char recv_data; -#if defined(KDB) && defined(ALT_BREAK_TO_DEBUGGER) - int kdb_brk; +#ifdef KDB again: #endif @@ -1518,27 +1515,9 @@ again: else recv_data = inb(com->data_port); #ifdef KDB -#ifdef ALT_BREAK_TO_DEBUGGER if (com->unit == comconsole && - (kdb_brk = kdb_alt_break(recv_data, - &com->alt_brk_state)) != 0) { - mtx_unlock_spin(&sio_lock); - switch (kdb_brk) { - case KDB_REQ_DEBUGGER: - kdb_enter(KDB_WHY_BREAK, - "Break sequence on console"); - break; - case KDB_REQ_PANIC: - kdb_panic("panic on console"); - break; - case KDB_REQ_REBOOT: - kdb_reboot(); - break; - } - mtx_lock_spin(&sio_lock); + kdb_alt_break(recv_data, &com->alt_brk_state) != 0) goto again; - } -#endif /* ALT_BREAK_TO_DEBUGGER */ #endif /* KDB */ if (line_status & (LSR_BI | LSR_FE | LSR_PE)) { /* @@ -1554,10 +1533,9 @@ again: * Note: BI together with FE/PE means just BI. */ if (line_status & LSR_BI) { -#if defined(KDB) && defined(BREAK_TO_DEBUGGER) +#if defined(KDB) if (com->unit == comconsole) { - kdb_enter(KDB_WHY_BREAK, - "Line break on console"); + kdb_break(); goto cont; } #endif Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Fri Aug 26 21:27:21 2011 (r225202) +++ head/sys/dev/syscons/syscons.c Fri Aug 26 21:46:36 2011 (r225203) @@ -3514,7 +3514,7 @@ next_code: case DBG: #ifndef SC_DISABLE_KDBKEY if (enable_kdbkey) - kdb_enter(KDB_WHY_BREAK, "manual escape to debugger"); + kdb_break(); #endif break; Modified: head/sys/dev/uart/uart_core.c ============================================================================== --- head/sys/dev/uart/uart_core.c Fri Aug 26 21:27:21 2011 (r225202) +++ head/sys/dev/uart/uart_core.c Fri Aug 26 21:46:36 2011 (r225203) @@ -118,10 +118,10 @@ uart_intr_break(void *arg) { struct uart_softc *sc = arg; -#if defined(KDB) && defined(BREAK_TO_DEBUGGER) +#if defined(KDB) if (sc->sc_sysdev != NULL && sc->sc_sysdev->type == UART_DEV_CONSOLE) { - kdb_enter(KDB_WHY_BREAK, "Line break on console"); - return (0); + if (kdb_break()) + return (0); } #endif if (sc->sc_opened) @@ -170,26 +170,10 @@ uart_intr_rxready(void *arg) rxp = sc->sc_rxput; UART_RECEIVE(sc); -#if defined(KDB) && defined(ALT_BREAK_TO_DEBUGGER) +#if defined(KDB) if (sc->sc_sysdev != NULL && sc->sc_sysdev->type == UART_DEV_CONSOLE) { while (rxp != sc->sc_rxput) { - int kdb_brk; - - if ((kdb_brk = kdb_alt_break(sc->sc_rxbuf[rxp++], - &sc->sc_altbrk)) != 0) { - switch (kdb_brk) { - case KDB_REQ_DEBUGGER: - kdb_enter(KDB_WHY_BREAK, - "Break sequence on console"); - break; - case KDB_REQ_PANIC: - kdb_panic("Panic sequence on console"); - break; - case KDB_REQ_REBOOT: - kdb_reboot(); - break; - } - } + kdb_alt_break(sc->sc_rxbuf[rxp++], &sc->sc_altbrk); if (rxp == sc->sc_rxbufsz) rxp = 0; } Modified: head/sys/kern/subr_kdb.c ============================================================================== --- head/sys/kern/subr_kdb.c Fri Aug 26 21:27:21 2011 (r225202) +++ head/sys/kern/subr_kdb.c Fri Aug 26 21:46:36 2011 (r225203) @@ -57,6 +57,21 @@ struct pcb *kdb_thrctx = NULL; struct thread *kdb_thread = NULL; struct trapframe *kdb_frame = NULL; +#ifdef BREAK_TO_DEBUGGER +#define KDB_BREAK_TO_DEBUGGER 1 +#else +#define KDB_BREAK_TO_DEBUGGER 0 +#endif + +#ifdef ALT_BREAK_TO_DEBUGGER +#define KDB_ALT_BREAK_TO_DEBUGGER 1 +#else +#define KDB_ALT_BREAK_TO_DEBUGGER 0 +#endif + +static int kdb_break_to_debugger = KDB_BREAK_TO_DEBUGGER; +static int kdb_alt_break_to_debugger = KDB_ALT_BREAK_TO_DEBUGGER; + KDB_BACKEND(null, NULL, NULL, NULL); SET_DECLARE(kdb_dbbe_set, struct kdb_dbbe); @@ -87,6 +102,15 @@ SYSCTL_PROC(_debug_kdb, OID_AUTO, trap, SYSCTL_PROC(_debug_kdb, OID_AUTO, trap_code, CTLTYPE_INT | CTLFLAG_RW, NULL, 0, kdb_sysctl_trap_code, "I", "set to cause a page fault via code access"); +SYSCTL_INT(_debug_kdb, OID_AUTO, break_to_debugger, CTLTYPE_INT | CTLFLAG_RW | + CTLFLAG_TUN, &kdb_break_to_debugger, 0, "Enable break to debugger"); +TUNABLE_INT("debug.kdb.break_to_debugger", &kdb_break_to_debugger); + +SYSCTL_INT(_debug_kdb, OID_AUTO, alt_break_to_debugger, CTLTYPE_INT | + CTLFLAG_RW | CTLFLAG_TUN, &kdb_alt_break_to_debugger, 0, + "Enable alternative break to debugger"); +TUNABLE_INT("debug.kdb.alt_break_to_debugger", &kdb_alt_break_to_debugger); + /* * Flag to indicate to debuggers why the debugger was entered. */ @@ -241,7 +265,17 @@ enum { }; int -kdb_alt_break(int key, int *state) +kdb_break(void) +{ + + if (!kdb_break_to_debugger) + return (0); + kdb_enter(KDB_WHY_BREAK, "Break to debugger"); + return (KDB_REQ_DEBUGGER); +} + +static int +kdb_alt_break_state(int key, int *state) { int brk; @@ -275,6 +309,53 @@ kdb_alt_break(int key, int *state) return (brk); } +static int +kdb_alt_break_internal(int key, int *state, int force_gdb) +{ + int brk; + + if (!kdb_alt_break_to_debugger) + return (0); + brk = kdb_alt_break_state(key, state); + switch (brk) { + case KDB_REQ_DEBUGGER: + if (force_gdb) + kdb_dbbe_select("gdb"); + kdb_enter(KDB_WHY_BREAK, "Break to debugger"); + break; + + case KDB_REQ_PANIC: + if (force_gdb) + kdb_dbbe_select("gdb"); + kdb_panic("Panic sequence on console"); + break; + + case KDB_REQ_REBOOT: + kdb_reboot(); + break; + } + return (0); +} + +int +kdb_alt_break(int key, int *state) +{ + + return (kdb_alt_break_internal(key, state, 0)); +} + +/* + * This variation on kdb_alt_break() is used only by dcons, which has its own + * configuration flag to force GDB use regardless of the global KDB + * configuration. + */ +int +kdb_alt_break_gdb(int key, int *state) +{ + + return (kdb_alt_break_internal(key, state, 1)); +} + /* * Print a backtrace of the calling thread. The backtrace is generated by * the selected debugger, provided it supports backtraces. If no debugger Modified: head/sys/pc98/cbus/sio.c ============================================================================== --- head/sys/pc98/cbus/sio.c Fri Aug 26 21:27:21 2011 (r225202) +++ head/sys/pc98/cbus/sio.c Fri Aug 26 21:46:36 2011 (r225203) @@ -310,7 +310,7 @@ struct com_s { struct pps_state pps; int pps_bit; -#ifdef ALT_BREAK_TO_DEBUGGER +#ifdef KDB int alt_brk_state; #endif @@ -1752,8 +1752,7 @@ determined_type: ; } if (ret) device_printf(dev, "could not activate interrupt\n"); -#if defined(KDB) && (defined(BREAK_TO_DEBUGGER) || \ - defined(ALT_BREAK_TO_DEBUGGER)) +#if defined(KDB) /* * Enable interrupts for early break-to-debugger support * on the console. @@ -1896,8 +1895,7 @@ comclose(tp) sio_setreg(com, com_cfcr, com->cfcr_image &= ~CFCR_SBREAK); #endif -#if defined(KDB) && (defined(BREAK_TO_DEBUGGER) || \ - defined(ALT_BREAK_TO_DEBUGGER)) +#if defined(KDB) /* * Leave interrupts enabled and don't clear DTR if this is the * console. This allows us to detect break-to-debugger events @@ -2272,7 +2270,7 @@ siointr1(com) u_char rsa_buf_status = 0; int rsa_tx_fifo_size = 0; #endif /* PC98 */ -#if defined(KDB) && defined(ALT_BREAK_TO_DEBUGGER) +#if defined(KDB) int kdb_brk; again: @@ -2369,27 +2367,11 @@ more_intr: else recv_data = inb(com->data_port); #ifdef KDB -#ifdef ALT_BREAK_TO_DEBUGGER if (com->unit == comconsole && (kdb_brk = kdb_alt_break(recv_data, &com->alt_brk_state)) != 0) { - mtx_unlock_spin(&sio_lock); - switch (kdb_brk) { - case KDB_REQ_DEBUGGER: - kdb_enter(KDB_WHY_BREAK, - "Break sequence on console"); - break; - case KDB_REQ_PANIC: - kdb_panic("panic on console"); - break; - case KDB_REQ_REBOOT: - kdb_reboot(); - break; - } - mtx_lock_spin(&sio_lock); goto again; } -#endif /* ALT_BREAK_TO_DEBUGGER */ #endif /* KDB */ if (line_status & (LSR_BI | LSR_FE | LSR_PE)) { /* @@ -2405,7 +2387,7 @@ more_intr: * Note: BI together with FE/PE means just BI. */ if (line_status & LSR_BI) { -#if defined(KDB) && defined(BREAK_TO_DEBUGGER) +#if defined(KDB) if (com->unit == comconsole) { kdb_enter(KDB_WHY_BREAK, "Line break on console"); Modified: head/sys/powerpc/mambo/mambo_console.c ============================================================================== --- head/sys/powerpc/mambo/mambo_console.c Fri Aug 26 21:27:21 2011 (r225202) +++ head/sys/powerpc/mambo/mambo_console.c Fri Aug 26 21:46:36 2011 (r225203) @@ -60,7 +60,7 @@ static int polltime; static struct callout mambo_callout; static struct tty *tp = NULL; -#if defined(KDB) && defined(ALT_BREAK_TO_DEBUGGER) +#if defined(KDB) static int alt_break_state; #endif @@ -156,24 +156,8 @@ mambo_cngetc(struct consdev *cp) ch = mambocall(MAMBO_CONSOLE_READ); if (ch > 0 && ch < 0xff) { -#if defined(KDB) && defined(ALT_BREAK_TO_DEBUGGER) - int kdb_brk; - - if ((kdb_brk = kdb_alt_break(ch, &alt_break_state)) != 0) { - switch (kdb_brk) { - case KDB_REQ_DEBUGGER: - kdb_enter(KDB_WHY_BREAK, - "Break sequence on console"); - break; - case KDB_REQ_PANIC: - kdb_panic("Panic sequence on console"); - break; - case KDB_REQ_REBOOT: - kdb_reboot(); - break; - - } - } +#if defined(KDB) + kdb_alt_break(ch, &alt_break_state); #endif return (ch); } Modified: head/sys/sys/kdb.h ============================================================================== --- head/sys/sys/kdb.h Fri Aug 26 21:27:21 2011 (r225202) +++ head/sys/sys/kdb.h Fri Aug 26 21:46:36 2011 (r225203) @@ -64,6 +64,8 @@ extern struct pcb *kdb_thrctx; /* Curre extern struct thread *kdb_thread; /* Current thread. */ int kdb_alt_break(int, int *); +int kdb_alt_break_gdb(int, int *); +int kdb_break(void); void kdb_backtrace(void); int kdb_dbbe_select(const char *); void kdb_enter(const char *, const char *); From owner-svn-src-head@FreeBSD.ORG Sat Aug 27 00:34:28 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id CD27F106566B; Sat, 27 Aug 2011 00:34:28 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-198-245.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 898D214E1F8; Sat, 27 Aug 2011 00:34:27 +0000 (UTC) Message-ID: <4E583B92.3060100@FreeBSD.org> Date: Fri, 26 Aug 2011 17:34:26 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:6.0) Gecko/20110824 Thunderbird/6.0 MIME-Version: 1.0 To: John Baldwin References: <201108262122.p7QLMZXW071323@svn.freebsd.org> In-Reply-To: <201108262122.p7QLMZXW071323@svn.freebsd.org> X-Enigmail-Version: undefined OpenPGP: id=1A1ABC84 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: r225201 - in head/sys: amd64/conf 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: Sat, 27 Aug 2011 00:34:28 -0000 Sorry, I am not parsing this. Are you saying that the module is broken? Doug On 08/26/2011 14:22, John Baldwin wrote: > Author: jhb > Date: Fri Aug 26 21:22:34 2011 > New Revision: 225201 > URL: http://svn.freebsd.org/changeset/base/225201 > > Log: > Enable the puc(4) driver on amd64 and i386 in GENERIC. This allows > devices supported by puc(4) to work "out of the box" since puc.ko does > not work "out of the box". > > Reviewed by: marcel > Approved by: re (kib) > MFC after: 1 week > > Modified: > head/sys/amd64/conf/GENERIC > head/sys/i386/conf/GENERIC > > Modified: head/sys/amd64/conf/GENERIC > ============================================================================== > --- head/sys/amd64/conf/GENERIC Fri Aug 26 19:44:39 2011 (r225200) > +++ head/sys/amd64/conf/GENERIC Fri Aug 26 21:22:34 2011 (r225201) > @@ -186,10 +186,7 @@ device plip # TCP/IP over parallel > device ppi # Parallel port interface device > #device vpo # Requires scbus and da > > -# If you've got a "dumb" serial or parallel PCI card that is > -# supported by the puc(4) glue driver, uncomment the following > -# line to enable it (connects to sio, uart and/or ppc drivers): > -#device puc > +device puc # Multi I/O cards and multi-channel UARTs > > # PCI Ethernet NICs. > device bxe # Broadcom BCM57710/BCM57711/BCM57711E 10Gb Ethernet > > Modified: head/sys/i386/conf/GENERIC > ============================================================================== > --- head/sys/i386/conf/GENERIC Fri Aug 26 19:44:39 2011 (r225200) > +++ head/sys/i386/conf/GENERIC Fri Aug 26 21:22:34 2011 (r225201) > @@ -196,10 +196,7 @@ device plip # TCP/IP over parallel > device ppi # Parallel port interface device > #device vpo # Requires scbus and da > > -# If you've got a "dumb" serial or parallel PCI card that is > -# supported by the puc(4) glue driver, uncomment the following > -# line to enable it (connects to sio, uart and/or ppc drivers): > -#device puc > +device puc # Multi I/O cards and multi-channel UARTs > > # PCI Ethernet NICs. > device bxe # Broadcom BCM57710/BCM57711/BCM57711E 10Gb Ethernet > -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Sat Aug 27 08:10:54 2011 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 AB3F0106566B; Sat, 27 Aug 2011 08:10:54 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) by mx1.freebsd.org (Postfix) with ESMTP id 6057F8FC14; Sat, 27 Aug 2011 08:10:53 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1QxDyp-000G0h-V3; Sat, 27 Aug 2011 12:11:03 +0400 Date: Sat, 27 Aug 2011 12:11:03 +0400 From: Slawa Olhovchenkov To: Doug Barton Message-ID: <20110827081103.GB21676@zxy.spb.ru> References: <201108262122.p7QLMZXW071323@svn.freebsd.org> <4E583B92.3060100@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4E583B92.3060100@FreeBSD.org> User-Agent: Mutt/1.5.20 (2009-06-14) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r225201 - in head/sys: amd64/conf 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: Sat, 27 Aug 2011 08:10:54 -0000 On Fri, Aug 26, 2011 at 05:34:26PM -0700, Doug Barton wrote: > Sorry, I am not parsing this. Are you saying that the module is broken? Yes, from FreeBSD 6.x puc.ko don't work. Only in-kernel version work. > > On 08/26/2011 14:22, John Baldwin wrote: > > Author: jhb > > Date: Fri Aug 26 21:22:34 2011 > > New Revision: 225201 > > URL: http://svn.freebsd.org/changeset/base/225201 > > > > Log: > > Enable the puc(4) driver on amd64 and i386 in GENERIC. This allows > > devices supported by puc(4) to work "out of the box" since puc.ko does > > not work "out of the box". > > > > Reviewed by: marcel > > Approved by: re (kib) > > MFC after: 1 week > > > > Modified: > > head/sys/amd64/conf/GENERIC > > head/sys/i386/conf/GENERIC > > > > Modified: head/sys/amd64/conf/GENERIC > > ============================================================================== > > --- head/sys/amd64/conf/GENERIC Fri Aug 26 19:44:39 2011 (r225200) > > +++ head/sys/amd64/conf/GENERIC Fri Aug 26 21:22:34 2011 (r225201) > > @@ -186,10 +186,7 @@ device plip # TCP/IP over parallel > > device ppi # Parallel port interface device > > #device vpo # Requires scbus and da > > > > -# If you've got a "dumb" serial or parallel PCI card that is > > -# supported by the puc(4) glue driver, uncomment the following > > -# line to enable it (connects to sio, uart and/or ppc drivers): > > -#device puc > > +device puc # Multi I/O cards and multi-channel UARTs > > > > # PCI Ethernet NICs. > > device bxe # Broadcom BCM57710/BCM57711/BCM57711E 10Gb Ethernet > > > > Modified: head/sys/i386/conf/GENERIC > > ============================================================================== > > --- head/sys/i386/conf/GENERIC Fri Aug 26 19:44:39 2011 (r225200) > > +++ head/sys/i386/conf/GENERIC Fri Aug 26 21:22:34 2011 (r225201) > > @@ -196,10 +196,7 @@ device plip # TCP/IP over parallel > > device ppi # Parallel port interface device > > #device vpo # Requires scbus and da > > > > -# If you've got a "dumb" serial or parallel PCI card that is > > -# supported by the puc(4) glue driver, uncomment the following > > -# line to enable it (connects to sio, uart and/or ppc drivers): > > -#device puc > > +device puc # Multi I/O cards and multi-channel UARTs > > > > # PCI Ethernet NICs. > > device bxe # Broadcom BCM57710/BCM57711/BCM57711E 10Gb Ethernet > > > > > > -- > > Nothin' ever doesn't change, but nothin' changes much. > -- OK Go > > Breadth of IT experience, and depth of knowledge in the DNS. > Yours for the right price. :) http://SupersetSolutions.com/ > > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-head@FreeBSD.ORG Sat Aug 27 08:45:28 2011 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 2DEE41065672; Sat, 27 Aug 2011 08:45:28 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-qy0-f175.google.com (mail-qy0-f175.google.com [209.85.216.175]) by mx1.freebsd.org (Postfix) with ESMTP id A38048FC1C; Sat, 27 Aug 2011 08:45:27 +0000 (UTC) Received: by qyk4 with SMTP id 4so971834qyk.13 for ; Sat, 27 Aug 2011 01:45:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=1vezaSUOBjHsnkM8zjTkuFjqIA7rheoxg85dywP+Vww=; b=wKdbXP/fdkCP2rSCt0ggsQBsZ5v6l2y+jCHKLdM+HrB/qtaKuTOPjTC+JZLzugrwUk YKLmfGyZl+eUYNycRRXdADYsjxd4HL2UcnSd6zXaQkj7pUOOILLV1MrCeuGMG060mKRS skMf58wVwVtTKWQfbRSTPPzjh2KbjJeTuh7lE= MIME-Version: 1.0 Received: by 10.229.1.227 with SMTP id 35mr2770843qcg.6.1314433269477; Sat, 27 Aug 2011 01:21:09 -0700 (PDT) Received: by 10.229.101.209 with HTTP; Sat, 27 Aug 2011 01:21:09 -0700 (PDT) In-Reply-To: <201108262146.p7QLkaBG072083@svn.freebsd.org> References: <201108262146.p7QLkaBG072083@svn.freebsd.org> Date: Sat, 27 Aug 2011 01:21:09 -0700 Message-ID: From: Navdeep Parhar To: Robert Watson Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r225203 - in head/sys: dev/cfe dev/dcons dev/ofw dev/sio dev/syscons dev/uart kern pc98/cbus powerpc/mambo 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: Sat, 27 Aug 2011 08:45:28 -0000 On Fri, Aug 26, 2011 at 2:46 PM, Robert Watson wrote: > Author: rwatson > Date: Fri Aug 26 21:46:36 2011 > New Revision: 225203 > URL: http://svn.freebsd.org/changeset/base/225203 > > Log: > =A0Attempt to make break-to-debugger and alternative break-to-debugger mo= re > =A0accessible: > > =A0(1) Always compile in support for breaking into the debugger if option= s > =A0 =A0 =A0KDB is present in the kernel. > > =A0(2) Disable both by default, but allow them to be enabled via tunables > =A0 =A0 =A0and sysctls debug.kdb.break_to_debugger and > =A0 =A0 =A0debug.kdb.alt_break_to_debugger. > > =A0(3) options BREAK_TO_DEBUGGER and options ALT_BREAK_TO_DEBUGGER contin= ue > =A0 =A0 =A0to behave as before -- only now instead of compiling in > =A0 =A0 =A0break-to-debugger support, they change the default values of t= he > =A0 =A0 =A0above sysctls to enable those features by default. =A0Current = kernel > =A0 =A0 =A0configurations should, therefore, continue to behave as expect= ed. Shouldn't opt_comconsole.h be included in subr_kdb.c for this part to actually work? Navdeep From owner-svn-src-head@FreeBSD.ORG Sat Aug 27 08:49:55 2011 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 D7A23106566B; Sat, 27 Aug 2011 08:49:55 +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 C72468FC12; Sat, 27 Aug 2011 08:49:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7R8ntgF092027; Sat, 27 Aug 2011 08:49:55 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7R8ntHd092024; Sat, 27 Aug 2011 08:49:55 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201108270849.p7R8ntHd092024@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 27 Aug 2011 08:49: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: r225209 - 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: Sat, 27 Aug 2011 08:49:55 -0000 Author: bz Date: Sat Aug 27 08:49:55 2011 New Revision: 225209 URL: http://svn.freebsd.org/changeset/base/225209 Log: When adding IPv6 fwd support to ipfw in r225044 these two files were not committed. Initialize next_hop6 to align with the IPv4 code. PR: bin/117214 MFC after: 3 weeks X-MFC with: r225044 Approved by: re (kib) Modified: head/sys/net/if_bridge.c head/sys/net/if_ethersubr.c Modified: head/sys/net/if_bridge.c ============================================================================== --- head/sys/net/if_bridge.c Sat Aug 27 06:54:08 2011 (r225208) +++ head/sys/net/if_bridge.c Sat Aug 27 08:49:55 2011 (r225209) @@ -3083,6 +3083,7 @@ bridge_pfil(struct mbuf **mp, struct ifn args.m = *mp; args.oif = ifp; args.next_hop = NULL; + args.next_hop6 = NULL; args.eh = &eh2; args.inp = NULL; /* used by ipfw uid/gid/jail rules */ i = V_ip_fw_chk_ptr(&args); Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Sat Aug 27 06:54:08 2011 (r225208) +++ head/sys/net/if_ethersubr.c Sat Aug 27 08:49:55 2011 (r225209) @@ -499,6 +499,7 @@ ether_ipfw_chk(struct mbuf **m0, struct args.m = m; /* the packet we are looking at */ args.oif = dst; /* destination, if any */ args.next_hop = NULL; /* we do not support forward yet */ + args.next_hop6 = NULL; /* we do not support forward yet */ args.eh = &save_eh; /* MAC header for bridged/MAC packets */ args.inp = NULL; /* used by ipfw uid/gid/jail rules */ i = V_ip_fw_chk_ptr(&args); From owner-svn-src-head@FreeBSD.ORG Sat Aug 27 09:00:05 2011 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 CDCE11065674; Sat, 27 Aug 2011 09:00:03 +0000 (UTC) (envelope-from emss.mail@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 955E88FC08; Sat, 27 Aug 2011 09:00:02 +0000 (UTC) Received: by wwi36 with SMTP id 36so4246840wwi.31 for ; Sat, 27 Aug 2011 02:00:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:x-virus-scanned:to:cc:subject:from:in-reply-to:references :x-operating-system:date:message-id:user-agent:mime-version :content-type:content-transfer-encoding; bh=Y5mtRR6G6fIxQbMAS0fFFJvI+gyDzVlh4x3juzxoAZw=; b=OmUPexWa407AdX3D8h2FLmCogGwoBZBa4HNM4TU77Ued8xeVvy1cKOuSNWzVP4wdQY 6rs1jucxnbLEI+WXNSVYh/fp42upVeKml190uKqdgfw80qiS6O9Ud/jOTaDxahXLdfDX hQtse21S4BLP8dVzik6IUuQi2KO4wOAJs9BXo= Received: by 10.216.177.68 with SMTP id c46mr1688153wem.98.1314434126154; Sat, 27 Aug 2011 01:35:26 -0700 (PDT) Received: from srvbsdfenssv.interne.associated-bears.org (LCaen-151-92-21-48.w217-128.abo.wanadoo.fr [217.128.200.48]) by mx.google.com with ESMTPS id h62sm1516285wee.32.2011.08.27.01.35.21 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 27 Aug 2011 01:35:24 -0700 (PDT) Sender: Eric Masson Received: from srvbsdfenssv.interne.associated-bears.org (localhost [127.0.0.1]) by srvbsdfenssv.interne.associated-bears.org (Postfix) with ESMTP id 08193CF20B; Sat, 27 Aug 2011 10:35:20 +0200 (CEST) X-Virus-Scanned: amavisd-new at interne.associated-bears.org Received: from srvbsdfenssv.interne.associated-bears.org ([127.0.0.1]) by srvbsdfenssv.interne.associated-bears.org (srvbsdfenssv.interne.associated-bears.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iggJBJ09fsos; Sat, 27 Aug 2011 10:35:16 +0200 (CEST) Received: by srvbsdfenssv.interne.associated-bears.org (Postfix, from userid 1001) id C2FCCCF0F6; Sat, 27 Aug 2011 10:35:16 +0200 (CEST) To: Slawa Olhovchenkov From: Eric Masson In-Reply-To: <20110827081103.GB21676@zxy.spb.ru> (Slawa Olhovchenkov's message of "Sat, 27 Aug 2011 12:11:03 +0400") References: <201108262122.p7QLMZXW071323@svn.freebsd.org> <4E583B92.3060100@FreeBSD.org> <20110827081103.GB21676@zxy.spb.ru> X-Operating-System: FreeBSD 8.2-RELEASE-p2 amd64 Date: Sat, 27 Aug 2011 10:35:16 +0200 Message-ID: <86obzbi75n.fsf@srvbsdfenssv.interne.associated-bears.org> User-Agent: Gnus/5.1008 (Gnus v5.10.8) XEmacs/21.5-b28 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Doug Barton , src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r225201 - in head/sys: amd64/conf 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: Sat, 27 Aug 2011 09:00:05 -0000 Slawa Olhovchenkov writes: Hello, > Yes, from FreeBSD 6.x puc.ko don't work. Only in-kernel version work. Nope puc.ko module can't attach drivers compiled in kernel, but if both puc & uart are loaded as modules, they work fine : emss@srvbsdfenssv:~> uname -mr 8.2-RELEASE-p2 amd64 emss@srvbsdfenssv:~> kldstat Id Refs Address Size Name 1 149 0xffffffff80100000 777090 kernel 2 2 0xffffffff80878000 8580 procfs.ko 3 3 0xffffffff80881000 94e0 pseudofs.ko 4 1 0xffffffff8088b000 bc28 geom_label.ko 5 2 0xffffffff80897000 4d110 pf.ko 6 1 0xffffffff808e5000 fef8 if_nfe.ko 7 2 0xffffffff808f5000 3dc80 miibus.ko 8 1 0xffffffff80933000 24d78 snd_hda.ko 9 2 0xffffffff80958000 757c8 sound.ko 10 1 0xffffffff809ce000 8ce8 umass.ko 11 7 0xffffffff809d7000 356f0 usb.ko 12 3 0xffffffff80a0d000 820c8 cam.ko 13 1 0xffffffff80a90000 f060 aio.ko 14 1 0xffffffff80aa0000 15e0 accf_http.ko 15 1 0xffffffff80aa2000 a6a8 puc.ko 16 1 0xffffffff80aad000 27d0 amdtemp.ko 17 1 0xffffffff80ab0000 10078 ahci.ko 18 1 0xffffffff80ac1000 18510 uart.ko 19 1 0xffffffff80ada000 8c70 ppc.ko 20 3 0xffffffff80ae3000 9948 ppbus.ko 21 1 0xffffffff80aed000 47e0 lpt.ko 22 1 0xffffffff80af2000 9ff8 ohci.ko 23 1 0xffffffff80afc000 d288 ehci.ko 24 1 0xffffffff80b0a000 38a8 uftdi.ko 25 2 0xffffffff80b0e000 5688 ucom.ko 26 1 0xffffffff80b14000 2450 pflog.ko 27 1 0xffffffff80b17000 4a30 cryptodev.ko 28 2 0xffffffff80b1c000 2fb70 crypto.ko 29 3 0xffffffff80b4c000 dc00 zlib.ko 30 1 0xffffffff80b5a000 4cc0 nfsmb.ko 31 3 0xffffffff80b5f000 24c0 smbus.ko 32 1 0xffffffff80b62000 2d28 smb.ko 33 1 0xffffffff80b65000 82e8 ng_ubt.ko 34 3 0xffffffff80b6e000 14de8 netgraph.ko 35 2 0xffffffff80b83000 12fc0 ng_hci.ko 36 2 0xffffffff80b96000 2da0 ng_bluetooth.ko 37 1 0xffffffff80c22000 3e80 linprocfs.ko 38 1 0xffffffff80c26000 1cf64 linux.ko emss@srvbsdfenssv:~> dmesg | grep puc puc0: port 0xd480-0xd49f,0xd400-0xd41f mem 0xfcffe000-0xfcffefff,0xfcffd000-0xfcffdfff irq 18 at device 7.0 on pci1 puc0: [FILTER] uart2: <16550 or compatible> on puc0 uart3: <16550 or compatible> on puc0 uart4: <16550 or compatible> on puc0 uart5: <16550 or compatible> on puc0 So including puc in GENERIC is the only solution as uart & ppc are already in. The other way could be to ship a stripped down GENERIC kernel and load modules manually or automagically (devd ?) Regards Éric Masson -- > Subject: pb fvwm95-2 comment l'installer le compiler??? > Merci d'avance je te conseille d'être un peu plus précis dans l'exposé de ton pb... -+- EJ in guide du linuxien pervers :"Les modéros sont sympas !" -+- From owner-svn-src-head@FreeBSD.ORG Sat Aug 27 10:01:37 2011 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 4B7651065673; Sat, 27 Aug 2011 10:01:37 +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 247048FC08; Sat, 27 Aug 2011 10:01:37 +0000 (UTC) Received: from [192.168.2.112] (host81-151-180-177.range81-151.btcentralplus.com [81.151.180.177]) by cyrus.watson.org (Postfix) with ESMTPSA id 95EAE46B06; Sat, 27 Aug 2011 06:01:35 -0400 (EDT) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Robert N. M. Watson" In-Reply-To: Date: Sat, 27 Aug 2011 11:01:34 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <2BCF41D5-3C69-4D35-B56E-D1D84BC8DD89@freebsd.org> References: <201108262146.p7QLkaBG072083@svn.freebsd.org> To: Navdeep Parhar X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r225203 - in head/sys: dev/cfe dev/dcons dev/ofw dev/sio dev/syscons dev/uart kern pc98/cbus powerpc/mambo 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: Sat, 27 Aug 2011 10:01:37 -0000 On 27 Aug 2011, at 09:21, Navdeep Parhar wrote: >> (3) options BREAK_TO_DEBUGGER and options ALT_BREAK_TO_DEBUGGER = continue >> to behave as before -- only now instead of compiling in >> break-to-debugger support, they change the default values of the >> above sysctls to enable those features by default. Current = kernel >> configurations should, therefore, continue to behave as = expected. >=20 > Shouldn't opt_comconsole.h be included in subr_kdb.c for this part to > actually work? Yes, you're right. We should almost certainly garbage collect opt_comconsole.h entirely at = this point, moving the break options into opt_kdb.h as well. It also = looks like I missed one of the ARM uart implementations during my walk = of the tree as well. I'll send a follow-up patch to re@ today to refine = this change further. (The dcons Makefile also does something odd, in that it sets #define KDB = in its own opt_kdb.h when built independently of the kernel, but = actually, that's now #define KDB goes for the base kernel -- it goes in = opt_global.h. I'll need to ponder what the right thing to do there is, = and whether it's worth fixing at this point.) Robert= From owner-svn-src-head@FreeBSD.ORG Sat Aug 27 10:53:32 2011 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 679E11065672; Sat, 27 Aug 2011 10:53:32 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) by mx1.freebsd.org (Postfix) with ESMTP id BE1068FC15; Sat, 27 Aug 2011 10:53:31 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1QxGWE-000HJu-Id; Sat, 27 Aug 2011 14:53:42 +0400 Date: Sat, 27 Aug 2011 14:53:42 +0400 From: Slawa Olhovchenkov To: Eric Masson Message-ID: <20110827105342.GC21676@zxy.spb.ru> References: <201108262122.p7QLMZXW071323@svn.freebsd.org> <4E583B92.3060100@FreeBSD.org> <20110827081103.GB21676@zxy.spb.ru> <86obzbi75n.fsf@srvbsdfenssv.interne.associated-bears.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <86obzbi75n.fsf@srvbsdfenssv.interne.associated-bears.org> User-Agent: Mutt/1.5.20 (2009-06-14) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Doug Barton , src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r225201 - in head/sys: amd64/conf 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: Sat, 27 Aug 2011 10:53:32 -0000 On Sat, Aug 27, 2011 at 10:35:16AM +0200, Eric Masson wrote: > Slawa Olhovchenkov writes: > > Hello, > > > Yes, from FreeBSD 6.x puc.ko don't work. Only in-kernel version work. > > Nope puc.ko module can't attach drivers compiled in kernel, but if both > puc & uart are loaded as modules, they work fine : > The other way could be to ship a stripped down GENERIC kernel and load > modules manually or automagically (devd ?) > Regards May be for fist step: w/o devd, simle remove all posible from GENERIC and include all removed drivers in /boot/loader.conf? From owner-svn-src-head@FreeBSD.ORG Sat Aug 27 11:45:29 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 99B20106564A; Sat, 27 Aug 2011 11:45:29 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from [127.0.0.1] (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 6FD3714F9C1; Sat, 27 Aug 2011 11:45:29 +0000 (UTC) Message-ID: <4E58D8E8.3090603@FreeBSD.org> Date: Sat, 27 Aug 2011 04:45:44 -0700 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:6.0) Gecko/20110812 Thunderbird/6.0 MIME-Version: 1.0 To: Slawa Olhovchenkov References: <201108262122.p7QLMZXW071323@svn.freebsd.org> <4E583B92.3060100@FreeBSD.org> <20110827081103.GB21676@zxy.spb.ru> <86obzbi75n.fsf@srvbsdfenssv.interne.associated-bears.org> <20110827105342.GC21676@zxy.spb.ru> In-Reply-To: <20110827105342.GC21676@zxy.spb.ru> X-Enigmail-Version: 1.3.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Eric Masson , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r225201 - in head/sys: amd64/conf 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: Sat, 27 Aug 2011 11:45:29 -0000 On 8/27/2011 3:53 AM, Slawa Olhovchenkov wrote: > On Sat, Aug 27, 2011 at 10:35:16AM +0200, Eric Masson wrote: > >> Slawa Olhovchenkov writes: >> >> Hello, >> >>> Yes, from FreeBSD 6.x puc.ko don't work. Only in-kernel version work. >> >> Nope puc.ko module can't attach drivers compiled in kernel, but if both >> puc & uart are loaded as modules, they work fine : > > >> The other way could be to ship a stripped down GENERIC kernel and load >> modules manually or automagically (devd ?) >> Regards > > May be for fist step: w/o devd, simle remove all posible from GENERIC and include all removed > drivers in /boot/loader.conf? You're better off using kld_list in rc.conf for anything that doesn't absolutely have to be loaded with the kernel. -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Sat Aug 27 12:44:21 2011 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 87CD1106564A; Sat, 27 Aug 2011 12:44:21 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) by mx1.freebsd.org (Postfix) with ESMTP id E155F8FC0A; Sat, 27 Aug 2011 12:44:20 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1QxIFU-000IEC-8p; Sat, 27 Aug 2011 16:44:32 +0400 Date: Sat, 27 Aug 2011 16:44:32 +0400 From: Slawa Olhovchenkov To: Doug Barton Message-ID: <20110827124432.GD21676@zxy.spb.ru> References: <201108262122.p7QLMZXW071323@svn.freebsd.org> <4E583B92.3060100@FreeBSD.org> <20110827081103.GB21676@zxy.spb.ru> <86obzbi75n.fsf@srvbsdfenssv.interne.associated-bears.org> <20110827105342.GC21676@zxy.spb.ru> <4E58D8E8.3090603@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4E58D8E8.3090603@FreeBSD.org> User-Agent: Mutt/1.5.20 (2009-06-14) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false Cc: Eric Masson , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r225201 - in head/sys: amd64/conf 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: Sat, 27 Aug 2011 12:44:21 -0000 On Sat, Aug 27, 2011 at 04:45:44AM -0700, Doug Barton wrote: > On 8/27/2011 3:53 AM, Slawa Olhovchenkov wrote: > > On Sat, Aug 27, 2011 at 10:35:16AM +0200, Eric Masson wrote: > > > >> Slawa Olhovchenkov writes: > >> > >> Hello, > >> > >>> Yes, from FreeBSD 6.x puc.ko don't work. Only in-kernel version work. > >> > >> Nope puc.ko module can't attach drivers compiled in kernel, but if both > >> puc & uart are loaded as modules, they work fine : > > > > > >> The other way could be to ship a stripped down GENERIC kernel and load > >> modules manually or automagically (devd ?) > >> Regards > > > > May be for fist step: w/o devd, simle remove all posible from GENERIC and include all removed > > drivers in /boot/loader.conf? > > You're better off using kld_list in rc.conf for anything that doesn't > absolutely have to be loaded with the kernel. What drivers in GENERIC don't need to boot from disk or network? sound only? From owner-svn-src-head@FreeBSD.ORG Sat Aug 27 14:24:28 2011 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 773B2106566C; Sat, 27 Aug 2011 14:24:28 +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 64DDB8FC0C; Sat, 27 Aug 2011 14:24:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7REOSBI006951; Sat, 27 Aug 2011 14:24:28 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7REOSKw006938; Sat, 27 Aug 2011 14:24:28 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201108271424.p7REOSKw006938@svn.freebsd.org> From: Robert Watson Date: Sat, 27 Aug 2011 14:24: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: r225214 - in head/sys: arm/at91 conf ddb dev/cfe dev/dcons dev/ofw dev/sio dev/uart modules/dcons modules/sio pc98/cbus powerpc/mambo 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, 27 Aug 2011 14:24:28 -0000 Author: rwatson Date: Sat Aug 27 14:24:27 2011 New Revision: 225214 URL: http://svn.freebsd.org/changeset/base/225214 Log: Follow up to r225203 refining break-to-debugger run-time configuration improvements: (1) Implement new model in previously missed at91 UART driver (2) Move BREAK_TO_DEBUGGER and ALT_BREAK_TO_DEBUGGER from opt_comconsole.h to opt_kdb.h (spotted by np) (3) Garbage collect now-unused opt_comconsole.h MFC after: 3 weeks Approved by: re (bz) Modified: head/sys/arm/at91/uart_dev_at91usart.c head/sys/conf/options head/sys/ddb/db_break.c head/sys/dev/cfe/cfe_console.c head/sys/dev/dcons/dcons_os.c head/sys/dev/ofw/ofw_console.c head/sys/dev/sio/sio.c head/sys/dev/uart/uart_core.c head/sys/modules/dcons/Makefile head/sys/modules/sio/Makefile head/sys/pc98/cbus/sio.c head/sys/powerpc/mambo/mambo_console.c Modified: head/sys/arm/at91/uart_dev_at91usart.c ============================================================================== --- head/sys/arm/at91/uart_dev_at91usart.c Sat Aug 27 14:03:27 2011 (r225213) +++ head/sys/arm/at91/uart_dev_at91usart.c Sat Aug 27 14:24:27 2011 (r225214) @@ -29,8 +29,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_comconsole.h" - #include #include #include @@ -485,25 +483,10 @@ at91_usart_bus_param(struct uart_softc * static __inline void at91_rx_put(struct uart_softc *sc, int key) { -#if defined(KDB) && defined(ALT_BREAK_TO_DEBUGGER) - int kdb_brk; - if (sc->sc_sysdev != NULL && sc->sc_sysdev->type == UART_DEV_CONSOLE) { - if ((kdb_brk = kdb_alt_break(key, &sc->sc_altbrk)) != 0) { - switch (kdb_brk) { - case KDB_REQ_DEBUGGER: - kdb_enter(KDB_WHY_BREAK, - "Break sequence on console"); - break; - case KDB_REQ_PANIC: - kdb_panic("Panic sequence on console"); - break; - case KDB_REQ_REBOOT: - kdb_reboot(); - break; - } - } - } +#if defined(KDB) + if (sc->sc_sysdev != NULL && sc->sc_sysdev->type == UART_DEV_CONSOLE) + kdb_alt_break(key, &sc->sc_altbrk); #endif uart_rx_put(sc, key); } Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sat Aug 27 14:03:27 2011 (r225213) +++ head/sys/conf/options Sat Aug 27 14:24:27 2011 (r225214) @@ -47,6 +47,8 @@ TWA_DEBUG opt_twa.h TWA_FLASH_FIRMWARE opt_twa.h # Debugging options. +ALT_BREAK_TO_DEBUGGER opt_kdb.h +BREAK_TO_DEBUGGER opt_kdb.h DDB DDB_BUFR_SIZE opt_ddb.h DDB_CAPTURE_DEFAULTBUFSIZE opt_ddb.h @@ -637,9 +639,6 @@ BKTR_SIS_VIA_MODE opt_bktr.h BKTR_USE_FREEBSD_SMBUS opt_bktr.h BKTR_NEW_MSP34XX_DRIVER opt_bktr.h -BREAK_TO_DEBUGGER opt_comconsole.h -ALT_BREAK_TO_DEBUGGER opt_comconsole.h - # Options to support PPS UART_PPS_ON_CTS opt_uart.h Modified: head/sys/ddb/db_break.c ============================================================================== --- head/sys/ddb/db_break.c Sat Aug 27 14:03:27 2011 (r225213) +++ head/sys/ddb/db_break.c Sat Aug 27 14:24:27 2011 (r225214) @@ -35,8 +35,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_comconsole.h" - #include #include Modified: head/sys/dev/cfe/cfe_console.c ============================================================================== --- head/sys/dev/cfe/cfe_console.c Sat Aug 27 14:03:27 2011 (r225213) +++ head/sys/dev/cfe/cfe_console.c Sat Aug 27 14:24:27 2011 (r225214) @@ -27,8 +27,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_comconsole.h" - #include #include #include Modified: head/sys/dev/dcons/dcons_os.c ============================================================================== --- head/sys/dev/dcons/dcons_os.c Sat Aug 27 14:03:27 2011 (r225213) +++ head/sys/dev/dcons/dcons_os.c Sat Aug 27 14:24:27 2011 (r225214) @@ -64,7 +64,6 @@ #include #include -#include "opt_comconsole.h" #include "opt_dcons.h" #include "opt_kdb.h" #include "opt_gdb.h" Modified: head/sys/dev/ofw/ofw_console.c ============================================================================== --- head/sys/dev/ofw/ofw_console.c Sat Aug 27 14:03:27 2011 (r225213) +++ head/sys/dev/ofw/ofw_console.c Sat Aug 27 14:24:27 2011 (r225214) @@ -26,7 +26,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_comconsole.h" #include "opt_ofw.h" #include Modified: head/sys/dev/sio/sio.c ============================================================================== --- head/sys/dev/sio/sio.c Sat Aug 27 14:03:27 2011 (r225213) +++ head/sys/dev/sio/sio.c Sat Aug 27 14:24:27 2011 (r225214) @@ -33,7 +33,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_comconsole.h" #include "opt_compat.h" #include "opt_gdb.h" #include "opt_kdb.h" Modified: head/sys/dev/uart/uart_core.c ============================================================================== --- head/sys/dev/uart/uart_core.c Sat Aug 27 14:03:27 2011 (r225213) +++ head/sys/dev/uart/uart_core.c Sat Aug 27 14:24:27 2011 (r225214) @@ -27,10 +27,6 @@ #include __FBSDID("$FreeBSD$"); -#ifndef KLD_MODULE -#include "opt_comconsole.h" -#endif - #include #include #include Modified: head/sys/modules/dcons/Makefile ============================================================================== --- head/sys/modules/dcons/Makefile Sat Aug 27 14:03:27 2011 (r225213) +++ head/sys/modules/dcons/Makefile Sat Aug 27 14:24:27 2011 (r225214) @@ -5,7 +5,7 @@ KMOD = dcons SRCS = dcons.c dcons.h dcons_os.c dcons_os.h \ - opt_dcons.h opt_kdb.h opt_ddb.h opt_gdb.h opt_comconsole.h + opt_dcons.h opt_kdb.h opt_ddb.h opt_gdb.h .if !defined(KERNBUILDDIR) opt_kdb.h: @@ -13,9 +13,6 @@ opt_kdb.h: opt_ddb.h: echo "#define DDB 1" > $@ - -opt_comconsole.h: - echo "#define ALT_BREAK_TO_DEBUGGER 1" > $@ .endif CFLAGS+= -I${.CURDIR}/../.. Modified: head/sys/modules/sio/Makefile ============================================================================== --- head/sys/modules/sio/Makefile Sat Aug 27 14:03:27 2011 (r225213) +++ head/sys/modules/sio/Makefile Sat Aug 27 14:24:27 2011 (r225214) @@ -7,7 +7,7 @@ KMOD= sio SRCS= bus_if.h card_if.h device_if.h isa_if.h pci_if.h serdev_if.h \ - opt_comconsole.h opt_compat.h opt_gdb.h opt_kdb.h opt_sio.h \ + opt_compat.h opt_gdb.h opt_kdb.h opt_sio.h \ sio.c sio_pccard.c sio_pci.c sio_puc.c pccarddevs.h .if ${MACHINE} == "pc98" SRCS+= sio_cbus.c Modified: head/sys/pc98/cbus/sio.c ============================================================================== --- head/sys/pc98/cbus/sio.c Sat Aug 27 14:03:27 2011 (r225213) +++ head/sys/pc98/cbus/sio.c Sat Aug 27 14:24:27 2011 (r225214) @@ -31,7 +31,6 @@ * from: i386/isa sio.c,v 1.234 */ -#include "opt_comconsole.h" #include "opt_compat.h" #include "opt_gdb.h" #include "opt_kdb.h" Modified: head/sys/powerpc/mambo/mambo_console.c ============================================================================== --- head/sys/powerpc/mambo/mambo_console.c Sat Aug 27 14:03:27 2011 (r225213) +++ head/sys/powerpc/mambo/mambo_console.c Sat Aug 27 14:24:27 2011 (r225214) @@ -25,8 +25,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_comconsole.h" - #include #include #include From owner-svn-src-head@FreeBSD.ORG Sat Aug 27 15:28:58 2011 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 0F6451065672; Sat, 27 Aug 2011 15:28:58 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F388D8FC13; Sat, 27 Aug 2011 15:28:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7RFSvuI011093; Sat, 27 Aug 2011 15:28:57 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7RFSvGp011091; Sat, 27 Aug 2011 15:28:57 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201108271528.p7RFSvGp011091@svn.freebsd.org> From: Christian Brueffer Date: Sat, 27 Aug 2011 15:28:57 +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: r225215 - head/bin/ed 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, 27 Aug 2011 15:28:58 -0000 Author: brueffer Date: Sat Aug 27 15:28:57 2011 New Revision: 225215 URL: http://svn.freebsd.org/changeset/base/225215 Log: Fix memory leaks in error cases. PR: 159011 Submitted by: Henning Petersen Approved by: re (kib) MFC after: 1 week Modified: head/bin/ed/buf.c Modified: head/bin/ed/buf.c ============================================================================== --- head/bin/ed/buf.c Sat Aug 27 14:24:27 2011 (r225214) +++ head/bin/ed/buf.c Sat Aug 27 15:28:57 2011 (r225215) @@ -94,6 +94,7 @@ put_sbuf_line(const char *cs) ; if (s - cs >= LINECHARS) { errmsg = "line too long"; + free(lp); return NULL; } len = s - cs; @@ -102,6 +103,7 @@ put_sbuf_line(const char *cs) if (fseeko(sfp, (off_t)0, SEEK_END) < 0) { fprintf(stderr, "%s\n", strerror(errno)); errmsg = "cannot seek temp file"; + free(lp); return NULL; } sfseek = ftello(sfp); @@ -112,6 +114,7 @@ put_sbuf_line(const char *cs) sfseek = -1; fprintf(stderr, "%s\n", strerror(errno)); errmsg = "cannot write temp file"; + free(lp); return NULL; } lp->len = len; From owner-svn-src-head@FreeBSD.ORG Sat Aug 27 20:32:10 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 53DFF106566B; Sat, 27 Aug 2011 20:32:10 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-198-245.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id CA9A114E580; Sat, 27 Aug 2011 20:32:08 +0000 (UTC) Message-ID: <4E595447.8000104@FreeBSD.org> Date: Sat, 27 Aug 2011 13:32:07 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:6.0) Gecko/20110824 Thunderbird/6.0 MIME-Version: 1.0 To: Slawa Olhovchenkov References: <201108262122.p7QLMZXW071323@svn.freebsd.org> <4E583B92.3060100@FreeBSD.org> <20110827081103.GB21676@zxy.spb.ru> <86obzbi75n.fsf@srvbsdfenssv.interne.associated-bears.org> <20110827105342.GC21676@zxy.spb.ru> <4E58D8E8.3090603@FreeBSD.org> <20110827124432.GD21676@zxy.spb.ru> In-Reply-To: <20110827124432.GD21676@zxy.spb.ru> X-Enigmail-Version: undefined OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Eric Masson , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r225201 - in head/sys: amd64/conf 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: Sat, 27 Aug 2011 20:32:10 -0000 On 08/27/2011 05:44, Slawa Olhovchenkov wrote: > On Sat, Aug 27, 2011 at 04:45:44AM -0700, Doug Barton wrote: > >> On 8/27/2011 3:53 AM, Slawa Olhovchenkov wrote: >>> On Sat, Aug 27, 2011 at 10:35:16AM +0200, Eric Masson wrote: >>> >>>> Slawa Olhovchenkov writes: >>>> >>>> Hello, >>>> >>>>> Yes, from FreeBSD 6.x puc.ko don't work. Only in-kernel version work. >>>> >>>> Nope puc.ko module can't attach drivers compiled in kernel, but if both >>>> puc & uart are loaded as modules, they work fine : >>> >>> >>>> The other way could be to ship a stripped down GENERIC kernel and load >>>> modules manually or automagically (devd ?) >>>> Regards >>> >>> May be for fist step: w/o devd, simle remove all posible from GENERIC and include all removed >>> drivers in /boot/loader.conf? >> >> You're better off using kld_list in rc.conf for anything that doesn't >> absolutely have to be loaded with the kernel. > > What drivers in GENERIC don't need to boot from disk or network? > sound only? man rc.conf, search for kld_list. -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Sat Aug 27 21:04:38 2011 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 55E041065673; Sat, 27 Aug 2011 21:04:38 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) by mx1.freebsd.org (Postfix) with ESMTP id AE4AD8FC13; Sat, 27 Aug 2011 21:04:37 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1QxQ3c-000MU8-K8; Sun, 28 Aug 2011 01:04:48 +0400 Date: Sun, 28 Aug 2011 01:04:48 +0400 From: Slawa Olhovchenkov To: Doug Barton Message-ID: <20110827210448.GE21676@zxy.spb.ru> References: <201108262122.p7QLMZXW071323@svn.freebsd.org> <4E583B92.3060100@FreeBSD.org> <20110827081103.GB21676@zxy.spb.ru> <86obzbi75n.fsf@srvbsdfenssv.interne.associated-bears.org> <20110827105342.GC21676@zxy.spb.ru> <4E58D8E8.3090603@FreeBSD.org> <20110827124432.GD21676@zxy.spb.ru> <4E595447.8000104@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4E595447.8000104@FreeBSD.org> User-Agent: Mutt/1.5.20 (2009-06-14) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false Cc: Eric Masson , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r225201 - in head/sys: amd64/conf 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: Sat, 27 Aug 2011 21:04:38 -0000 On Sat, Aug 27, 2011 at 01:32:07PM -0700, Doug Barton wrote: > On 08/27/2011 05:44, Slawa Olhovchenkov wrote: > > On Sat, Aug 27, 2011 at 04:45:44AM -0700, Doug Barton wrote: > > > >> On 8/27/2011 3:53 AM, Slawa Olhovchenkov wrote: > >>> On Sat, Aug 27, 2011 at 10:35:16AM +0200, Eric Masson wrote: > >>> > >>>> Slawa Olhovchenkov writes: > >>>> > >>>> Hello, > >>>> > >>>>> Yes, from FreeBSD 6.x puc.ko don't work. Only in-kernel version work. > >>>> > >>>> Nope puc.ko module can't attach drivers compiled in kernel, but if both > >>>> puc & uart are loaded as modules, they work fine : > >>> > >>> > >>>> The other way could be to ship a stripped down GENERIC kernel and load > >>>> modules manually or automagically (devd ?) > >>>> Regards > >>> > >>> May be for fist step: w/o devd, simle remove all posible from GENERIC and include all removed > >>> drivers in /boot/loader.conf? > >> > >> You're better off using kld_list in rc.conf for anything that doesn't > >> absolutely have to be loaded with the kernel. > > > > What drivers in GENERIC don't need to boot from disk or network? > > sound only? > > man rc.conf, search for kld_list. Sorry for bad english. What drivers (from current GENERIC) don't need for network or disk boot and can be moved to kld_list? I see only sound and agp. From owner-svn-src-head@FreeBSD.ORG Sat Aug 27 21:09:38 2011 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 41FA2106564A; Sat, 27 Aug 2011 21:09:38 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id B63A68FC1A; Sat, 27 Aug 2011 21:09:37 +0000 (UTC) Received: by qwc9 with SMTP id 9so3377345qwc.13 for ; Sat, 27 Aug 2011 14:09:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=vBFzFp4brMer6J8YcZRYuSHKFNDSC1IeCG2yQplfh/k=; b=BMtkLCBT1ByHEJwgm+Gj0xa1OuWjaSRHGAMmI4UrVypHHFPbS7p2WyFhy82UhEaihI c8sC0vCSMMNYLcHXKkpBgTfiOIMiX4gLbgpkFxG8G7ckaE/i5CQ5JgChVpOhA7DxIchI yoDQeGbQxDPif13dhQlkv6/7mCylZxmXQ+elM= MIME-Version: 1.0 Received: by 10.229.229.17 with SMTP id jg17mr2907074qcb.131.1314479376847; Sat, 27 Aug 2011 14:09:36 -0700 (PDT) Received: by 10.224.19.131 with HTTP; Sat, 27 Aug 2011 14:09:36 -0700 (PDT) In-Reply-To: <20110827210448.GE21676@zxy.spb.ru> References: <201108262122.p7QLMZXW071323@svn.freebsd.org> <4E583B92.3060100@FreeBSD.org> <20110827081103.GB21676@zxy.spb.ru> <86obzbi75n.fsf@srvbsdfenssv.interne.associated-bears.org> <20110827105342.GC21676@zxy.spb.ru> <4E58D8E8.3090603@FreeBSD.org> <20110827124432.GD21676@zxy.spb.ru> <4E595447.8000104@FreeBSD.org> <20110827210448.GE21676@zxy.spb.ru> Date: Sat, 27 Aug 2011 14:09:36 -0700 Message-ID: From: Garrett Cooper To: Slawa Olhovchenkov Content-Type: text/plain; charset=ISO-8859-1 Cc: Doug Barton , John Baldwin , Eric Masson , svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r225201 - in head/sys: amd64/conf 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: Sat, 27 Aug 2011 21:09:38 -0000 On Sat, Aug 27, 2011 at 2:04 PM, Slawa Olhovchenkov wrote: > On Sat, Aug 27, 2011 at 01:32:07PM -0700, Doug Barton wrote: > >> On 08/27/2011 05:44, Slawa Olhovchenkov wrote: >> > On Sat, Aug 27, 2011 at 04:45:44AM -0700, Doug Barton wrote: >> > >> >> On 8/27/2011 3:53 AM, Slawa Olhovchenkov wrote: >> >>> On Sat, Aug 27, 2011 at 10:35:16AM +0200, Eric Masson wrote: >> >>> >> >>>> Slawa Olhovchenkov writes: >> >>>> >> >>>> Hello, >> >>>> >> >>>>> Yes, from FreeBSD 6.x puc.ko don't work. Only in-kernel version work. >> >>>> >> >>>> Nope puc.ko module can't attach drivers compiled in kernel, but if both >> >>>> puc & uart are loaded as modules, they work fine : >> >>> >> >>> >> >>>> The other way could be to ship a stripped down GENERIC kernel and load >> >>>> modules manually or automagically (devd ?) >> >>>> Regards >> >>> >> >>> May be for fist step: w/o devd, simle remove all posible from GENERIC and include all removed >> >>> drivers in /boot/loader.conf? >> >> >> >> You're better off using kld_list in rc.conf for anything that doesn't >> >> absolutely have to be loaded with the kernel. >> > >> > What drivers in GENERIC don't need to boot from disk or network? >> > sound only? >> >> man rc.conf, search for kld_list. > > Sorry for bad english. > What drivers (from current GENERIC) don't need for network or disk > boot and can be moved to kld_list? > > I see only sound and agp. The answer varies based on your deployment mechanism and requirements. For example: some modules like the kqemu, nvidia, vboxdrv, etc, etc don't need to be loaded until later on in the boot process. That being said, if I'm netbooting I don't need to load storage drivers and the like until later on (unless I want to do some sort of mountroot manipulation, need to have a working kernel dumpable device at boot, etc). -Garrett From owner-svn-src-head@FreeBSD.ORG Sat Aug 27 21:16:59 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 80F9D106566C; Sat, 27 Aug 2011 21:16:59 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-198-245.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id EF14F14DF12; Sat, 27 Aug 2011 21:16:57 +0000 (UTC) Message-ID: <4E595EC8.40307@FreeBSD.org> Date: Sat, 27 Aug 2011 14:16:56 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:6.0) Gecko/20110824 Thunderbird/6.0 MIME-Version: 1.0 To: Slawa Olhovchenkov References: <201108262122.p7QLMZXW071323@svn.freebsd.org> <4E583B92.3060100@FreeBSD.org> <20110827081103.GB21676@zxy.spb.ru> <86obzbi75n.fsf@srvbsdfenssv.interne.associated-bears.org> <20110827105342.GC21676@zxy.spb.ru> <4E58D8E8.3090603@FreeBSD.org> <20110827124432.GD21676@zxy.spb.ru> <4E595447.8000104@FreeBSD.org> <20110827210448.GE21676@zxy.spb.ru> In-Reply-To: <20110827210448.GE21676@zxy.spb.ru> X-Enigmail-Version: undefined OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Eric Masson , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r225201 - in head/sys: amd64/conf 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: Sat, 27 Aug 2011 21:16:59 -0000 On 08/27/2011 14:04, Slawa Olhovchenkov wrote: > On Sat, Aug 27, 2011 at 01:32:07PM -0700, Doug Barton wrote: > >> On 08/27/2011 05:44, Slawa Olhovchenkov wrote: >>> On Sat, Aug 27, 2011 at 04:45:44AM -0700, Doug Barton wrote: >>> >>>> On 8/27/2011 3:53 AM, Slawa Olhovchenkov wrote: >>>>> On Sat, Aug 27, 2011 at 10:35:16AM +0200, Eric Masson wrote: >>>>> >>>>>> Slawa Olhovchenkov writes: >>>>>> >>>>>> Hello, >>>>>> >>>>>>> Yes, from FreeBSD 6.x puc.ko don't work. Only in-kernel version work. >>>>>> >>>>>> Nope puc.ko module can't attach drivers compiled in kernel, but if both >>>>>> puc & uart are loaded as modules, they work fine : >>>>> >>>>> >>>>>> The other way could be to ship a stripped down GENERIC kernel and load >>>>>> modules manually or automagically (devd ?) >>>>>> Regards >>>>> >>>>> May be for fist step: w/o devd, simle remove all posible from GENERIC and include all removed >>>>> drivers in /boot/loader.conf? >>>> >>>> You're better off using kld_list in rc.conf for anything that doesn't >>>> absolutely have to be loaded with the kernel. >>> >>> What drivers in GENERIC don't need to boot from disk or network? >>> sound only? >> >> man rc.conf, search for kld_list. > > Sorry for bad english. > What drivers (from current GENERIC) don't need for network or disk > boot and can be moved to kld_list? > > I see only sound and agp. I'm not going to do your homework for you. :) Try it and find out for yourself. I will tell you that given that rc.d/kld runs right after the disks are mounted means that (unless you are netbooting) you can put just about everything that isn't directly related to mounting your disks in kld_list. Beyond that, you just need to experiment on your own. Good luck, Doug -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Sat Aug 27 21:21:08 2011 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 9F181106566B; Sat, 27 Aug 2011 21:21:08 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) by mx1.freebsd.org (Postfix) with ESMTP id ED0C98FC0C; Sat, 27 Aug 2011 21:21:07 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1QxQJa-000MYa-FF; Sun, 28 Aug 2011 01:21:18 +0400 Date: Sun, 28 Aug 2011 01:21:18 +0400 From: Slawa Olhovchenkov To: Garrett Cooper Message-ID: <20110827212118.GF21676@zxy.spb.ru> References: <201108262122.p7QLMZXW071323@svn.freebsd.org> <4E583B92.3060100@FreeBSD.org> <20110827081103.GB21676@zxy.spb.ru> <86obzbi75n.fsf@srvbsdfenssv.interne.associated-bears.org> <20110827105342.GC21676@zxy.spb.ru> <4E58D8E8.3090603@FreeBSD.org> <20110827124432.GD21676@zxy.spb.ru> <4E595447.8000104@FreeBSD.org> <20110827210448.GE21676@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false Cc: Doug Barton , John Baldwin , Eric Masson , svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r225201 - in head/sys: amd64/conf 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: Sat, 27 Aug 2011 21:21:08 -0000 On Sat, Aug 27, 2011 at 02:09:36PM -0700, Garrett Cooper wrote: > >> > What drivers in GENERIC don't need to boot from disk or network? > >> > sound only? > >> > >> man rc.conf, search for kld_list. > > > > Sorry for bad english. > > What drivers (from current GENERIC) don't need for network or disk > > boot and can be moved to kld_list? > > > > I see only sound and agp. > > The answer varies based on your deployment mechanism and > requirements. For example: some modules like the kqemu, nvidia, > vboxdrv, etc, etc don't need to be loaded until later on in the boot > process. That being said, if I'm netbooting I don't need to load > storage drivers and the like until later on (unless I want to do some > sort of mountroot manipulation, need to have a working kernel dumpable > device at boot, etc). > -Garrett No-no-no. GENERIC placed on instalation CD/DVD and updated by freebsd-update. So GENERIC (and modules loaded in /boot/loader.conf from instalation image and in default install) must be enought to install in widest environment. If drivers moved from GENERIC to /boot/loader.conf it allow preserve wide range of installation environment and give light way to reduce count of loaded devices (by edit /boot/loader.conf). From owner-svn-src-head@FreeBSD.ORG Sat Aug 27 21:23:44 2011 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 CE0361065679; Sat, 27 Aug 2011 21:23:44 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) by mx1.freebsd.org (Postfix) with ESMTP id 2D9178FC1E; Sat, 27 Aug 2011 21:23:43 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1QxQM7-000MZX-8C; Sun, 28 Aug 2011 01:23:55 +0400 Date: Sun, 28 Aug 2011 01:23:55 +0400 From: Slawa Olhovchenkov To: Doug Barton Message-ID: <20110827212355.GG21676@zxy.spb.ru> References: <201108262122.p7QLMZXW071323@svn.freebsd.org> <4E583B92.3060100@FreeBSD.org> <20110827081103.GB21676@zxy.spb.ru> <86obzbi75n.fsf@srvbsdfenssv.interne.associated-bears.org> <20110827105342.GC21676@zxy.spb.ru> <4E58D8E8.3090603@FreeBSD.org> <20110827124432.GD21676@zxy.spb.ru> <4E595447.8000104@FreeBSD.org> <20110827210448.GE21676@zxy.spb.ru> <4E595EC8.40307@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4E595EC8.40307@FreeBSD.org> User-Agent: Mutt/1.5.20 (2009-06-14) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false Cc: Eric Masson , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r225201 - in head/sys: amd64/conf 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: Sat, 27 Aug 2011 21:23:44 -0000 On Sat, Aug 27, 2011 at 02:16:56PM -0700, Doug Barton wrote: > >>> What drivers in GENERIC don't need to boot from disk or network? > >>> sound only? > >> > >> man rc.conf, search for kld_list. > > > > Sorry for bad english. > > What drivers (from current GENERIC) don't need for network or disk > > boot and can be moved to kld_list? > > > > I see only sound and agp. > > I'm not going to do your homework for you. :) Try it and find out for > yourself. I will tell you that given that rc.d/kld runs right after the > disks are mounted means that (unless you are netbooting) you can put > just about everything that isn't directly related to mounting your disks > in kld_list. Beyond that, you just need to experiment on your own. GENERIC need not for me, GENERIC need for everyone: this is kernel on installation image and kernel for first boot after install. From owner-svn-src-head@FreeBSD.ORG Sat Aug 27 21:33:05 2011 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 D80641065673; Sat, 27 Aug 2011 21:33:05 +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 AE5BC8FC17; Sat, 27 Aug 2011 21:33:05 +0000 (UTC) Received: from [192.168.2.112] (host81-151-180-177.range81-151.btcentralplus.com [81.151.180.177]) by cyrus.watson.org (Postfix) with ESMTPSA id 3C5DB46B49; Sat, 27 Aug 2011 17:33:04 -0400 (EDT) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Robert N. M. Watson" In-Reply-To: Date: Sat, 27 Aug 2011 22:33:03 +0100 Content-Transfer-Encoding: 7bit Message-Id: References: <201108262146.p7QLkaBG072083@svn.freebsd.org> To: Navdeep Parhar X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r225203 - in head/sys: dev/cfe dev/dcons dev/ofw dev/sio dev/syscons dev/uart kern pc98/cbus powerpc/mambo 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: Sat, 27 Aug 2011 21:33:05 -0000 On 27 Aug 2011, at 09:21, Navdeep Parhar wrote: > Shouldn't opt_comconsole.h be included in subr_kdb.c for this part to > actually work? Should now be fixed; do let me know if not! Robert From owner-svn-src-head@FreeBSD.ORG Sat Aug 27 21:37:36 2011 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 1A51B106564A; Sat, 27 Aug 2011 21:37:35 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-qy0-f182.google.com (mail-qy0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id 365E48FC16; Sat, 27 Aug 2011 21:37:34 +0000 (UTC) Received: by qyk9 with SMTP id 9so3442024qyk.13 for ; Sat, 27 Aug 2011 14:37:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=i664fJiE0QHMmnv2XOBc1256FCj1IKFOaW2b+P6FMUM=; b=nIFX+3VTzV6lGg4kJ8zHVNIb0/YkwarO+t6Ou9K7W2EWcYz8kXqFXFRcAu12i9GCrI dkQOw5k90vbMlaFICR83U2YkNqvmZGR1qYB79oA+k8hIzjb0cAb7RVj9WRELIzY7tN3h QIH/wDKWFPkGz7irrR4dPlrsdRUf1WDvuMZGY= MIME-Version: 1.0 Received: by 10.229.61.66 with SMTP id s2mr3701711qch.55.1314481054394; Sat, 27 Aug 2011 14:37:34 -0700 (PDT) Received: by 10.224.19.131 with HTTP; Sat, 27 Aug 2011 14:37:34 -0700 (PDT) In-Reply-To: <20110827212118.GF21676@zxy.spb.ru> References: <201108262122.p7QLMZXW071323@svn.freebsd.org> <4E583B92.3060100@FreeBSD.org> <20110827081103.GB21676@zxy.spb.ru> <86obzbi75n.fsf@srvbsdfenssv.interne.associated-bears.org> <20110827105342.GC21676@zxy.spb.ru> <4E58D8E8.3090603@FreeBSD.org> <20110827124432.GD21676@zxy.spb.ru> <4E595447.8000104@FreeBSD.org> <20110827210448.GE21676@zxy.spb.ru> <20110827212118.GF21676@zxy.spb.ru> Date: Sat, 27 Aug 2011 14:37:34 -0700 Message-ID: From: Garrett Cooper To: Slawa Olhovchenkov Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Doug Barton , John Baldwin , Eric Masson , svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r225201 - in head/sys: amd64/conf 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: Sat, 27 Aug 2011 21:37:36 -0000 On Sat, Aug 27, 2011 at 2:21 PM, Slawa Olhovchenkov wrote: > On Sat, Aug 27, 2011 at 02:09:36PM -0700, Garrett Cooper wrote: > >> >> > What drivers in GENERIC don't need to boot from disk or network? >> >> > sound only? >> >> >> >> man rc.conf, search for kld_list. >> > >> > Sorry for bad english. >> > What drivers (from current GENERIC) don't need for network or disk >> > boot and can be moved to kld_list? >> > >> > I see only sound and agp. >> >> =A0 =A0 The answer varies based on your deployment mechanism and >> requirements. For example: some modules like the kqemu, nvidia, >> vboxdrv, etc, etc don't need to be loaded until later on in the boot >> process. That being said, if I'm netbooting I don't need to load >> storage drivers and the like until later on (unless I want to do some >> sort of mountroot manipulation, need to have a working kernel dumpable >> device at boot, etc). >> -Garrett > > No-no-no. > GENERIC placed on instalation CD/DVD and updated by freebsd-update. > So GENERIC (and modules loaded in /boot/loader.conf from instalation > image and in default install) must be enought to install in widest > environment. This method is for customizers more than generalists today. but should potentially be extended to generalists tomorrow (this method is similar to what I would refer to as "pimp my PC"). > If drivers moved from GENERIC to /boot/loader.conf it allow preserve > wide range of installation environment and give light way to reduce > count of loaded devices (by edit /boot/loader.conf). /boot/loader.conf is empty by default. GENERIC for the most part is a complete, monolithic kernel. I'm not sure what the issue is here, because this is for more advanced usage (i.e. you do linux_load=3D"YES" in /boot/loader.conf, etc). Thanks, -Garrett From owner-svn-src-head@FreeBSD.ORG Sat Aug 27 21:39:25 2011 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 A507E1065670; Sat, 27 Aug 2011 21:39:25 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-qy0-f182.google.com (mail-qy0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id 0A4C48FC1C; Sat, 27 Aug 2011 21:39:24 +0000 (UTC) Received: by qyk9 with SMTP id 9so3442401qyk.13 for ; Sat, 27 Aug 2011 14:39:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Xsb+UHAa+sDhL7EUQKnsAZGgLZ65i7MXbNFCCAg2xVk=; b=h1YF1DWEzCzEohANN/fj4kk84EmDAKAWWmxGbP5j/kx7XjRqZs2LLIaM8WCJfkfXTl PTEu0cL2AxeAAJAvlsm8ssviuR04W7SmBR17q455aeQALdyGHk1N6HgV0GD8OBY2n4hW wP8O1Nt82a0/cgAc7hnOqLXLxbxELdLRd7XSE= MIME-Version: 1.0 Received: by 10.229.89.66 with SMTP id d2mr3675178qcm.93.1314481164477; Sat, 27 Aug 2011 14:39:24 -0700 (PDT) Received: by 10.224.19.131 with HTTP; Sat, 27 Aug 2011 14:39:24 -0700 (PDT) In-Reply-To: <4E595EC8.40307@FreeBSD.org> References: <201108262122.p7QLMZXW071323@svn.freebsd.org> <4E583B92.3060100@FreeBSD.org> <20110827081103.GB21676@zxy.spb.ru> <86obzbi75n.fsf@srvbsdfenssv.interne.associated-bears.org> <20110827105342.GC21676@zxy.spb.ru> <4E58D8E8.3090603@FreeBSD.org> <20110827124432.GD21676@zxy.spb.ru> <4E595447.8000104@FreeBSD.org> <20110827210448.GE21676@zxy.spb.ru> <4E595EC8.40307@FreeBSD.org> Date: Sat, 27 Aug 2011 14:39:24 -0700 Message-ID: From: Garrett Cooper To: Doug Barton Content-Type: text/plain; charset=ISO-8859-1 Cc: src-committers@freebsd.org, John Baldwin , Eric Masson , svn-src-all@freebsd.org, Slawa Olhovchenkov , svn-src-head@freebsd.org Subject: Re: svn commit: r225201 - in head/sys: amd64/conf 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: Sat, 27 Aug 2011 21:39:25 -0000 On Sat, Aug 27, 2011 at 2:16 PM, Doug Barton wrote: > On 08/27/2011 14:04, Slawa Olhovchenkov wrote: >> On Sat, Aug 27, 2011 at 01:32:07PM -0700, Doug Barton wrote: >> >>> On 08/27/2011 05:44, Slawa Olhovchenkov wrote: >>>> On Sat, Aug 27, 2011 at 04:45:44AM -0700, Doug Barton wrote: >>>> >>>>> On 8/27/2011 3:53 AM, Slawa Olhovchenkov wrote: >>>>>> On Sat, Aug 27, 2011 at 10:35:16AM +0200, Eric Masson wrote: >>>>>> >>>>>>> Slawa Olhovchenkov writes: >>>>>>> >>>>>>> Hello, >>>>>>> >>>>>>>> Yes, from FreeBSD 6.x puc.ko don't work. Only in-kernel version work. >>>>>>> >>>>>>> Nope puc.ko module can't attach drivers compiled in kernel, but if both >>>>>>> puc & uart are loaded as modules, they work fine : >>>>>> >>>>>> >>>>>>> The other way could be to ship a stripped down GENERIC kernel and load >>>>>>> modules manually or automagically (devd ?) >>>>>>> Regards >>>>>> >>>>>> May be for fist step: w/o devd, simle remove all posible from GENERIC and include all removed >>>>>> drivers in /boot/loader.conf? >>>>> >>>>> You're better off using kld_list in rc.conf for anything that doesn't >>>>> absolutely have to be loaded with the kernel. >>>> >>>> What drivers in GENERIC don't need to boot from disk or network? >>>> sound only? >>> >>> man rc.conf, search for kld_list. >> >> Sorry for bad english. >> What drivers (from current GENERIC) don't need for network or disk >> boot and can be moved to kld_list? >> >> I see only sound and agp. > > I'm not going to do your homework for you. :) Try it and find out for > yourself. I will tell you that given that rc.d/kld runs right after the > disks are mounted means that (unless you are netbooting) you can put > just about everything that isn't directly related to mounting your disks > in kld_list. Beyond that, you just need to experiment on your own. A certain set of quick guidelines (< 1 page should suffice) for kld_list should be devised though. It would at least make quick booting more feasible for the masses. Thanks, -Garrett From owner-svn-src-head@FreeBSD.ORG Sat Aug 27 21:56:34 2011 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 C2D8E106566C; Sat, 27 Aug 2011 21:56:34 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) by mx1.freebsd.org (Postfix) with ESMTP id 16FFA8FC14; Sat, 27 Aug 2011 21:56:33 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1QxQrs-000MiU-ED; Sun, 28 Aug 2011 01:56:44 +0400 Date: Sun, 28 Aug 2011 01:56:44 +0400 From: Slawa Olhovchenkov To: Garrett Cooper Message-ID: <20110827215644.GH21676@zxy.spb.ru> References: <20110827081103.GB21676@zxy.spb.ru> <86obzbi75n.fsf@srvbsdfenssv.interne.associated-bears.org> <20110827105342.GC21676@zxy.spb.ru> <4E58D8E8.3090603@FreeBSD.org> <20110827124432.GD21676@zxy.spb.ru> <4E595447.8000104@FreeBSD.org> <20110827210448.GE21676@zxy.spb.ru> <20110827212118.GF21676@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false Cc: Doug Barton , John Baldwin , Eric Masson , svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r225201 - in head/sys: amd64/conf 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: Sat, 27 Aug 2011 21:56:34 -0000 On Sat, Aug 27, 2011 at 02:37:34PM -0700, Garrett Cooper wrote: > > If drivers moved from GENERIC to /boot/loader.conf it allow preserve > > wide range of installation environment and give light way to reduce > > count of loaded devices (by edit /boot/loader.conf). > > /boot/loader.conf is empty by default. GENERIC for the most part > is a complete, monolithic kernel. I'm not sure what the issue is here, > because this is for more advanced usage (i.e. you do linux_load="YES" > in /boot/loader.conf, etc). Yes, I can do linux_load="YES". I can't do NFSSERVER_unload="YES" and remove part of monolithic kernel. I can't applay binary update for part of monolithic kernel and do kldunload module_abc kldload module_abc From owner-svn-src-head@FreeBSD.ORG Sat Aug 27 22:08:02 2011 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 3C9991065689; Sat, 27 Aug 2011 22:08:02 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1287E8FC08; Sat, 27 Aug 2011 22:08:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7RM81nE022789; Sat, 27 Aug 2011 22:08:01 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7RM817R022785; Sat, 27 Aug 2011 22:08:01 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201108272208.p7RM817R022785@svn.freebsd.org> From: Christian Brueffer Date: Sat, 27 Aug 2011 22:08: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: r225220 - in head: . share/man/man9 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, 27 Aug 2011 22:08:02 -0000 Author: brueffer Date: Sat Aug 27 22:08:01 2011 New Revision: 225220 URL: http://svn.freebsd.org/changeset/base/225220 Log: Remove information and MLINK for MULTI_DRIVER_MODULE(). The macro was removed in r121129 almost 8 years ago. PR: 150244 Submitted by: Gireesh Nagabhushana Approved by: re (kib) Modified: head/ObsoleteFiles.inc head/share/man/man9/DRIVER_MODULE.9 head/share/man/man9/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sat Aug 27 21:23:21 2011 (r225219) +++ head/ObsoleteFiles.inc Sat Aug 27 22:08:01 2011 (r225220) @@ -2293,6 +2293,8 @@ OLD_FILES+=lib/libz.so OLD_FILES+=bin/cxconfig OLD_FILES+=sbin/cxconfig OLD_FILES+=usr/share/man/man8/cxconfig.8.gz +# 20031016: MULTI_DRIVER_MODULE macro removed +OLD_FILES+=usr/share/man/man9/MULTI_DRIVER_MODULE.9.gz # 200309XX OLD_FILES+=usr/bin/symorder OLD_FILES+=usr/share/man/man1/symorder.1.gz Modified: head/share/man/man9/DRIVER_MODULE.9 ============================================================================== --- head/share/man/man9/DRIVER_MODULE.9 Sat Aug 27 21:23:21 2011 (r225219) +++ head/share/man/man9/DRIVER_MODULE.9 Sat Aug 27 22:08:01 2011 (r225220) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 16, 2000 +.Dd August 27, 2011 .Dt DRIVER_MODULE 9 .Os .Sh NAME @@ -40,7 +40,6 @@ .In sys/bus.h .In sys/module.h .Fn DRIVER_MODULE name busname "driver_t driver" "devclass_t devclass" "modeventhand_t evh" "void *arg" -.Fn MULTI_DRIVER_MODULE name busname "driver_t drivers[]" "devclass_t devclass" "modeventhand_t evh" "void *arg" .Sh DESCRIPTION The .Fn DRIVER_MODULE @@ -96,11 +95,6 @@ The is unused at this time and should be a .Dv NULL pointer. -.Pp -.Fn MULTI_DRIVER_MODULE -is a special version of -.Fn DRIVER_MODULE , -which takes a list of drivers instead of a single driver instance. .Sh SEE ALSO .Xr device 9 , .Xr driver 9 , Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Sat Aug 27 21:23:21 2011 (r225219) +++ head/share/man/man9/Makefile Sat Aug 27 22:08:01 2011 (r225220) @@ -605,7 +605,6 @@ MLINKS+=domain.9 DOMAIN_SET.9 \ domain.9 pfctlinput2.9 \ domain.9 pffindproto.9 \ domain.9 pffindtype.9 -MLINKS+=DRIVER_MODULE.9 MULTI_DRIVER_MODULE.9 MLINKS+=EVENTHANDLER.9 EVENTHANDLER_DECLARE.9 \ EVENTHANDLER.9 EVENTHANDLER_DEREGISTER.9 \ EVENTHANDLER.9 eventhandler_deregister.9 \ From owner-svn-src-head@FreeBSD.ORG Sat Aug 27 22:10:45 2011 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 715BE106564A; Sat, 27 Aug 2011 22:10:45 +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 616958FC15; Sat, 27 Aug 2011 22:10:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7RMAjTP022900; Sat, 27 Aug 2011 22:10:45 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7RMAjlZ022897; Sat, 27 Aug 2011 22:10:45 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201108272210.p7RMAjlZ022897@svn.freebsd.org> From: Robert Watson Date: Sat, 27 Aug 2011 22:10: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: r225221 - head/sys/dev/syscons 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, 27 Aug 2011 22:10:45 -0000 Author: rwatson Date: Sat Aug 27 22:10:45 2011 New Revision: 225221 URL: http://svn.freebsd.org/changeset/base/225221 Log: Add support for alternative break-to-debugger to syscons(4). While most keyboards allow console break sequences (such as ctrl-alt-esc) to be entered, alternative break can prove useful under virtualisation and remote console systems where entering control sequences can be difficult or unreliable. MFC after: 3 weeks Approved by: re (bz) Modified: head/sys/dev/syscons/syscons.c head/sys/dev/syscons/syscons.h Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Sat Aug 27 22:08:01 2011 (r225220) +++ head/sys/dev/syscons/syscons.c Sat Aug 27 22:10:45 2011 (r225221) @@ -3562,6 +3562,10 @@ next_code: /* goto next_code */ } else { /* regular keys (maybe MKEY is set) */ +#if !defined(SC_DISABLE_KDBKEY) && defined(KDB) + if (enable_kdbkey) + kdb_alt_break(c, &sc->sc_altbrk); +#endif if (!(sc->flags & SC_SCRN_BLANKED)) return c; } Modified: head/sys/dev/syscons/syscons.h ============================================================================== --- head/sys/dev/syscons/syscons.h Sat Aug 27 22:08:01 2011 (r225220) +++ head/sys/dev/syscons/syscons.h Sat Aug 27 22:10:45 2011 (r225221) @@ -266,6 +266,9 @@ typedef struct sc_softc { u_char cursor_char; u_char mouse_char; +#ifdef KDB + int sc_altbrk; +#endif } sc_softc_t; /* virtual screen */ From owner-svn-src-head@FreeBSD.ORG Sat Aug 27 22:10:56 2011 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 333F11065794; Sat, 27 Aug 2011 22:10:56 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 266AC8FC21; Sat, 27 Aug 2011 22:10:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7RMAscE022941; Sat, 27 Aug 2011 22:10:54 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7RMAsJ7022939; Sat, 27 Aug 2011 22:10:54 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201108272210.p7RMAsJ7022939@svn.freebsd.org> From: Christian Brueffer Date: Sat, 27 Aug 2011 22:10: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: r225222 - 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: Sat, 27 Aug 2011 22:10:56 -0000 Author: brueffer Date: Sat Aug 27 22:10:53 2011 New Revision: 225222 URL: http://svn.freebsd.org/changeset/base/225222 Log: Correct some old manpage removal entries. Approved by: re (kib) Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sat Aug 27 22:10:45 2011 (r225221) +++ head/ObsoleteFiles.inc Sat Aug 27 22:10:53 2011 (r225222) @@ -2043,9 +2043,9 @@ OLD_FILES+=usr/share/man/man5/ipsend.5.g OLD_FILES+=usr/bin/gtar OLD_FILES+=usr/share/man/man1/gtar.1.gz # 200503XX -OLD_FILES+=share/man/man3/exp10.3.gz -OLD_FILES+=share/man/man3/exp10f.3.gz -OLD_FILES+=share/man/man3/fpsetsticky.3.gz +OLD_FILES+=usr/share/man/man3/exp10.3.gz +OLD_FILES+=usr/share/man/man3/exp10f.3.gz +OLD_FILES+=usr/share/man/man3/fpsetsticky.3.gz # 20050324: updated release infrastructure OLD_FILES+=usr/share/man/man5/drivers.conf.5.gz # 20050317: removed from BIND 9 distribution From owner-svn-src-head@FreeBSD.ORG Sat Aug 27 23:25:38 2011 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 528D6106566B; Sat, 27 Aug 2011 23:25:38 +0000 (UTC) (envelope-from peterjeremy@acm.org) Received: from mail35.syd.optusnet.com.au (mail35.syd.optusnet.com.au [211.29.133.51]) by mx1.freebsd.org (Postfix) with ESMTP id BA5AF8FC16; Sat, 27 Aug 2011 23:25:37 +0000 (UTC) Received: from server.vk2pj.dyndns.org (c220-239-116-103.belrs4.nsw.optusnet.com.au [220.239.116.103]) by mail35.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p7RNPY9u012519 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 28 Aug 2011 09:25:35 +1000 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.4/8.14.4) with ESMTP id p7RNPXeU057838; Sun, 28 Aug 2011 09:25:33 +1000 (EST) (envelope-from peter@server.vk2pj.dyndns.org) Received: (from peter@localhost) by server.vk2pj.dyndns.org (8.14.4/8.14.4/Submit) id p7RNPXIq057837; Sun, 28 Aug 2011 09:25:33 +1000 (EST) (envelope-from peter) Date: Sun, 28 Aug 2011 09:25:32 +1000 From: Peter Jeremy To: Dag-Erling Smorgrav Message-ID: <20110827232532.GA57602@server.vk2pj.dyndns.org> References: <201104292300.p3TN0N8N019287@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="vkogqOf2sHV7VnPd" Content-Disposition: inline In-Reply-To: <201104292300.p3TN0N8N019287@svn.freebsd.org> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r221233 - 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: Sat, 27 Aug 2011 23:25:38 -0000 --vkogqOf2sHV7VnPd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2011-Apr-29 23:00:23 +0000, Dag-Erling Smorgrav wrote: >Log: > Add an -E option to mirror newfs's. The idea is that if you have a syst= em =2E.. > MFC after: 3 weeks It's now nearly 4 months later. Was there a technical issue why this wasn't MFC'd or was it just lack of time or oversight? --=20 Peter Jeremy --vkogqOf2sHV7VnPd Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk5ZfOwACgkQ/opHv/APuIczQQCgr/dUMGc/Z20qQcRbuhDnw88k I0oAoI4EYFY59Y4rLc5Zdar7zoRTSMsN =9UZM -----END PGP SIGNATURE----- --vkogqOf2sHV7VnPd-- From owner-svn-src-head@FreeBSD.ORG Sat Aug 27 23:47:48 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 9B37A106566C; Sat, 27 Aug 2011 23:47:48 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-198-245.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id E4F3414EFB2; Sat, 27 Aug 2011 23:47:46 +0000 (UTC) Message-ID: <4E598221.6080104@FreeBSD.org> Date: Sat, 27 Aug 2011 16:47:45 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:6.0) Gecko/20110824 Thunderbird/6.0 MIME-Version: 1.0 To: Garrett Cooper References: <201108262122.p7QLMZXW071323@svn.freebsd.org> <4E583B92.3060100@FreeBSD.org> <20110827081103.GB21676@zxy.spb.ru> <86obzbi75n.fsf@srvbsdfenssv.interne.associated-bears.org> <20110827105342.GC21676@zxy.spb.ru> <4E58D8E8.3090603@FreeBSD.org> <20110827124432.GD21676@zxy.spb.ru> <4E595447.8000104@FreeBSD.org> <20110827210448.GE21676@zxy.spb.ru> <4E595EC8.40307@FreeBSD.org> In-Reply-To: X-Enigmail-Version: undefined OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, John Baldwin , Eric Masson , svn-src-all@freebsd.org, Slawa Olhovchenkov , svn-src-head@freebsd.org Subject: Re: svn commit: r225201 - in head/sys: amd64/conf 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: Sat, 27 Aug 2011 23:47:48 -0000 On 08/27/2011 14:39, Garrett Cooper wrote: > A certain set of quick guidelines (< 1 page should suffice) for > kld_list should be devised though. I look forward to reviewing your draft of that. :) -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Sat Aug 27 23:52:21 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 33243106564A; Sat, 27 Aug 2011 23:52:21 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-198-245.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id C84B3152147; Sat, 27 Aug 2011 23:52:16 +0000 (UTC) Message-ID: <4E59832F.9000602@FreeBSD.org> Date: Sat, 27 Aug 2011 16:52:15 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:6.0) Gecko/20110824 Thunderbird/6.0 MIME-Version: 1.0 To: Slawa Olhovchenkov References: <201108262122.p7QLMZXW071323@svn.freebsd.org> <4E583B92.3060100@FreeBSD.org> <20110827081103.GB21676@zxy.spb.ru> <86obzbi75n.fsf@srvbsdfenssv.interne.associated-bears.org> <20110827105342.GC21676@zxy.spb.ru> <4E58D8E8.3090603@FreeBSD.org> <20110827124432.GD21676@zxy.spb.ru> <4E595447.8000104@FreeBSD.org> <20110827210448.GE21676@zxy.spb.ru> <4E595EC8.40307@FreeBSD.org> <20110827212355.GG21676@zxy.spb.ru> In-Reply-To: <20110827212355.GG21676@zxy.spb.ru> X-Enigmail-Version: undefined OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Eric Masson , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r225201 - in head/sys: amd64/conf 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: Sat, 27 Aug 2011 23:52:21 -0000 On 08/27/2011 14:23, Slawa Olhovchenkov wrote: > GENERIC need not for me, GENERIC need for everyone: this is kernel on > installation image and kernel for first boot after install. We covered this a few weeks ago. The mechanism used to load modules by loader.conf is veeeerrrrrryyyyyyy sllllllooooooooowwwwwwwww. Many times slower than loading the modules from disk after the system has booted. As a result doing what you're suggesting would not be appropriate. Doug -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/