svn commit: r206585 - in stable/8/sys/fs: nfs nfsserver

2010-04-13 Thread Rick Macklem
Author: rmacklem
Date: Wed Apr 14 03:13:02 2010
New Revision: 206585
URL: http://svn.freebsd.org/changeset/base/206585

Log:
  MFC: r205941
  This patch should fix handling of byte range locks locally
  on the server for the experimental nfs server. When enabled
  by setting vfs.newnfs.locallocks_enable to non-zero, the
  experimental nfs server will now acquire byte range locks
  on the file on behalf of NFSv4 clients, such that lock
  conflicts between the NFSv4 clients and processes running
  locally on the server, will be recognized and handled correctly.

Modified:
  stable/8/sys/fs/nfs/nfs_commonport.c
  stable/8/sys/fs/nfs/nfs_commonsubs.c
  stable/8/sys/fs/nfs/nfs_var.h
  stable/8/sys/fs/nfs/nfsport.h
  stable/8/sys/fs/nfs/nfsrvstate.h
  stable/8/sys/fs/nfsserver/nfs_nfsdstate.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/fs/nfs/nfs_commonport.c
==
--- stable/8/sys/fs/nfs/nfs_commonport.cWed Apr 14 01:57:53 2010
(r206584)
+++ stable/8/sys/fs/nfs/nfs_commonport.cWed Apr 14 03:13:02 2010
(r206585)
@@ -82,7 +82,8 @@ SYSCTL_STRING(_vfs_newnfs, OID_AUTO, cal
  */
 MALLOC_DEFINE(M_NEWNFSRVCACHE, "NFSD srvcache", "NFSD Server Request Cache");
 MALLOC_DEFINE(M_NEWNFSDCLIENT, "NFSD V4client", "NFSD V4 Client Id");
-MALLOC_DEFINE(M_NEWNFSDSTATE, "NFSD V4state", "NFSD V4 State (Openowner, Open, 
Lockowner, Delegation");
+MALLOC_DEFINE(M_NEWNFSDSTATE, "NFSD V4state",
+"NFSD V4 State (Openowner, Open, Lockowner, Delegation");
 MALLOC_DEFINE(M_NEWNFSDLOCK, "NFSD V4lock", "NFSD V4 byte range lock");
 MALLOC_DEFINE(M_NEWNFSDLOCKFILE, "NFSD lckfile", "NFSD Open/Lock file");
 MALLOC_DEFINE(M_NEWNFSSTRING, "NFSD string", "NFSD V4 long string");
@@ -97,7 +98,10 @@ MALLOC_DEFINE(M_NEWNFSCLLOCKOWNER, "NFSC
 MALLOC_DEFINE(M_NEWNFSCLLOCK, "NFSCL lck", "NFSCL Lock");
 MALLOC_DEFINE(M_NEWNFSV4NODE, "NEWNFSnode", "New nfs vnode");
 MALLOC_DEFINE(M_NEWNFSDIRECTIO, "NEWdirectio", "New nfs Direct IO buffer");
-MALLOC_DEFINE(M_NEWNFSDIROFF, "Newnfscl_diroff", "New NFS directory offset 
data");
+MALLOC_DEFINE(M_NEWNFSDIROFF, "NFSCL diroffdiroff",
+"New NFS directory offset data");
+MALLOC_DEFINE(M_NEWNFSDROLLBACK, "NFSD rollback",
+"New NFS local lock rollback");
 
 /*
  * Definition of mutex locks.

Modified: stable/8/sys/fs/nfs/nfs_commonsubs.c
==
--- stable/8/sys/fs/nfs/nfs_commonsubs.cWed Apr 14 01:57:53 2010
(r206584)
+++ stable/8/sys/fs/nfs/nfs_commonsubs.cWed Apr 14 03:13:02 2010
(r206585)
@@ -1835,6 +1835,19 @@ nfsv4_getref(struct nfsv4lock *lp, int *
 }
 
 /*
+ * Test for a lock. Return 1 if locked, 0 otherwise.
+ */
+APPLESTATIC int
+nfsv4_testlock(struct nfsv4lock *lp)
+{
+
+   if ((lp->nfslock_lock & NFSV4LOCK_LOCK) == 0 &&
+   lp->nfslock_usecnt == 0)
+   return (0);
+   return (1);
+}
+
+/*
  * Wake up anyone sleeping, waiting for this lock.
  */
 static void

Modified: stable/8/sys/fs/nfs/nfs_var.h
==
--- stable/8/sys/fs/nfs/nfs_var.h   Wed Apr 14 01:57:53 2010
(r206584)
+++ stable/8/sys/fs/nfs/nfs_var.h   Wed Apr 14 03:13:02 2010
(r206585)
@@ -251,6 +251,7 @@ int nfsv4_lock(struct nfsv4lock *, int, 
 void nfsv4_unlock(struct nfsv4lock *, int);
 void nfsv4_relref(struct nfsv4lock *);
 void nfsv4_getref(struct nfsv4lock *, int *, void *);
+int nfsv4_testlock(struct nfsv4lock *);
 int nfsrv_mtostr(struct nfsrv_descript *, char *, int);
 int nfsrv_checkutf8(u_int8_t *, int);
 int newnfs_sndlock(int *);

Modified: stable/8/sys/fs/nfs/nfsport.h
==
--- stable/8/sys/fs/nfs/nfsport.h   Wed Apr 14 01:57:53 2010
(r206584)
+++ stable/8/sys/fs/nfs/nfsport.h   Wed Apr 14 03:13:02 2010
(r206585)
@@ -543,6 +543,7 @@ void nfsrvd_rcv(struct socket *, void *,
 #defineNFSSTATESPINLOCKextern struct mtx nfs_state_mutex
 #defineNFSLOCKSTATE()  mtx_lock(&nfs_state_mutex)
 #defineNFSUNLOCKSTATE()mtx_unlock(&nfs_state_mutex)
+#defineNFSSTATEMUTEXPTR(&nfs_state_mutex)
 #defineNFSREQSPINLOCK  extern struct mtx nfs_req_mutex
 #defineNFSLOCKREQ()mtx_lock(&nfs_req_mutex)
 #defineNFSUNLOCKREQ()  mtx_unlock(&nfs_req_mutex)
@@ -678,6 +679,7 @@ MALLOC_DECLARE(M_NEWNFSDIROFF);
 MALLOC_DECLARE(M_NEWNFSV4NODE);
 MALLOC_DECLARE(M_NEWNFSDIRECTIO);
 MALLOC_DECLARE(M_NEWNFSMNT);
+MALLOC_DECLARE(M_NEWNFSDRO

svn commit: r206584 - head/sys/mips/mips

2010-04-13 Thread Neel Natu
Author: neel
Date: Wed Apr 14 01:57:53 2010
New Revision: 206584
URL: http://svn.freebsd.org/changeset/base/206584

Log:
  Destroy the pmap 'pm_mutex' in pmap_release() otherwise we will panic
  subsequently in pmap_pinit() with the following signature:
  
  panic: lock "pmap" 0xc7878bc8 already initialized
  
  This bug was uncovered by the changes made to vm_map.c in r206140.

Modified:
  head/sys/mips/mips/pmap.c

Modified: head/sys/mips/mips/pmap.c
==
--- head/sys/mips/mips/pmap.c   Wed Apr 14 01:43:25 2010(r206583)
+++ head/sys/mips/mips/pmap.c   Wed Apr 14 01:57:53 2010(r206584)
@@ -1263,6 +1263,7 @@ pmap_release(pmap_t pmap)
ptdpg->wire_count--;
atomic_subtract_int(&cnt.v_wire_count, 1);
vm_page_free_zero(ptdpg);
+   PMAP_LOCK_DESTROY(pmap);
 }
 
 /*
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r206582 - head/sys/mips/mips

2010-04-13 Thread Neel Natu
Author: neel
Date: Wed Apr 14 01:29:31 2010
New Revision: 206582
URL: http://svn.freebsd.org/changeset/base/206582

Log:
  Revert the vm_machdep.c part of r205072.
  
  This causes a panic in vm_thread_dispose() when it tries to add this kstack
  to the kstack cache. This happens only when 'td_kstack' is not (PAGE_SIZE * 2)
  bytes aligned and we have unmapped the page at that address in 
cpu_thread_alloc.
  
  Pointed out by: nwhitehorn@

Modified:
  head/sys/mips/mips/vm_machdep.c

Modified: head/sys/mips/mips/vm_machdep.c
==
--- head/sys/mips/mips/vm_machdep.c Wed Apr 14 01:24:09 2010
(r206581)
+++ head/sys/mips/mips/vm_machdep.c Wed Apr 14 01:29:31 2010
(r206582)
@@ -214,16 +214,6 @@ cpu_thread_swapin(struct thread *td)
 {
pt_entry_t *pte;
int i;
-   vm_offset_t unused_kstack_page;
-
-   /*
-* Unmap the unused kstack page.
-*/
-   unused_kstack_page = td->td_kstack;
-   if (td->td_md.md_realstack == td->td_kstack)
-   unused_kstack_page += (KSTACK_PAGES - 1) * PAGE_SIZE;
-
-   pmap_kremove(unused_kstack_page);
 
/*
 * The kstack may be at a different physical address now.
@@ -249,19 +239,13 @@ cpu_thread_swapout(struct thread *td)
 void
 cpu_thread_alloc(struct thread *td)
 {
-   vm_offset_t unused_kstack_page;
pt_entry_t *pte;
int i;
 
-   if (td->td_kstack & (1 << PAGE_SHIFT)) {
+   if (td->td_kstack & (1 << PAGE_SHIFT))
td->td_md.md_realstack = td->td_kstack + PAGE_SIZE;
-   unused_kstack_page = td->td_kstack;
-   } else {
+   else
td->td_md.md_realstack = td->td_kstack;
-   unused_kstack_page = td->td_kstack +
-   (KSTACK_PAGES - 1) * PAGE_SIZE;
-   }
-   pmap_kremove(unused_kstack_page);
 
td->td_pcb = (struct pcb *)(td->td_md.md_realstack +
(td->td_kstack_pages - 1) * PAGE_SIZE) - 1;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r206581 - stable/7/sys/pci

2010-04-13 Thread Pyun YongHyeon
Author: yongari
Date: Wed Apr 14 01:24:09 2010
New Revision: 206581
URL: http://svn.freebsd.org/changeset/base/206581

Log:
  MFC r206436:
Consistently use capital letters.

Modified:
  stable/7/sys/pci/if_rlreg.h
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/pci/if_rlreg.h
==
--- stable/7/sys/pci/if_rlreg.h Wed Apr 14 01:23:00 2010(r206580)
+++ stable/7/sys/pci/if_rlreg.h Wed Apr 14 01:24:09 2010(r206581)
@@ -160,7 +160,7 @@
 #define RL_HWREV_8169_8110SB   0x1000
 #define RL_HWREV_8169_8110SC   0x1800
 #define RL_HWREV_8102EL0x2480
-#define RL_HWREV_8102EL_SPIN1  0x24c0
+#define RL_HWREV_8102EL_SPIN1  0x24C0
 #define RL_HWREV_8168D 0x2800
 #define RL_HWREV_8168DP0x2880
 #define RL_HWREV_8168E 0x2C00
@@ -182,7 +182,7 @@
 #define RL_HWREV_8139C 0x7400
 #define RL_HWREV_8139D 0x7440
 #define RL_HWREV_8139CPLUS 0x7480
-#define RL_HWREV_8101  0x74c0
+#define RL_HWREV_8101  0x74C0
 #define RL_HWREV_8100  0x7880
 #define RL_HWREV_8169_8110SBL  0x7CC0
 #define RL_HWREV_8169_8110SCE  0x9800
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r206579 - stable/8/sys/pci

2010-04-13 Thread Pyun YongHyeon
Author: yongari
Date: Wed Apr 14 01:22:33 2010
New Revision: 206579
URL: http://svn.freebsd.org/changeset/base/206579

Log:
  MFC r206436:
Consistently use capital letters.

Modified:
  stable/8/sys/pci/if_rlreg.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/pci/if_rlreg.h
==
--- stable/8/sys/pci/if_rlreg.h Wed Apr 14 01:14:40 2010(r206578)
+++ stable/8/sys/pci/if_rlreg.h Wed Apr 14 01:22:33 2010(r206579)
@@ -160,7 +160,7 @@
 #define RL_HWREV_8169_8110SB   0x1000
 #define RL_HWREV_8169_8110SC   0x1800
 #define RL_HWREV_8102EL0x2480
-#define RL_HWREV_8102EL_SPIN1  0x24c0
+#define RL_HWREV_8102EL_SPIN1  0x24C0
 #define RL_HWREV_8168D 0x2800
 #define RL_HWREV_8168DP0x2880
 #define RL_HWREV_8168E 0x2C00
@@ -182,7 +182,7 @@
 #define RL_HWREV_8139C 0x7400
 #define RL_HWREV_8139D 0x7440
 #define RL_HWREV_8139CPLUS 0x7480
-#define RL_HWREV_8101  0x74c0
+#define RL_HWREV_8101  0x74C0
 #define RL_HWREV_8100  0x7880
 #define RL_HWREV_8169_8110SBL  0x7CC0
 #define RL_HWREV_8169_8110SCE  0x9800
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r206578 - in stable/7/sys: dev/re pci

2010-04-13 Thread Pyun YongHyeon
Author: yongari
Date: Wed Apr 14 01:14:40 2010
New Revision: 206578
URL: http://svn.freebsd.org/changeset/base/206578

Log:
  MFC r206433:
Add preliminary support for 8168E/8111E PCIe controller.
While I'm here simplify device description string.
  
Tested by:  Michael Beckmann < michael <> apfel dot de >

Modified:
  stable/7/sys/dev/re/if_re.c
  stable/7/sys/pci/if_rlreg.h
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/dev/re/if_re.c
==
--- stable/7/sys/dev/re/if_re.c Wed Apr 14 01:12:24 2010(r206577)
+++ stable/7/sys/dev/re/if_re.c Wed Apr 14 01:14:40 2010(r206578)
@@ -174,8 +174,7 @@ static struct rl_type re_devs[] = {
{ RT_VENDORID, RT_DEVICEID_8101E, 0,
"RealTek 8101E/8102E/8102EL/8103E PCIe 10/100baseTX" },
{ RT_VENDORID, RT_DEVICEID_8168, 0,
-   "RealTek 8168/8168B/8168C/8168CP/8168D/8168DP/"
-   "8111B/8111C/8111CP/8111DP PCIe Gigabit Ethernet" },
+   "RealTek 8168/8111 B/C/CP/D/DP/E PCIe Gigabit Ethernet" },
{ RT_VENDORID, RT_DEVICEID_8169, 0,
"RealTek 8169/8169S/8169SB(L)/8110S/8110SB(L) Gigabit Ethernet" },
{ RT_VENDORID, RT_DEVICEID_8169SC, 0,
@@ -220,6 +219,7 @@ static struct rl_hwrev re_hwrevs[] = {
{ RL_HWREV_8168CP, RL_8169, "8168CP/8111CP"},
{ RL_HWREV_8168D, RL_8169, "8168D/8111D"},
{ RL_HWREV_8168DP, RL_8169, "8168DP/8111DP"},
+   { RL_HWREV_8168E, RL_8169, "8168E/8111E"},
{ 0, 0, NULL }
 };
 
@@ -1311,6 +1311,11 @@ re_attach(device_t dev)
 */
sc->rl_flags |= RL_FLAG_NOJUMBO;
break;
+   case RL_HWREV_8168E:
+   sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PHYWAKE_PM |
+   RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT |
+   RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD | RL_FLAG_NOJUMBO;
+   break;
case RL_HWREV_8169_8110SB:
case RL_HWREV_8169_8110SBL:
case RL_HWREV_8169_8110SC:
@@ -1394,6 +1399,8 @@ re_attach(device_t dev)
}
 
/* Take PHY out of power down mode. */
+   if ((sc->rl_flags & RL_FLAG_PHYWAKE_PM) != 0)
+   CSR_WRITE_1(sc, RL_PMCH, CSR_READ_1(sc, RL_PMCH) | 0x80);
if ((sc->rl_flags & RL_FLAG_PHYWAKE) != 0) {
re_gmii_writereg(dev, 1, 0x1f, 0);
re_gmii_writereg(dev, 1, 0x0e, 0);
@@ -3129,6 +3136,9 @@ re_setwol(struct rl_softc *sc)
v |= RL_CFG5_WOL_LANWAKE;
CSR_WRITE_1(sc, RL_CFG5, v);
 
+   if ((ifp->if_capenable & IFCAP_WOL) != 0 &&
+   (sc->rl_flags & RL_FLAG_PHYWAKE_PM) != 0)
+   CSR_WRITE_1(sc, RL_PMCH, CSR_READ_1(sc, RL_PMCH) & ~0x80);
/*
 * It seems that hardware resets its link speed to 100Mbps in
 * power down mode so switching to 100Mbps in driver is not

Modified: stable/7/sys/pci/if_rlreg.h
==
--- stable/7/sys/pci/if_rlreg.h Wed Apr 14 01:12:24 2010(r206577)
+++ stable/7/sys/pci/if_rlreg.h Wed Apr 14 01:14:40 2010(r206578)
@@ -133,6 +133,7 @@
 #define RL_GMEDIASTAT  0x006C  /* 8 bits */
 #define RL_MACDBG  0x006D  /* 8 bits, 8168C SPIN2 only */
 #define RL_GPIO0x006E  /* 8 bits, 8168C SPIN2 only */
+#define RL_PMCH0x006F  /* 8 bits */
 #define RL_MAXRXPKTLEN 0x00DA  /* 16 bits, chip multiplies by 8 */
 #define RL_GTXSTART0x0038  /* 8 bits */
 
@@ -162,6 +163,7 @@
 #define RL_HWREV_8102EL_SPIN1  0x24c0
 #define RL_HWREV_8168D 0x2800
 #define RL_HWREV_8168DP0x2880
+#define RL_HWREV_8168E 0x2C00
 #define RL_HWREV_8168_SPIN10x3000
 #define RL_HWREV_8100E 0x3080
 #define RL_HWREV_8101E 0x3400
@@ -857,6 +859,7 @@ struct rl_softc {
uint32_trl_flags;
 #defineRL_FLAG_MSI 0x0001
 #defineRL_FLAG_AUTOPAD 0x0002
+#defineRL_FLAG_PHYWAKE_PM  0x0004
 #defineRL_FLAG_PHYWAKE 0x0008
 #defineRL_FLAG_NOJUMBO 0x0010
 #defineRL_FLAG_PAR 0x0020
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r206577 - in stable/8/sys: dev/re pci

2010-04-13 Thread Pyun YongHyeon
Author: yongari
Date: Wed Apr 14 01:12:24 2010
New Revision: 206577
URL: http://svn.freebsd.org/changeset/base/206577

Log:
  MFC r206433:
Add preliminary support for 8168E/8111E PCIe controller.
While I'm here simplify device description string.
  
Tested by:  Michael Beckmann < michael <> apfel dot de >

Modified:
  stable/8/sys/dev/re/if_re.c
  stable/8/sys/pci/if_rlreg.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/re/if_re.c
==
--- stable/8/sys/dev/re/if_re.c Wed Apr 14 01:09:14 2010(r206576)
+++ stable/8/sys/dev/re/if_re.c Wed Apr 14 01:12:24 2010(r206577)
@@ -174,8 +174,7 @@ static struct rl_type re_devs[] = {
{ RT_VENDORID, RT_DEVICEID_8101E, 0,
"RealTek 8101E/8102E/8102EL/8103E PCIe 10/100baseTX" },
{ RT_VENDORID, RT_DEVICEID_8168, 0,
-   "RealTek 8168/8168B/8168C/8168CP/8168D/8168DP/"
-   "8111B/8111C/8111CP/8111DP PCIe Gigabit Ethernet" },
+   "RealTek 8168/8111 B/C/CP/D/DP/E PCIe Gigabit Ethernet" },
{ RT_VENDORID, RT_DEVICEID_8169, 0,
"RealTek 8169/8169S/8169SB(L)/8110S/8110SB(L) Gigabit Ethernet" },
{ RT_VENDORID, RT_DEVICEID_8169SC, 0,
@@ -220,6 +219,7 @@ static struct rl_hwrev re_hwrevs[] = {
{ RL_HWREV_8168CP, RL_8169, "8168CP/8111CP"},
{ RL_HWREV_8168D, RL_8169, "8168D/8111D"},
{ RL_HWREV_8168DP, RL_8169, "8168DP/8111DP"},
+   { RL_HWREV_8168E, RL_8169, "8168E/8111E"},
{ 0, 0, NULL }
 };
 
@@ -1310,6 +1310,11 @@ re_attach(device_t dev)
 */
sc->rl_flags |= RL_FLAG_NOJUMBO;
break;
+   case RL_HWREV_8168E:
+   sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PHYWAKE_PM |
+   RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT |
+   RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD | RL_FLAG_NOJUMBO;
+   break;
case RL_HWREV_8169_8110SB:
case RL_HWREV_8169_8110SBL:
case RL_HWREV_8169_8110SC:
@@ -1393,6 +1398,8 @@ re_attach(device_t dev)
}
 
/* Take PHY out of power down mode. */
+   if ((sc->rl_flags & RL_FLAG_PHYWAKE_PM) != 0)
+   CSR_WRITE_1(sc, RL_PMCH, CSR_READ_1(sc, RL_PMCH) | 0x80);
if ((sc->rl_flags & RL_FLAG_PHYWAKE) != 0) {
re_gmii_writereg(dev, 1, 0x1f, 0);
re_gmii_writereg(dev, 1, 0x0e, 0);
@@ -3135,6 +3142,9 @@ re_setwol(struct rl_softc *sc)
v |= RL_CFG5_WOL_LANWAKE;
CSR_WRITE_1(sc, RL_CFG5, v);
 
+   if ((ifp->if_capenable & IFCAP_WOL) != 0 &&
+   (sc->rl_flags & RL_FLAG_PHYWAKE_PM) != 0)
+   CSR_WRITE_1(sc, RL_PMCH, CSR_READ_1(sc, RL_PMCH) & ~0x80);
/*
 * It seems that hardware resets its link speed to 100Mbps in
 * power down mode so switching to 100Mbps in driver is not

Modified: stable/8/sys/pci/if_rlreg.h
==
--- stable/8/sys/pci/if_rlreg.h Wed Apr 14 01:09:14 2010(r206576)
+++ stable/8/sys/pci/if_rlreg.h Wed Apr 14 01:12:24 2010(r206577)
@@ -133,6 +133,7 @@
 #define RL_GMEDIASTAT  0x006C  /* 8 bits */
 #define RL_MACDBG  0x006D  /* 8 bits, 8168C SPIN2 only */
 #define RL_GPIO0x006E  /* 8 bits, 8168C SPIN2 only */
+#define RL_PMCH0x006F  /* 8 bits */
 #define RL_MAXRXPKTLEN 0x00DA  /* 16 bits, chip multiplies by 8 */
 #define RL_GTXSTART0x0038  /* 8 bits */
 
@@ -162,6 +163,7 @@
 #define RL_HWREV_8102EL_SPIN1  0x24c0
 #define RL_HWREV_8168D 0x2800
 #define RL_HWREV_8168DP0x2880
+#define RL_HWREV_8168E 0x2C00
 #define RL_HWREV_8168_SPIN10x3000
 #define RL_HWREV_8100E 0x3080
 #define RL_HWREV_8101E 0x3400
@@ -884,6 +886,7 @@ struct rl_softc {
uint32_trl_flags;
 #defineRL_FLAG_MSI 0x0001
 #defineRL_FLAG_AUTOPAD 0x0002
+#defineRL_FLAG_PHYWAKE_PM  0x0004
 #defineRL_FLAG_PHYWAKE 0x0008
 #defineRL_FLAG_NOJUMBO 0x0010
 #defineRL_FLAG_PAR 0x0020
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r206576 - stable/7/sys/dev/msk

2010-04-13 Thread Pyun YongHyeon
Author: yongari
Date: Wed Apr 14 01:09:14 2010
New Revision: 206576
URL: http://svn.freebsd.org/changeset/base/206576

Log:
  MFC r206364:
Partial revert r204545.
Just relying on status LE ownership of status block seems to cause
poor performance. Always read current status index register first
and then check status ownership as we had before. Accessing status
index register seems to trigger immediate status update if
controller have pending status updates.
  
Reported by:Andre Albsmeier  siemens dot com>
Tested by:  Andre Albsmeier  siemens dot com>

Modified:
  stable/7/sys/dev/msk/if_msk.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/dev/msk/if_msk.c
==
--- stable/7/sys/dev/msk/if_msk.c   Wed Apr 14 00:50:18 2010
(r206575)
+++ stable/7/sys/dev/msk/if_msk.c   Wed Apr 14 01:09:14 2010
(r206576)
@@ -3327,6 +3327,9 @@ msk_handle_events(struct msk_softc *sc)
uint32_t control, status;
int cons, len, port, rxprog;
 
+   if (sc->msk_stat_cons == CSR_READ_2(sc, STAT_PUT_IDX))
+   return (0);
+
/* Sync status LEs. */
bus_dmamap_sync(sc->msk_stat_tag, sc->msk_stat_map,
BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
@@ -3407,7 +3410,7 @@ msk_handle_events(struct msk_softc *sc)
if (rxput[MSK_PORT_B] > 0)
msk_rxput(sc->msk_if[MSK_PORT_B]);
 
-   return (rxprog > sc->msk_process_limit ? EAGAIN : 0);
+   return (sc->msk_stat_cons != CSR_READ_2(sc, STAT_PUT_IDX));
 }
 
 static void
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r206575 - stable/8/sys/dev/msk

2010-04-13 Thread Pyun YongHyeon
Author: yongari
Date: Wed Apr 14 00:50:18 2010
New Revision: 206575
URL: http://svn.freebsd.org/changeset/base/206575

Log:
  MFC r206364:
Partial revert r204545.
Just relying on status LE ownership of status block seems to cause
poor performance. Always read current status index register first
and then check status ownership as we had before. Accessing status
index register seems to trigger immediate status update if
controller have pending status updates.
  
Reported by:Andre Albsmeier  siemens dot com>
Tested by:  Andre Albsmeier  siemens dot com>

Modified:
  stable/8/sys/dev/msk/if_msk.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/msk/if_msk.c
==
--- stable/8/sys/dev/msk/if_msk.c   Wed Apr 14 00:50:09 2010
(r206574)
+++ stable/8/sys/dev/msk/if_msk.c   Wed Apr 14 00:50:18 2010
(r206575)
@@ -3327,6 +3327,9 @@ msk_handle_events(struct msk_softc *sc)
uint32_t control, status;
int cons, len, port, rxprog;
 
+   if (sc->msk_stat_cons == CSR_READ_2(sc, STAT_PUT_IDX))
+   return (0);
+
/* Sync status LEs. */
bus_dmamap_sync(sc->msk_stat_tag, sc->msk_stat_map,
BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
@@ -3407,7 +3410,7 @@ msk_handle_events(struct msk_softc *sc)
if (rxput[MSK_PORT_B] > 0)
msk_rxput(sc->msk_if[MSK_PORT_B]);
 
-   return (rxprog > sc->msk_process_limit ? EAGAIN : 0);
+   return (sc->msk_stat_cons != CSR_READ_2(sc, STAT_PUT_IDX));
 }
 
 static void
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r206571 - head/sbin/mca

2010-04-13 Thread Marcel Moolenaar
Author: marcel
Date: Tue Apr 13 22:27:39 2010
New Revision: 206571
URL: http://svn.freebsd.org/changeset/base/206571

Log:
  The sequence number is now a node under which the MCA records are
  hung by CPU id.
  When showing the MCA record, print the MIB as a comment.
  
  PR:   ia64/113102

Modified:
  head/sbin/mca/mca.c

Modified: head/sbin/mca/mca.c
==
--- head/sbin/mca/mca.c Tue Apr 13 22:20:12 2010(r206570)
+++ head/sbin/mca/mca.c Tue Apr 13 22:27:39 2010(r206571)
@@ -53,10 +53,12 @@ __FBSDID("$FreeBSD$");
 
 #defineBCD(x)  ((x >> 4) * 10 + (x & 15))
 
+#defineHW_MCA_MAX_CPUID255
+
 static char hw_mca_count[] = "hw.mca.count";
 static char hw_mca_first[] = "hw.mca.first";
 static char hw_mca_last[] = "hw.mca.last";
-static char hw_mca_recid[] = "hw.mca.%d";
+static char hw_mca_recid[] = "hw.mca.%lu.%u";
 
 static char default_dumpfile[] = "/var/log/mca.log";
 
@@ -372,10 +374,13 @@ show_section(struct mca_section_header *
 }
 
 static void
-show(char *data)
+show(char *data, const char *mib)
 {
size_t reclen, seclen;
 
+   if (mib != NULL)
+   printf("\n", mib);
+
printf("\n");
reclen = show_header((void*)data) - sizeof(struct mca_record_header);
data += sizeof(struct mca_record_header);
@@ -402,7 +407,7 @@ showall(char *buf, size_t buflen)
if (buflen < reclen)
return;
 
-   show(buf);
+   show(buf, NULL);
 
buf += reclen;
buflen -= reclen;
@@ -442,7 +447,7 @@ main(int argc, char **argv)
char *buf;
size_t len;
int ch, error, fd;
-   int count, first, last;
+   int count, first, last, cpuid;
 
while ((ch = getopt(argc, argv, "df:")) != -1) {
switch(ch) {
@@ -481,12 +486,19 @@ main(int argc, char **argv)
if (error)
err(1, hw_mca_last);
 
+   cpuid = 0;
while (count && first <= last) {
-   sprintf(mib, hw_mca_recid, first);
-   len = 0;
-   error = sysctlbyname(mib, NULL, &len, NULL, 0);
-   if (error == ENOENT) {
+   do {
+   sprintf(mib, hw_mca_recid, first, cpuid);
+   len = 0;
+   error = sysctlbyname(mib, NULL, &len, NULL, 0);
+   if (error != ENOENT)
+   break;
+   cpuid++;
+   } while (cpuid <= HW_MCA_MAX_CPUID);
+   if (error == ENOENT && cpuid > HW_MCA_MAX_CPUID) {
first++;
+   cpuid = 0;
continue;
}
if (error)
@@ -503,11 +515,15 @@ main(int argc, char **argv)
if (fl_dump)
dump(buf);
else
-   show(buf);
+   show(buf, mib);
 
free(buf);
-   first++;
count--;
+   if (cpuid == HW_MCA_MAX_CPUID) {
+   first++;
+   cpuid = 0;
+   } else
+   cpuid++;
}
} else {
fd = open(file, O_RDONLY);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r206570 - in head/sys/ia64: ia64 include

2010-04-13 Thread Marcel Moolenaar
Author: marcel
Date: Tue Apr 13 22:20:12 2010
New Revision: 206570
URL: http://svn.freebsd.org/changeset/base/206570

Log:
  Populate the sysctl tree with any MCA records we collected.
  The sequence number is used as the name of a sysctl node,
  under which we add the MCA records using the CPU id as the
  leaf  name.
  
  Add the hw.mca.inject sysctl to provide a way to inject
  MC errors and trigger machine checks.
  
  PR:   ia64/113102

Modified:
  head/sys/ia64/ia64/mca.c
  head/sys/ia64/include/mca.h

Modified: head/sys/ia64/ia64/mca.c
==
--- head/sys/ia64/ia64/mca.cTue Apr 13 21:32:06 2010(r206569)
+++ head/sys/ia64/ia64/mca.cTue Apr 13 22:20:12 2010(r206570)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2002 Marcel Moolenaar
+ * Copyright (c) 2002-2010 Marcel Moolenaar
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -37,6 +37,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -44,19 +45,19 @@ MALLOC_DEFINE(M_MCA, "MCA", "Machine Che
 
 struct mca_info {
STAILQ_ENTRY(mca_info) mi_link;
-   charmi_name[32];
+   u_long  mi_seqnr;
+   u_int   mi_cpuid;
size_t  mi_recsz;
charmi_record[0];
 };
 
-static STAILQ_HEAD(, mca_info) mca_records =
-STAILQ_HEAD_INITIALIZER(mca_records);
+STAILQ_HEAD(mca_info_list, mca_info);
 
-int64_tmca_info_size[SAL_INFO_TYPES];
-vm_offset_tmca_info_block;
-struct mtx mca_info_block_lock;
+static int64_t mca_info_size[SAL_INFO_TYPES];
+static vm_offset_t mca_info_block;
+static struct mtx  mca_info_block_lock;
 
-SYSCTL_NODE(_hw, OID_AUTO, mca, CTLFLAG_RW, 0, "MCA container");
+SYSCTL_NODE(_hw, OID_AUTO, mca, CTLFLAG_RW, NULL, "MCA container");
 
 static int mca_count;  /* Number of records stored. */
 static int mca_first;  /* First (lowest) record ID. */
@@ -69,6 +70,32 @@ SYSCTL_INT(_hw_mca, OID_AUTO, first, CTL
 SYSCTL_INT(_hw_mca, OID_AUTO, last, CTLFLAG_RD, &mca_last, 0,
 "Last record id");
 
+static struct mtx mca_sysctl_lock;
+
+static int
+mca_sysctl_inject(SYSCTL_HANDLER_ARGS)
+{
+   struct ia64_pal_result res;
+   u_int val;
+   int error;
+
+   val = 0;
+   error = sysctl_wire_old_buffer(req, sizeof(u_int));
+   if (!error)
+   error = sysctl_handle_int(oidp, &val, 0, req);
+
+   if (error != 0 || req->newptr == NULL)
+   return (error);
+
+   /* For example: val=137 causes a fatal CPU error. */
+   res = ia64_call_pal_stacked(PAL_MC_ERROR_INJECT, val, 0, 0);
+   printf("%s: %#lx, %#lx, %#lx, %#lx\n", __func__, res.pal_status,
+   res.pal_result[0], res.pal_result[1], res.pal_result[2]);
+   return (0);
+}
+SYSCTL_PROC(_hw_mca, OID_AUTO, inject, CTLTYPE_INT | CTLFLAG_RW, NULL, 0,
+mca_sysctl_inject, "I", "set to trigger a MCA");
+
 static int
 mca_sysctl_handler(SYSCTL_HANDLER_ARGS)
 {
@@ -85,27 +112,8 @@ mca_sysctl_handler(SYSCTL_HANDLER_ARGS)
return (error);
 }
 
-void
-ia64_mca_populate(void)
-{
-   struct mca_info *rec;
-
-   mtx_lock_spin(&mca_info_block_lock);
-   while (!STAILQ_EMPTY(&mca_records)) {
-   rec = STAILQ_FIRST(&mca_records);
-   STAILQ_REMOVE_HEAD(&mca_records, mi_link);
-   mtx_unlock_spin(&mca_info_block_lock);
-   (void)SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_mca),
-   OID_AUTO, rec->mi_name, CTLTYPE_OPAQUE | CTLFLAG_RD,
-   rec->mi_record, rec->mi_recsz, mca_sysctl_handler, "S,MCA",
-   "Error record");
-   mtx_lock_spin(&mca_info_block_lock);
-   }
-   mtx_unlock_spin(&mca_info_block_lock);
-}
-
-void
-ia64_mca_save_state(int type)
+static void
+ia64_mca_collect_state(int type, struct mca_info_list *reclst)
 {
struct ia64_sal_result result;
struct mca_record_header *hdr;
@@ -123,13 +131,13 @@ ia64_mca_save_state(int type)
if (mca_info_block == 0)
return;
 
-   mtx_lock_spin(&mca_info_block_lock);
while (1) {
+   mtx_lock_spin(&mca_info_block_lock);
result = ia64_sal_entry(SAL_GET_STATE_INFO, type, 0,
mca_info_block, 0, 0, 0, 0);
if (result.sal_status < 0) {
mtx_unlock_spin(&mca_info_block_lock);
-   return;
+   break;
}
 
hdr = (struct mca_record_header *)mca_info_block;
@@ -142,9 +150,10 @@ ia64_mca_save_state(int type)
M_NOWAIT | M_ZERO);
if (rec == NULL)
/* XXX: Not sure what to do. */
-   return;
+   break;
 
-   sprintf(rec->mi_name, "%lld", (long long)seqnr);
+   rec->mi_seqnr = seqnr;
+ 

svn commit: r206569 - in head/sys/modules: . uart

2010-04-13 Thread Warner Losh
Author: imp
Date: Tue Apr 13 21:32:06 2010
New Revision: 206569
URL: http://svn.freebsd.org/changeset/base/206569

Log:
  Only compile in uart_cpu_$MACHINE.c if it exists.  I'm not sure how
  useful it will be, but we really need to be keying off something other
  than MACHINE for this anyway since on arm and mips we have lots of
  these running around (one for each SoC family)...

Modified:
  head/sys/modules/Makefile
  head/sys/modules/uart/Makefile

Modified: head/sys/modules/Makefile
==
--- head/sys/modules/Makefile   Tue Apr 13 20:50:59 2010(r206568)
+++ head/sys/modules/Makefile   Tue Apr 13 21:32:06 2010(r206569)
@@ -280,7 +280,7 @@ SUBDIR= ${_3dfx} \
twe \
tx \
txp \
-   ${_uart} \
+   uart \
ubsec \
udf \
udf_iconv \
@@ -323,8 +323,6 @@ _vpo=   vpo
 # no BUS_SPACE_UNSPECIFIED
 # No barrier instruction support (specific to this driver)
 _sym=  sym
-# no uart_cpu_$MACHINE_ARCH
-_uart= uart
 # intr_disable() is a macro, causes problems
 _cxgb= cxgb
 .endif

Modified: head/sys/modules/uart/Makefile
==
--- head/sys/modules/uart/Makefile  Tue Apr 13 20:50:59 2010
(r206568)
+++ head/sys/modules/uart/Makefile  Tue Apr 13 21:32:06 2010
(r206569)
@@ -16,7 +16,7 @@ SRCS= uart_bus_acpi.c ${uart_bus_ebus} u
uart_if.c uart_if.h uart_subr.c uart_tty.c
 .if ${MACHINE} == "sun4v"
 SRCS+= uart_cpu_sparc64.c
-.else
+.elif exists(${CURDIR}/uart_cpu_${MACHINE}.c)
 SRCS+= uart_cpu_${MACHINE}.c
 .endif
 SRCS+= bus_if.h card_if.h device_if.h isa_if.h ${ofw_bus_if} pci_if.h \
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r206568 - head/usr.bin/calendar/calendars

2010-04-13 Thread Edwin Groothuis
Author: edwin
Date: Tue Apr 13 20:50:59 2010
New Revision: 206568
URL: http://svn.freebsd.org/changeset/base/206568

Log:
  Allerheilingen -> Allerheiligen
  
  Submitted by: Ronald Klop 

Modified:
  head/usr.bin/calendar/calendars/calendar.dutch

Modified: head/usr.bin/calendar/calendars/calendar.dutch
==
--- head/usr.bin/calendar/calendars/calendar.dutch  Tue Apr 13 20:47:11 
2010(r206567)
+++ head/usr.bin/calendar/calendars/calendar.dutch  Tue Apr 13 20:50:59 
2010(r206568)
@@ -18,7 +18,7 @@ mei/01Dag van de Arbeid
 mei/04 Dodenherdenking
 mei/05 Bevrijdingsdag
 okt/04 Dierendag
-nov/01 Allerheilingen
+nov/01 Allerheiligen
 nov/02 Allerzielen
 nov/11 Sint Maarten
 nov/11 Elfde-van-de-elfde
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r206567 - in stable/7/games/fortune: . datfiles

2010-04-13 Thread Doug Barton
Author: dougb
Date: Tue Apr 13 20:47:11 2010
New Revision: 206567
URL: http://svn.freebsd.org/changeset/base/206567

Log:
  MFC r205995:
  
  Massive cleanup and synchronization with other *BSDs

Modified:
  stable/7/games/fortune/Notes
  stable/7/games/fortune/datfiles/fortunes
  stable/7/games/fortune/datfiles/fortunes-o.real
  stable/7/games/fortune/datfiles/fortunes.sp.ok
  stable/7/games/fortune/datfiles/limerick
  stable/7/games/fortune/datfiles/startrek
  stable/7/games/fortune/datfiles/zippy
Directory Properties:
  stable/7/games/fortune/   (props changed)
  stable/7/games/fortune/datfiles/   (props changed)
  stable/7/games/fortune/datfiles/freebsd-tips   (props changed)
  stable/7/games/fortune/fortune/   (props changed)

Modified: stable/7/games/fortune/Notes
==
--- stable/7/games/fortune/NotesTue Apr 13 20:44:16 2010
(r206566)
+++ stable/7/games/fortune/NotesTue Apr 13 20:47:11 2010
(r206567)
@@ -19,13 +19,13 @@ Warning:
 /usr/share/games/fortune.  A fortune file has two parts: the source file
 (which contains the fortunes themselves) and the data file which describes
 the fortunes.  The data file always has the same name as the fortune file
-with the string ".dat" concatenated, i.e. "fort" is the standard fortune
-database, and "fort.dat" is the data file which describes it.  See
+with the string ".dat" concatenated, i.e. "fortunes" is the standard fortune
+database, and "fortunes.dat" is the data file which describes it.  See
 strfile(8) for more information on creating the data files.
Fortunes are split into potentially offensive and not potentially
 offensive parts.  The offensive version of a file has the same name as the
-non-offensive version with "-o" concatenated, i.e. "fort" is the standard
-fortune database, and "fort-o" is the standard offensive database.  The
+non-offensive version with "-o" concatenated, i.e. "fortunes" is the standard
+fortune database, and "fortunes-o" is the standard offensive database.  The
 fortune program automatically assumes that any file with a name ending in
 "-o" is potentially offensive, and should therefore only be displayed if
 explicitly requested, either with the -o option or by specifying a file name
@@ -42,10 +42,10 @@ MUST be in the potentially offensive dat
 explicit language (see George Carlin's recent updated list) MUST be in the
 potentially offensive database.  Political and religious opinions are often
 sequestered in the potentially offensive section as well.  Anything which
-assumes as a world view blatantly racist, mysogynist (sexist), or homophobic
+assumes as a world view blatantly racist, misogynist (sexist), or homophobic
 ideas should not be in either, since they are not really funny unless *you*
-are racist, mysogynist, or homophobic.
-   The point of this is that people have should have a reasonable
+are racist, misogynist, or homophobic.
+   The point of this is that people should have a reasonable
 expectation that, should they just run "fortune", they will not be offended.
 We know that some people take offense at anything, but normal people do have
 opinions, too, and have a right not to have their sensibilities offended by
@@ -53,7 +53,7 @@ a program which is supposed to be entert
 -o" or "fortune -a" are saying, in effect, that they are willing to have
 their sensibilities tweaked.  However, they should not have their personal
 worth seriously (i.e., not in jest) assaulted.  Jokes which depend for their
-humor on racist, mysogynist, or homophobic stereotypes *do* seriously
+humor on racist, misogynist, or homophobic stereotypes *do* seriously
 assault individual personal worth, and in a general entertainment medium
 we should be able to get by without it.
 

Modified: stable/7/games/fortune/datfiles/fortunes
==
--- stable/7/games/fortune/datfiles/fortunesTue Apr 13 20:44:16 2010
(r206566)
+++ stable/7/games/fortune/datfiles/fortunesTue Apr 13 20:47:11 2010
(r206567)
@@ -368,8 +368,10 @@ OR'd together, outta sight!
Double bucky, I'd like a whole word of
Double bucky, I'm happy I heard of
Double bucky, I'd like a whole word of you!
-
-   -- (C) 1978 by Guy L. Steele, Jr.
+   -- Guy L. Steele, Jr., (C) 1978
+   (to Nicholas Wirth, who suggested that an extra bit
+   be added to terminal codes on 36-bit machines for use
+   by screen editors.)
 %
Hard Copies and Chmod
 
@@ -834,7 +836,7 @@ would like on it.  "Here lies an honest 
 lawyer.
"Sorry, but I can't do that," replied the stonecutter.  "In this
 state, it's against the law to bury two people in the same grave.  However,
-I could put ``here lies an honest lawyer'', if that would be okay."
+I could put `here lies an honest lawyer', if that would 

svn commit: r206566 - in stable/8/games/fortune: . datfiles

2010-04-13 Thread Doug Barton
Author: dougb
Date: Tue Apr 13 20:44:16 2010
New Revision: 206566
URL: http://svn.freebsd.org/changeset/base/206566

Log:
  MFC r205995:
  
  Massive cleanup and synchronization with other *BSDs

Modified:
  stable/8/games/fortune/Notes
  stable/8/games/fortune/datfiles/fortunes
  stable/8/games/fortune/datfiles/fortunes-o.real
  stable/8/games/fortune/datfiles/fortunes.sp.ok
  stable/8/games/fortune/datfiles/limerick
  stable/8/games/fortune/datfiles/startrek
  stable/8/games/fortune/datfiles/zippy
Directory Properties:
  stable/8/games/fortune/   (props changed)
  stable/8/games/fortune/datfiles/   (props changed)

Modified: stable/8/games/fortune/Notes
==
--- stable/8/games/fortune/NotesTue Apr 13 20:36:54 2010
(r206565)
+++ stable/8/games/fortune/NotesTue Apr 13 20:44:16 2010
(r206566)
@@ -19,13 +19,13 @@ Warning:
 /usr/share/games/fortune.  A fortune file has two parts: the source file
 (which contains the fortunes themselves) and the data file which describes
 the fortunes.  The data file always has the same name as the fortune file
-with the string ".dat" concatenated, i.e. "fort" is the standard fortune
-database, and "fort.dat" is the data file which describes it.  See
+with the string ".dat" concatenated, i.e. "fortunes" is the standard fortune
+database, and "fortunes.dat" is the data file which describes it.  See
 strfile(8) for more information on creating the data files.
Fortunes are split into potentially offensive and not potentially
 offensive parts.  The offensive version of a file has the same name as the
-non-offensive version with "-o" concatenated, i.e. "fort" is the standard
-fortune database, and "fort-o" is the standard offensive database.  The
+non-offensive version with "-o" concatenated, i.e. "fortunes" is the standard
+fortune database, and "fortunes-o" is the standard offensive database.  The
 fortune program automatically assumes that any file with a name ending in
 "-o" is potentially offensive, and should therefore only be displayed if
 explicitly requested, either with the -o option or by specifying a file name
@@ -42,10 +42,10 @@ MUST be in the potentially offensive dat
 explicit language (see George Carlin's recent updated list) MUST be in the
 potentially offensive database.  Political and religious opinions are often
 sequestered in the potentially offensive section as well.  Anything which
-assumes as a world view blatantly racist, mysogynist (sexist), or homophobic
+assumes as a world view blatantly racist, misogynist (sexist), or homophobic
 ideas should not be in either, since they are not really funny unless *you*
-are racist, mysogynist, or homophobic.
-   The point of this is that people have should have a reasonable
+are racist, misogynist, or homophobic.
+   The point of this is that people should have a reasonable
 expectation that, should they just run "fortune", they will not be offended.
 We know that some people take offense at anything, but normal people do have
 opinions, too, and have a right not to have their sensibilities offended by
@@ -53,7 +53,7 @@ a program which is supposed to be entert
 -o" or "fortune -a" are saying, in effect, that they are willing to have
 their sensibilities tweaked.  However, they should not have their personal
 worth seriously (i.e., not in jest) assaulted.  Jokes which depend for their
-humor on racist, mysogynist, or homophobic stereotypes *do* seriously
+humor on racist, misogynist, or homophobic stereotypes *do* seriously
 assault individual personal worth, and in a general entertainment medium
 we should be able to get by without it.
 

Modified: stable/8/games/fortune/datfiles/fortunes
==
--- stable/8/games/fortune/datfiles/fortunesTue Apr 13 20:36:54 2010
(r206565)
+++ stable/8/games/fortune/datfiles/fortunesTue Apr 13 20:44:16 2010
(r206566)
@@ -368,8 +368,10 @@ OR'd together, outta sight!
Double bucky, I'd like a whole word of
Double bucky, I'm happy I heard of
Double bucky, I'd like a whole word of you!
-
-   -- (C) 1978 by Guy L. Steele, Jr.
+   -- Guy L. Steele, Jr., (C) 1978
+   (to Nicholas Wirth, who suggested that an extra bit
+   be added to terminal codes on 36-bit machines for use
+   by screen editors.)
 %
Hard Copies and Chmod
 
@@ -834,7 +836,7 @@ would like on it.  "Here lies an honest 
 lawyer.
"Sorry, but I can't do that," replied the stonecutter.  "In this
 state, it's against the law to bury two people in the same grave.  However,
-I could put ``here lies an honest lawyer'', if that would be okay."
+I could put `here lies an honest lawyer', if that would be okay."
"But that won't let people know who it is" protested the lawyer.
"Certainly will," retorted

svn commit: r206565 - stable/8/etc

2010-04-13 Thread Doug Barton
Author: dougb
Date: Tue Apr 13 20:36:54 2010
New Revision: 206565
URL: http://svn.freebsd.org/changeset/base/206565

Log:
  MFC r206248:
  
  Change where we nap so that if pwait(1) returns but kill -0 still sees
  a zombie we don't print an endless string of the same pid number until
  the zombie exits.
  
  While I'm here, local'ize the variables that this function uses.

Modified:
  stable/8/etc/rc.subr
Directory Properties:
  stable/8/etc/   (props changed)

Modified: stable/8/etc/rc.subr
==
--- stable/8/etc/rc.subrTue Apr 13 20:33:34 2010(r206564)
+++ stable/8/etc/rc.subrTue Apr 13 20:36:54 2010(r206565)
@@ -372,6 +372,8 @@ _find_processes()
 #
 wait_for_pids()
 {
+   local _list _prefix _nlist _j
+
_list="$@"
if [ -z "$_list" ]; then
return
@@ -382,6 +384,7 @@ wait_for_pids()
for _j in $_list; do
if kill -0 $_j 2>/dev/null; then
_nlist="${_nlist}${_nlist:+ }$_j"
+   [ -n "$_prefix" ] && sleep 1
fi
done
if [ -z "$_nlist" ]; then
@@ -390,7 +393,7 @@ wait_for_pids()
_list=$_nlist
echo -n ${_prefix:-"Waiting for PIDS: "}$_list
_prefix=", "
-   pwait $_list 2>/dev/null || sleep 2
+   pwait $_list 2>/dev/null
done
if [ -n "$_prefix" ]; then
echo "."
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r206564 - in stable/8/etc: . mtree

2010-04-13 Thread Doug Barton
Author: dougb
Date: Tue Apr 13 20:33:34 2010
New Revision: 206564
URL: http://svn.freebsd.org/changeset/base/206564

Log:
  Pull mergeinfo from r201203 up into the etc directory

Modified:
Directory Properties:
  stable/8/etc/   (props changed)
  stable/8/etc/mtree/   (props changed)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r206563 - head/sys/dev/mii

2010-04-13 Thread Pyun YongHyeon
Author: yongari
Date: Tue Apr 13 20:07:52 2010
New Revision: 206563
URL: http://svn.freebsd.org/changeset/base/206563

Log:
  Add Agere ET1011 PHY which is found on Belkin F5D5055 USB
  controller. Unlike Agere ET1011C, Agere ET1011 does not seem to
  need special DSP programming to workaround silicon bug.

Modified:
  head/sys/dev/mii/miidevs
  head/sys/dev/mii/truephy.c

Modified: head/sys/dev/mii/miidevs
==
--- head/sys/dev/mii/miidevsTue Apr 13 19:58:32 2010(r206562)
+++ head/sys/dev/mii/miidevsTue Apr 13 20:07:52 2010(r206563)
@@ -102,6 +102,7 @@ oui xxREALTEK   0x000732
  */
 
 /* Agere Systems PHYs */
+model AGERE ET1011 0x0001 ET1011 10/100/1000baseT PHY
 model AGERE ET1011C0x0004 ET1011C 10/100/1000baseT PHY
 
 /* Altima Communications PHYs */

Modified: head/sys/dev/mii/truephy.c
==
--- head/sys/dev/mii/truephy.c  Tue Apr 13 19:58:32 2010(r206562)
+++ head/sys/dev/mii/truephy.c  Tue Apr 13 20:07:52 2010(r206563)
@@ -76,6 +76,7 @@ static device_method_t truephy_methods[]
 };
 
 static const struct mii_phydesc truephys[] = {
+   MII_PHY_DESC(AGERE, ET1011),
MII_PHY_DESC(AGERE, ET1011C),
MII_PHY_END
 };
@@ -161,7 +162,10 @@ truephy_attach(device_t dev)
 
mii->mii_instance++;
 
-   truephy_reset(sc);
+   if (MII_MODEL(ma->mii_id2) == MII_MODEL_AGERE_ET1011)
+   mii_phy_reset(sc);
+   else
+   truephy_reset(sc);
 
sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask;
if (sc->mii_capabilities & BMSR_EXTSTAT) {
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r206561 - stable/7/sys/dev/usb

2010-04-13 Thread Nick Hibma
Author: n_hibma
Date: Tue Apr 13 19:43:16 2010
New Revision: 206561
URL: http://svn.freebsd.org/changeset/base/206561

Log:
  Make the list of allocated ports dynamic. The Option GTM382 has 10
  serial ports (yes, 10, it has a built in GPS and other stuff) and we
  need to access the last one for PPP access to the card. Other ports
  are HSO (Option specific protocol; see Linux driver).
  
  Reviewed by:  thompsa

Modified:
  stable/7/sys/dev/usb/u3g.c

Modified: stable/7/sys/dev/usb/u3g.c
==
--- stable/7/sys/dev/usb/u3g.c  Tue Apr 13 18:53:39 2010(r206560)
+++ stable/7/sys/dev/usb/u3g.c  Tue Apr 13 19:43:16 2010(r206561)
@@ -58,10 +58,8 @@ SYSCTL_INT(_hw_usb_u3g, OID_AUTO, debug,
   &u3gdebug, 0, "u3g debug level");
 #define DPRINTF(x...)  if (u3gdebug) device_printf(sc->sc_dev, ##x)
 
-#define U3G_MAXPORTS   6
-
 struct u3g_softc {
-   struct ucom_softc   sc_ucom[U3G_MAXPORTS];
+   struct ucom_softc   *sc_ucom;
device_tsc_dev;
usbd_device_handle  sc_udev;
u_int8_tsc_speed;
@@ -254,9 +252,8 @@ u3g_attach(device_t self)
sc->sc_init = u3g_dev_type->init;
sc->sc_speed = u3g_dev_type->speed;
 
-   sprintf(devnamefmt,"U%d.%%d", device_get_unit(self));
int portno = 0;
-   for (i = 0; i < uaa->nifaces && portno < U3G_MAXPORTS; i++) {
+   for (i = 0; i < uaa->nifaces; i++) {
DPRINTF("Interface %d of %d, %sin use\n",
i, uaa->nifaces,
(uaa->ifaces[i]? "not ":""));
@@ -279,7 +276,7 @@ u3g_attach(device_t self)
 
int bulkin_no = -1, bulkout_no = -1;
int claim_iface = 0;
-   for (n = 0; n < id->bNumEndpoints && portno < U3G_MAXPORTS; 
n++) {
+   for (n = 0; n < id->bNumEndpoints; n++) {
ed = usbd_interface2endpoint_descriptor(uaa->ifaces[i], 
n);
DPRINTF(" Endpoint %d of %d%s\n",
n, id->bNumEndpoints,
@@ -298,6 +295,7 @@ u3g_attach(device_t self)
 * the bulk-in and bulk-out endpoints appear in pairs.
 */
if (bulkin_no != -1 && bulkout_no != -1) {
+   sc->sc_ucom = realloc(sc->sc_ucom, 
(portno+1)*sizeof(struct ucom_softc), M_USBDEV, M_WAITOK);
struct ucom_softc *ucom = &sc->sc_ucom[portno];
 
ucom->sc_dev = self;
@@ -318,13 +316,6 @@ u3g_attach(device_t self)
 portno, i,
 ucom->sc_bulkin_no,
 ucom->sc_bulkout_no);
-#if __FreeBSD_version < 70
-   ucom_attach_tty(ucom, MINOR_CALLOUT, 
devnamefmt, portno);
-#elif __FreeBSD_version < 80
-   ucom_attach_tty(ucom, TS_CALLOUT, devnamefmt, 
portno);
-#else
-   ucom_attach_tty(ucom, devnamefmt, portno);
-#endif
 
claim_iface = 1;
portno++;
@@ -336,6 +327,19 @@ u3g_attach(device_t self)
}
sc->sc_numports = portno;
 
+   sprintf(devnamefmt,"U%d.%%d", device_get_unit(self));
+   for (portno = 0; portno < sc->sc_numports; portno++) {
+   struct ucom_softc *ucom = &sc->sc_ucom[portno];
+
+#if __FreeBSD_version < 70
+   ucom_attach_tty(ucom, MINOR_CALLOUT, devnamefmt, portno);
+#elif __FreeBSD_version < 80
+   ucom_attach_tty(ucom, TS_CALLOUT, devnamefmt, portno);
+#else
+   ucom_attach_tty(ucom, devnamefmt, portno);
+#endif
+   }
+
device_printf(self, "configured %d serial ports (%s)\n",
  sc->sc_numports, devnamefmt);
return 0;
@@ -357,6 +361,9 @@ u3g_detach(device_t self)
}
}
 
+   if (sc->sc_ucom)
+   free(sc->sc_ucom, M_USBDEV);
+
return 0;
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r206497 - in head: sbin/geom/class sbin/geom/class/sched sys/geom/sched sys/modules/geom sys/modules/geom/geom_sched sys/modules/geom/geom_sched/gs_sched sys/modules/geom/geom_sched/gs

2010-04-13 Thread Luigi Rizzo
On Tue, Apr 13, 2010 at 09:35:00PM +0200, Roman Divacky wrote:
> you dont seem to have commited the anticipatory scheduler gsched_as.
> 
> why?

gsched_rr has anticipation too, and is the "production quality" one,
so i only included that one in the svn repository.

You can find other schedulers in the tarball on the web page,
but gsched_as is only a proof of concept, and others need more
debugging and cleanup before being imported.

cheers
luigi
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r206497 - in head: sbin/geom/class sbin/geom/class/sched sys/geom/sched sys/modules/geom sys/modules/geom/geom_sched sys/modules/geom/geom_sched/gs_sched sys/modules/geom/geom_sched/gs

2010-04-13 Thread Roman Divacky
you dont seem to have commited the anticipatory scheduler gsched_as.

why?

On Mon, Apr 12, 2010 at 04:37:45PM +, Luigi Rizzo wrote:
> Author: luigi
> Date: Mon Apr 12 16:37:45 2010
> New Revision: 206497
> URL: http://svn.freebsd.org/changeset/base/206497
> 
> Log:
>   Bring in geom_sched, support for scheduling disk I/O requests
>   in a device independent manner. Also include an example anticipatory
>   scheduler, gsched_rr, which gives very nice performance improvements
>   in presence of competing random access patterns.
>   
>   This is joint work with Fabio Checconi, developed last year
>   and presented at BSDCan 2009. You can find details in the
>   README file or at
>   
>   http://info.iet.unipi.it/~luigi/geom_sched/
> 
> Added:
>   head/sbin/geom/class/sched/
>   head/sbin/geom/class/sched/Makefile   (contents, props changed)
>   head/sbin/geom/class/sched/geom_sched.c   (contents, props changed)
>   head/sbin/geom/class/sched/gsched.8   (contents, props changed)
>   head/sys/geom/sched/
>   head/sys/geom/sched/README   (contents, props changed)
>   head/sys/geom/sched/g_sched.c   (contents, props changed)
>   head/sys/geom/sched/g_sched.h   (contents, props changed)
>   head/sys/geom/sched/gs_rr.c   (contents, props changed)
>   head/sys/geom/sched/gs_scheduler.h   (contents, props changed)
>   head/sys/geom/sched/subr_disk.c   (contents, props changed)
>   head/sys/modules/geom/geom_sched/
>   head/sys/modules/geom/geom_sched/Makefile   (contents, props changed)
>   head/sys/modules/geom/geom_sched/Makefile.inc   (contents, props changed)
>   head/sys/modules/geom/geom_sched/gs_sched/
>   head/sys/modules/geom/geom_sched/gs_sched/Makefile   (contents, props 
> changed)
>   head/sys/modules/geom/geom_sched/gsched_rr/
>   head/sys/modules/geom/geom_sched/gsched_rr/Makefile   (contents, props 
> changed)
> Modified:
>   head/sbin/geom/class/Makefile
>   head/sys/modules/geom/Makefile
> 
> Modified: head/sbin/geom/class/Makefile
> ==
> --- head/sbin/geom/class/Makefile Mon Apr 12 13:46:20 2010
> (r206496)
> +++ head/sbin/geom/class/Makefile Mon Apr 12 16:37:45 2010
> (r206497)
> @@ -15,6 +15,7 @@ SUBDIR+=multipath
>  SUBDIR+=nop
>  SUBDIR+=part
>  SUBDIR+=raid3
> +SUBDIR+=sched
>  SUBDIR+=shsec
>  SUBDIR+=stripe
>  SUBDIR+=virstor
> 
> Added: head/sbin/geom/class/sched/Makefile
> ==
> --- /dev/null 00:00:00 1970   (empty, because file is newly added)
> +++ head/sbin/geom/class/sched/Makefile   Mon Apr 12 16:37:45 2010
> (r206497)
> @@ -0,0 +1,19 @@
> +# GEOM_LIBRARY_PATH
> +# $FreeBSD$
> +
> +.PATH: /usr/src/sbin/geom/misc
> +
> +CFLAGS += -I/usr/src/sbin/geom
> +
> +CLASS=sched
> +
> +WARNS?= 6
> +CLASS_DIR?=/lib/geom
> +
> +SHLIBDIR?=${CLASS_DIR}
> +SHLIB_NAME?=geom_${CLASS}.so
> +LINKS=  ${BINDIR}/geom ${BINDIR}/g${CLASS}
> +MAN=g${CLASS}.8
> +SRCS+=  geom_${CLASS}.c subr.c
> +
> +.include 
> 
> Added: head/sbin/geom/class/sched/geom_sched.c
> ==
> --- /dev/null 00:00:00 1970   (empty, because file is newly added)
> +++ head/sbin/geom/class/sched/geom_sched.c   Mon Apr 12 16:37:45 2010
> (r206497)
> @@ -0,0 +1,123 @@
> +/*-
> + * Copyright (c) 2009 Fabio Checconi, Luigi Rizzo
> + * 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 AUTHORS 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 AUTHORS 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.
> + */
> +
> +/*
> + * $Id$
> + * $FreeBSD$
> + *
> + * This file implements the userspace library used by the 'geom'
> + * command to load and manipulate disk schedulers.
> + */
> +  
> +#inclu

svn commit: r206560 - head/sys/fs/devfs

2010-04-13 Thread Jaakko Heinonen
Author: jh
Date: Tue Apr 13 18:53:39 2010
New Revision: 206560
URL: http://svn.freebsd.org/changeset/base/206560

Log:
  - Ignore and report duplicate and empty device names in devfs_populate_loop()
instead of causing erratic behavior. Currently make_dev(9) can't fail, so
there is no way to report an error to make_dev(9) callers.
  - Disallow using "." and ".." in device path names. It didn't work previously
but now it is reported rather than panicing.
  - Treat multiple sequential slashes as single in device path names.
  
  Discussed with:   pjd

Modified:
  head/sys/fs/devfs/devfs_devs.c
  head/sys/fs/devfs/devfs_int.h

Modified: head/sys/fs/devfs/devfs_devs.c
==
--- head/sys/fs/devfs/devfs_devs.c  Tue Apr 13 18:46:18 2010
(r206559)
+++ head/sys/fs/devfs/devfs_devs.c  Tue Apr 13 18:53:39 2010
(r206560)
@@ -408,6 +408,9 @@ devfs_populate_loop(struct devfs_mount *
continue;
KASSERT((cdp->cdp_flags & CDP_ACTIVE), ("Bogons, I tell ya'!"));
 
+   if (cdp->cdp_flags & CDP_INVALID)
+   continue;
+
if (dm->dm_idx <= cdp->cdp_maxdirent &&
cdp->cdp_dirents[dm->dm_idx] != NULL) {
de = cdp->cdp_dirents[dm->dm_idx];
@@ -425,6 +428,8 @@ devfs_populate_loop(struct devfs_mount *
dd = dm->dm_rootdir;
s = cdp->cdp_c.si_name;
for (;;) {
+   while (*s == '/')
+   s++;
for (q = s; *q != '/' && *q != '\0'; q++)
continue;
if (*q != '/')
@@ -434,6 +439,24 @@ devfs_populate_loop(struct devfs_mount *
de = devfs_vmkdir(dm, s, q - s, dd, 0);
s = q + 1;
dd = de;
+   if (dd->de_flags & (DE_DOT | DE_DOTDOT))
+   break;
+   }
+
+   /*
+* XXX: Ignore duplicate and empty device names.
+* XXX: Currently there is no way to report the error to
+* XXX: the make_dev(9) caller.
+*/
+   if (dd->de_dirent->d_type != DT_DIR ||
+   dd->de_flags & (DE_DOT | DE_DOTDOT) || q - s < 1 ||
+   devfs_find(dd, s, q - s) != NULL) {
+   dev_lock();
+   cdp->cdp_flags |= CDP_INVALID;
+   dev_unlock();
+   printf("%s: %s: invalid or duplicate device name\n",
+   __func__, cdp->cdp_c.si_name);
+   return (1);
}
 
de = devfs_newdirent(s, q - s);

Modified: head/sys/fs/devfs/devfs_int.h
==
--- head/sys/fs/devfs/devfs_int.h   Tue Apr 13 18:46:18 2010
(r206559)
+++ head/sys/fs/devfs/devfs_int.h   Tue Apr 13 18:53:39 2010
(r206560)
@@ -55,6 +55,7 @@ struct cdev_priv {
u_int   cdp_flags;
 #define CDP_ACTIVE (1 << 0)
 #define CDP_SCHED_DTR  (1 << 1)
+#define CDP_INVALID(1 << 2)
 
u_int   cdp_inuse;
u_int   cdp_maxdirent;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r206559 - stable/8/usr.sbin/config

2010-04-13 Thread Ed Maste
Author: emaste
Date: Tue Apr 13 18:46:18 2010
New Revision: 206559
URL: http://svn.freebsd.org/changeset/base/206559

Log:
  MFC r205880 by ru:
  
- Handle calloc() allocation failures.
- Fixed a comment.
- 2 -> EXIT_FAILURE in some places.
- errx() -> err() where appropriate.
  
  PR:   144644
  Submitted by: Garrett Cooper
  
  Also fix endinclude() prototype to avoid compiler warning.

Modified:
  stable/8/usr.sbin/config/config.y
  stable/8/usr.sbin/config/lang.l
  stable/8/usr.sbin/config/main.c
  stable/8/usr.sbin/config/mkmakefile.c
  stable/8/usr.sbin/config/mkoptions.c
Directory Properties:
  stable/8/usr.sbin/config/   (props changed)

Modified: stable/8/usr.sbin/config/config.y
==
--- stable/8/usr.sbin/config/config.y   Tue Apr 13 15:55:18 2010
(r206558)
+++ stable/8/usr.sbin/config/config.y   Tue Apr 13 18:46:18 2010
(r206559)
@@ -166,6 +166,8 @@ Config_spec:
CPU Save_id {
struct cputype *cp =
(struct cputype *)calloc(1, sizeof (struct cputype));
+   if (cp == NULL)
+   err(EXIT_FAILURE, "calloc");
cp->cpu_name = $2;
SLIST_INSERT_HEAD(&cputype, cp, cpu_next);
  } |
@@ -197,6 +199,8 @@ Config_spec:
struct hint *hint;
 
hint = (struct hint *)calloc(1, sizeof (struct hint));
+   if (hint == NULL)
+   err(EXIT_FAILURE, "calloc");
hint->hint_name = $2;
STAILQ_INSERT_TAIL(&hints, hint, hint_next);
hintmode = 1;
@@ -331,6 +335,8 @@ newfile(char *name)
struct files_name *nl;

nl = (struct files_name *) calloc(1, sizeof *nl);
+   if (nl == NULL)
+   err(EXIT_FAILURE, "calloc");
nl->f_name = name;
STAILQ_INSERT_TAIL(&fntab, nl, f_next);
 }
@@ -364,6 +370,8 @@ newdev(char *name)
}
 
np = (struct device *) calloc(1, sizeof *np);
+   if (np == NULL)
+   err(EXIT_FAILURE, "calloc");
np->d_name = name;
STAILQ_INSERT_TAIL(&dtab, np, d_next);
 }
@@ -422,6 +430,8 @@ newopt(struct opt_head *list, char *name
}
 
op = (struct opt *)calloc(1, sizeof (struct opt));
+   if (op == NULL)
+   err(EXIT_FAILURE, "calloc");
op->op_name = name;
op->op_ownfile = 0;
op->op_value = value;

Modified: stable/8/usr.sbin/config/lang.l
==
--- stable/8/usr.sbin/config/lang.l Tue Apr 13 15:55:18 2010
(r206558)
+++ stable/8/usr.sbin/config/lang.l Tue Apr 13 18:46:18 2010
(r206559)
@@ -33,6 +33,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include "y.tab.h"
 #include "config.h"
@@ -220,6 +221,8 @@ cfgfile_add(const char *fname)
struct cfgfile *cf;
 
cf = calloc(1, sizeof(*cf));
+   if (cf == NULL)
+   err(EXIT_FAILURE, "calloc");
assert(cf != NULL);
asprintf(&cf->cfg_path, "%s", fname);
STAILQ_INSERT_TAIL(&cfgfiles, cf, cfg_next);
@@ -285,7 +288,7 @@ include(const char *fname, int ateof)
  * Terminate the most recent inclusion.
  */
 static int
-endinclude()
+endinclude(void)
 {
struct incl *in;
int ateof;

Modified: stable/8/usr.sbin/config/main.c
==
--- stable/8/usr.sbin/config/main.c Tue Apr 13 15:55:18 2010
(r206558)
+++ stable/8/usr.sbin/config/main.c Tue Apr 13 18:46:18 2010
(r206559)
@@ -120,7 +120,7 @@ main(int argc, char **argv)
if (*destdir == '\0')
strlcpy(destdir, optarg, sizeof(destdir));
else
-   errx(2, "directory already set");
+   errx(EXIT_FAILURE, "directory already set");
break;
case 'g':
debugging++;
@@ -175,7 +175,7 @@ main(int argc, char **argv)
if (mkdir(p, 0777))
err(2, "%s", p);
} else if (!S_ISDIR(buf.st_mode))
-   errx(2, "%s isn't a directory", p);
+   errx(EXIT_FAILURE, "%s isn't a directory", p);
 
SLIST_INIT(&cputype);
SLIST_INIT(&mkopt);
@@ -256,7 +256,7 @@ get_srcdir(void)
int i;
 
if (realpath("../..", srcdir) == NULL)
-   errx(2, "Unable to find root of source tree");
+   err(EXIT_FAILURE, "Unable to find root of source tree");
if ((pwd = getenv("PWD")) != NULL && *pwd == '/' &&
(pwd = strdup(pwd)) != NULL) {
/* Remove the last two path components. */
@@ -513,7 +513,7 @@ configfile(void)
}
sbuf_finish(sb);
/* 
-* We print first part of t

svn commit: r206558 - head/sys/ia64/ia64

2010-04-13 Thread Marcel Moolenaar
Author: marcel
Date: Tue Apr 13 15:55:18 2010
New Revision: 206558
URL: http://svn.freebsd.org/changeset/base/206558

Log:
  Change the (generic) argument to ia64_store_mca_state() from the
  cpuid to the struct pcpu of the CPU. We casting between pointer
  types only then.

Modified:
  head/sys/ia64/ia64/mp_machdep.c

Modified: head/sys/ia64/ia64/mp_machdep.c
==
--- head/sys/ia64/ia64/mp_machdep.c Tue Apr 13 15:53:04 2010
(r206557)
+++ head/sys/ia64/ia64/mp_machdep.c Tue Apr 13 15:55:18 2010
(r206558)
@@ -152,13 +152,15 @@ cpu_topo(void)
 static void
 ia64_store_mca_state(void* arg)
 {
-   unsigned int ncpu = (unsigned int)(uintptr_t)arg;
-   struct thread* td;
+   struct pcpu *pc = arg;
+   struct thread *td = curthread;
 
-   /* ia64_mca_save_state() is CPU-sensitive, so bind ourself to our 
target CPU */
-   td = curthread;
+   /*
+* ia64_mca_save_state() is CPU-sensitive, so bind ourself to our
+* target CPU.
+*/
thread_lock(td);
-   sched_bind(td, ncpu);
+   sched_bind(td, pc->pc_cpuid);
thread_unlock(td);
 
/*
@@ -362,8 +364,7 @@ cpu_mp_unleash(void *dummy)
SLIST_FOREACH(pc, &cpuhead, pc_allcpu) {
cpus++;
if (pc->pc_md.awake) {
-   kproc_create(ia64_store_mca_state,
-   (void*)((uintptr_t)pc->pc_cpuid), NULL, 0, 0,
+   kproc_create(ia64_store_mca_state, pc, NULL, 0, 0,
"mca %u", pc->pc_cpuid);
smp_cpus++;
}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r206557 - head/share/man/man5

2010-04-13 Thread Hajimu UMEMOTO
Author: ume
Date: Tue Apr 13 15:53:04 2010
New Revision: 206557
URL: http://svn.freebsd.org/changeset/base/206557

Log:
  Nuke the descriptions about ipv6_firewall_* as they were unified
  into firewall_*.
  
  MFC after:3 days

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

Modified: head/share/man/man5/rc.conf.5
==
--- head/share/man/man5/rc.conf.5   Tue Apr 13 15:51:25 2010
(r206556)
+++ head/share/man/man5/rc.conf.5   Tue Apr 13 15:53:04 2010
(r206557)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 09, 2010
+.Dd April 14, 2010
 .Dt RC.CONF 5
 .Os
 .Sh NAME
@@ -427,27 +427,11 @@ the
 kernel module will be loaded.
 See also
 .Va ipfilter_enable .
-.It Va ipv6_firewall_enable
-.Pq Vt bool
-The IPv6 equivalent of
-.Va firewall_enable .
-Set to
-.Dq Li YES
-to load IPv6 firewall rules at startup.
-If the kernel was not built with
-.Cd "options IPV6FIREWALL" ,
-the
-.Pa ipfw.ko
-kernel module will be loaded.
 .It Va firewall_script
 .Pq Vt str
 This variable specifies the full path to the firewall script to run.
 The default is
 .Pa /etc/rc.firewall .
-.It Va ipv6_firewall_script
-.Pq Vt str
-The IPv6 equivalent of
-.Va firewall_script .
 .It Va firewall_type
 .Pq Vt str
 Names the firewall type from the selection in
@@ -471,19 +455,11 @@ basic protection for a LAN.
 .Pp
 If a filename is specified, the full path
 must be given.
-.It Va ipv6_firewall_type
-.Pq Vt str
-The IPv6 equivalent of
-.Va firewall_type .
 .It Va firewall_quiet
 .Pq Vt bool
 Set to
 .Dq Li YES
 to disable the display of firewall rules on the console during boot.
-.It Va ipv6_firewall_quiet
-.Pq Vt bool
-The IPv6 equivalent of
-.Va firewall_quiet .
 .It Va firewall_logging
 .Pq Vt bool
 Set to
@@ -492,10 +468,6 @@ to enable firewall event logging.
 This is equivalent to the
 .Dv IPFIREWALL_VERBOSE
 kernel option.
-.It Va ipv6_firewall_logging
-.Pq Vt bool
-The IPv6 equivalent of
-.Va firewall_logging .
 .It Va firewall_flags
 .Pq Vt str
 Flags passed to
@@ -503,10 +475,6 @@ Flags passed to
 if
 .Va firewall_type
 specifies a filename.
-.It Va ipv6_firewall_flags
-.Pq Vt str
-The IPv6 equivalent of
-.Va firewall_flags .
 .It Va firewall_coscripts
 .Pq Vt str
 List of executables and/or rc scripts to run after firewall starts/stops.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r206556 - head/sys/ia64/include

2010-04-13 Thread Marcel Moolenaar
Author: marcel
Date: Tue Apr 13 15:51:25 2010
New Revision: 206556
URL: http://svn.freebsd.org/changeset/base/206556

Log:
  o   s/u_int64_t/uint64_t/g
  o   style(9) fixes.

Modified:
  head/sys/ia64/include/pal.h

Modified: head/sys/ia64/include/pal.h
==
--- head/sys/ia64/include/pal.h Tue Apr 13 12:10:55 2010(r206555)
+++ head/sys/ia64/include/pal.h Tue Apr 13 15:51:25 2010(r206556)
@@ -108,20 +108,19 @@
 
 struct ia64_pal_result {
int64_t pal_status;
-   u_int64_t   pal_result[3];
+   uint64_tpal_result[3];
 };
 
-extern struct ia64_pal_result
-   ia64_call_pal_static(u_int64_t proc, u_int64_t arg1,
-u_int64_t arg2, u_int64_t arg3);
-extern struct ia64_pal_result
-   ia64_call_pal_static_physical(u_int64_t proc, u_int64_t arg1,
- u_int64_t arg2, u_int64_t arg3);
-extern struct ia64_pal_result
-   ia64_call_pal_stacked(u_int64_t proc, u_int64_t arg1,
- u_int64_t arg2, u_int64_t arg3);
-extern struct ia64_pal_result
-   ia64_call_pal_stacked_physical(u_int64_t proc, u_int64_t arg1,
-  u_int64_t arg2, u_int64_t arg3);
+struct ia64_pal_result ia64_call_pal_static(uint64_t proc, uint64_t arg1,
+uint64_t arg2, uint64_t arg3);
+
+struct ia64_pal_result ia64_call_pal_static_physical(uint64_t proc,
+uint64_t arg1, uint64_t arg2, uint64_t arg3);
+
+struct ia64_pal_result ia64_call_pal_stacked(uint64_t proc, uint64_t arg1,
+uint64_t arg2, uint64_t arg3);
+
+struct ia64_pal_result ia64_call_pal_stacked_physical(uint64_t proc,
+uint64_t arg1, uint64_t arg2, uint64_t arg3);
 
 #endif /* _MACHINE_PAL_H_ */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r206555 - head/sys/dev/aac

2010-04-13 Thread Ed Maste
Author: emaste
Date: Tue Apr 13 12:10:55 2010
New Revision: 206555
URL: http://svn.freebsd.org/changeset/base/206555

Log:
  Use enums in the aac_command_status_table rather than duplicating the same
  values in two places.
  
  Suggested by: Garrett Cooper

Modified:
  head/sys/dev/aac/aac_tables.h

Modified: head/sys/dev/aac/aac_tables.h
==
--- head/sys/dev/aac/aac_tables.h   Tue Apr 13 10:23:03 2010
(r206554)
+++ head/sys/dev/aac/aac_tables.h   Tue Apr 13 12:10:55 2010
(r206555)
@@ -34,42 +34,42 @@
  * relevant only to FSA operations.
  */
 static struct aac_code_lookup aac_command_status_table[] = {
-   {"OK",  0},
-   {"operation not permitted", 1},
-   {"not found",   2},
-   {"I/O error",   5},
-   {"device not configured",   6},
-   {"too big", 7},
-   {"permission denied",   13},
-   {"file exists", 17},
-   {"cross-device link",   18},
-   {"operation not supported by device",   19},
-   {"not a directory", 20},
-   {"is a directory",  21},
-   {"invalid argument",22},
-   {"file too large",  27},
-   {"no space on device",  28},
-   {"readonly filesystem", 30},
-   {"too many links",  31},
-   {"operation would block",   35},
-   {"file name too long",  63},
-   {"directory not empty", 66},
-   {"quota exceeded",  69},
-   {"stale file handle",   70},
-   {"too many levels of remote in path",   71},
-   {"device busy (spinning up)",   72},
-   {"bad file handle", 10001},
-   {"not sync",10002},
-   {"bad cookie",  10003},
-   {"operation not supported", 10004},
-   {"too small",   10005},
-   {"server fault",10006},
-   {"bad type",10007},
-   {"jukebox", 10008},
-   {"not mounted", 10009},
-   {"in maintenance mode", 10010},
-   {"stale ACL",   10011},
-   {"bus reset - command aborted", 20001},
+   {"OK",  ST_OK},
+   {"operation not permitted", ST_PERM},
+   {"not found",   ST_NOENT},
+   {"I/O error",   ST_IO},
+   {"device not configured",   ST_NXIO},
+   {"too big", ST_E2BIG},
+   {"permission denied",   ST_ACCES},
+   {"file exists", ST_EXIST},
+   {"cross-device link",   ST_XDEV},
+   {"operation not supported by device",   ST_NODEV},
+   {"not a directory", ST_NOTDIR},
+   {"is a directory",  ST_ISDIR},
+   {"invalid argument",ST_INVAL},
+   {"file too large",  ST_FBIG},
+   {"no space on device",  ST_NOSPC},
+   {"readonly filesystem", ST_ROFS},
+   {"too many links",  ST_MLINK},
+   {"operation would block",   ST_WOULDBLOCK},
+   {"file name too long",  ST_NAMETOOLONG},
+   {"directory not empty", ST_NOTEMPTY},
+   {"quota exceeded",  ST_DQUOT},
+   {"stale file handle",   ST_STALE},
+   {"too many levels of remote in path",   ST_REMOTE},
+   {"device busy (spinning up)",   ST_NOT_READY},
+   {"bad file handle", ST_BADHANDLE},
+   {"not sync",ST_NOT_SYNC},
+   {"bad cookie",  ST_BAD_COOKIE},
+   {"operation not supported", ST_NOTSUPP},
+   {"too small",   ST_TOOSMALL},
+   {"server fault",ST_SERVERFAULT},
+   {"bad type",ST_BADTYPE},
+   {"jukebox", ST_JUKEBOX},
+   {"not mounted", ST_NOTMOUNTED},
+   {"in maintenance mode", ST_MAINTMODE},
+   {"stale ACL",   ST_STALEACL},
+   {"bus reset - command aborted", ST_BUS_RESET},
{NULL,  0},
{"unknown command status",  0}
 };
___
svn-src-all@freebsd

svn commit: r206554 - in stable/8/sys/amd64: amd64 include

2010-04-13 Thread Konstantin Belousov
Author: kib
Date: Tue Apr 13 10:23:03 2010
New Revision: 206554
URL: http://svn.freebsd.org/changeset/base/206554

Log:
  MFC r206459:
  Handle a case when non-canonical address is loaded into the fsbase or
  gsbase MSR.

Modified:
  stable/8/sys/amd64/amd64/exception.S
  stable/8/sys/amd64/amd64/trap.c
  stable/8/sys/amd64/include/md_var.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/amd64/amd64/exception.S
==
--- stable/8/sys/amd64/amd64/exception.STue Apr 13 10:12:58 2010
(r206553)
+++ stable/8/sys/amd64/amd64/exception.STue Apr 13 10:23:03 2010
(r206554)
@@ -668,7 +668,8 @@ ld_fs:  movw%ax,%fs
movl$MSR_FSBASE,%ecx
movlPCB_FSBASE(%r8),%eax
movlPCB_FSBASE+4(%r8),%edx
-   wrmsr
+   .globl  ld_fsbase
+ld_fsbase: wrmsr
 1:
/* Restore %gs and gsbase */
movwTF_GS(%rsp),%si
@@ -685,7 +686,8 @@ ld_gs:  movw%si,%gs
movl$MSR_KGSBASE,%ecx
movlPCB_GSBASE(%r8),%eax
movlPCB_GSBASE+4(%r8),%edx
-   wrmsr
+   .globl  ld_gsbase
+ld_gsbase: wrmsr
 1: .globl  ld_es
 ld_es: movwTF_ES(%rsp),%es
.globl  ld_ds
@@ -798,6 +800,30 @@ gs_load_fault:
calltrap
movw$KUG32SEL,TF_GS(%rsp)
jmp doreti
+
+   ALIGN_TEXT
+   .globl  fsbase_load_fault
+fsbase_load_fault:
+   movl$T_PROTFLT,TF_TRAPNO(%rsp)
+   movq%rsp, %rdi
+   calltrap
+   movqPCPU(CURTHREAD),%r8
+   movqTD_PCB(%r8),%r8
+   movq$0,PCB_FSBASE(%r8)
+   jmp doreti
+
+   ALIGN_TEXT
+   .globl  gsbase_load_fault
+gsbase_load_fault:
+   popfq
+   movl$T_PROTFLT,TF_TRAPNO(%rsp)
+   movq%rsp, %rdi
+   calltrap
+   movqPCPU(CURTHREAD),%r8
+   movqTD_PCB(%r8),%r8
+   movq$0,PCB_GSBASE(%r8)
+   jmp doreti
+
 #ifdef HWPMC_HOOKS
ENTRY(end_exceptions)
 #endif

Modified: stable/8/sys/amd64/amd64/trap.c
==
--- stable/8/sys/amd64/amd64/trap.c Tue Apr 13 10:12:58 2010
(r206553)
+++ stable/8/sys/amd64/amd64/trap.c Tue Apr 13 10:23:03 2010
(r206554)
@@ -563,6 +563,14 @@ trap(struct trapframe *frame)
frame->tf_gs = _ugssel;
goto out;
}
+   if (frame->tf_rip == (long)ld_gsbase) {
+   frame->tf_rip = (long)gsbase_load_fault;
+   goto out;
+   }
+   if (frame->tf_rip == (long)ld_fsbase) {
+   frame->tf_rip = (long)fsbase_load_fault;
+   goto out;
+   }
if (PCPU_GET(curpcb)->pcb_onfault != NULL) {
frame->tf_rip =
(long)PCPU_GET(curpcb)->pcb_onfault;

Modified: stable/8/sys/amd64/include/md_var.h
==
--- stable/8/sys/amd64/include/md_var.h Tue Apr 13 10:12:58 2010
(r206553)
+++ stable/8/sys/amd64/include/md_var.h Tue Apr 13 10:23:03 2010
(r206554)
@@ -83,10 +83,14 @@ voidld_ds(void) __asm(__STRING(ld_ds));
 void   ld_es(void) __asm(__STRING(ld_es));
 void   ld_fs(void) __asm(__STRING(ld_fs));
 void   ld_gs(void) __asm(__STRING(ld_gs));
+void   ld_fsbase(void) __asm(__STRING(ld_fsbase));
+void   ld_gsbase(void) __asm(__STRING(ld_gsbase));
 void   ds_load_fault(void) __asm(__STRING(ds_load_fault));
 void   es_load_fault(void) __asm(__STRING(es_load_fault));
 void   fs_load_fault(void) __asm(__STRING(fs_load_fault));
 void   gs_load_fault(void) __asm(__STRING(gs_load_fault));
+void   fsbase_load_fault(void) __asm(__STRING(fsbase_load_fault));
+void   gsbase_load_fault(void) __asm(__STRING(gsbase_load_fault));
 void   dump_add_page(vm_paddr_t);
 void   dump_drop_page(vm_paddr_t);
 void   initializecpu(void);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r206553 - in head/sys: amd64/amd64 amd64/ia32 i386/i386

2010-04-13 Thread Kostik Belousov
On Tue, Apr 13, 2010 at 10:12:58AM +, Konstantin Belousov wrote:
> Author: kib
> Date: Tue Apr 13 10:12:58 2010
> New Revision: 206553
> URL: http://svn.freebsd.org/changeset/base/206553
> 
> Log:
>   Change printf() calls to uprintf() for sigreturn() and trap() complaints
>   about inacessible or wrong mcontext, and for dreaded "kernel trap with
>   interrupts disabled" situation. The later is changed when trap is
>   generated from user mode (shall never be ?).
>   
>   Normalize the messages to include both pid and thread name.
>   
>   MFC after:  1 week
I think that printfs from sigreturn should be changed to signal
delivery or even a call to trap_fatal(), but this is for other commit.

Anyway, the current situation where messages could be found in daily
periodic run (sigreturn pid 23334: cs=0x, so what ? pid is long time
gone) is not very useful for noting the issue.


pgpgUOUCWIri6.pgp
Description: PGP signature


svn commit: r206553 - in head/sys: amd64/amd64 amd64/ia32 i386/i386

2010-04-13 Thread Konstantin Belousov
Author: kib
Date: Tue Apr 13 10:12:58 2010
New Revision: 206553
URL: http://svn.freebsd.org/changeset/base/206553

Log:
  Change printf() calls to uprintf() for sigreturn() and trap() complaints
  about inacessible or wrong mcontext, and for dreaded "kernel trap with
  interrupts disabled" situation. The later is changed when trap is
  generated from user mode (shall never be ?).
  
  Normalize the messages to include both pid and thread name.
  
  MFC after:1 week

Modified:
  head/sys/amd64/amd64/machdep.c
  head/sys/amd64/amd64/trap.c
  head/sys/amd64/ia32/ia32_signal.c
  head/sys/i386/i386/machdep.c
  head/sys/i386/i386/trap.c

Modified: head/sys/amd64/amd64/machdep.c
==
--- head/sys/amd64/amd64/machdep.c  Tue Apr 13 09:56:17 2010
(r206552)
+++ head/sys/amd64/amd64/machdep.c  Tue Apr 13 10:12:58 2010
(r206553)
@@ -424,13 +424,14 @@ sigreturn(td, uap)
 
error = copyin(uap->sigcntxp, &uc, sizeof(uc));
if (error != 0) {
-   printf("sigreturn (pid %d): copyin failed\n", p->p_pid);
+   uprintf("pid %d (%s): sigreturn copyin failed\n",
+   p->p_pid, td->td_name);
return (error);
}
ucp = &uc;
if ((ucp->uc_mcontext.mc_flags & ~_MC_FLAG_MASK) != 0) {
-   printf("sigreturn (pid %d): mc_flags %x\n", p->p_pid,
-   ucp->uc_mcontext.mc_flags);
+   uprintf("pid %d (%s): sigreturn mc_flags %x\n", p->p_pid,
+   td->td_name, ucp->uc_mcontext.mc_flags);
return (EINVAL);
}
regs = td->td_frame;
@@ -449,8 +450,8 @@ sigreturn(td, uap)
 * one less debugger trap, so allowing it is fairly harmless.
 */
if (!EFL_SECURE(rflags & ~PSL_RF, regs->tf_rflags & ~PSL_RF)) {
-   printf("sigreturn (pid %d): rflags = 0x%lx\n", p->p_pid,
-   rflags);
+   uprintf("pid %d (%s): sigreturn rflags = 0x%lx\n", p->p_pid,
+   td->td_name, rflags);
return (EINVAL);
}
 
@@ -461,7 +462,8 @@ sigreturn(td, uap)
 */
cs = ucp->uc_mcontext.mc_cs;
if (!CS_SECURE(cs)) {
-   printf("sigreturn (pid %d): cs = 0x%x\n", p->p_pid, cs);
+   uprintf("pid %d (%s): sigreturn cs = 0x%x\n", p->p_pid,
+   td->td_name, cs);
ksiginfo_init_trap(&ksi);
ksi.ksi_signo = SIGBUS;
ksi.ksi_code = BUS_OBJERR;
@@ -473,7 +475,8 @@ sigreturn(td, uap)
 
ret = set_fpcontext(td, &ucp->uc_mcontext);
if (ret != 0) {
-   printf("sigreturn (pid %d): set_fpcontext\n", p->p_pid);
+   uprintf("pid %d (%s): sigreturn set_fpcontext err %d\n",
+   p->p_pid, td->td_name, ret);
return (ret);
}
bcopy(&ucp->uc_mcontext.mc_rdi, regs, sizeof(*regs));

Modified: head/sys/amd64/amd64/trap.c
==
--- head/sys/amd64/amd64/trap.c Tue Apr 13 09:56:17 2010(r206552)
+++ head/sys/amd64/amd64/trap.c Tue Apr 13 10:12:58 2010(r206553)
@@ -303,7 +303,7 @@ trap(struct trapframe *frame)
 * enabled later.
 */
if (ISPL(frame->tf_cs) == SEL_UPL)
-   printf(
+   uprintf(
"pid %ld (%s): trap %d with interrupts disabled\n",
(long)curproc->p_pid, curthread->td_name, type);
else if (type != T_NMI && type != T_BPTFLT &&

Modified: head/sys/amd64/ia32/ia32_signal.c
==
--- head/sys/amd64/ia32/ia32_signal.c   Tue Apr 13 09:56:17 2010
(r206552)
+++ head/sys/amd64/ia32/ia32_signal.c   Tue Apr 13 10:12:58 2010
(r206553)
@@ -565,7 +565,8 @@ freebsd4_freebsd32_sigreturn(td, uap)
 * one less debugger trap, so allowing it is fairly harmless.
 */
if (!EFL_SECURE(eflags & ~PSL_RF, regs->tf_rflags & ~PSL_RF)) {
-   printf("freebsd4_freebsd32_sigreturn: eflags = 0x%x\n", eflags);
+   uprintf("pid %d (%s): freebsd4_freebsd32_sigreturn eflags = 
0x%x\n",
+   td->td_proc->p_pid, td->td_name, eflags);
return (EINVAL);
}
 
@@ -576,7 +577,8 @@ freebsd4_freebsd32_sigreturn(td, uap)
 */
cs = ucp->uc_mcontext.mc_cs;
if (!CS_SECURE(cs)) {
-   printf("freebsd4_sigreturn: cs = 0x%x\n", cs);
+   uprintf("pid %d (%s): freebsd4_sigreturn cs = 0x%x\n",
+   td->td_proc->p_pid, td->td_name, cs);
ksiginfo_init_trap(&ksi);
ksi.ksi_signo = SIGBUS;
ksi.ksi_code = BUS_OBJERR;
@@ -647,7 +649,8 @@ freebsd32_sigreturn(td, uap)
 * one less debugge

svn commit: r206552 - in head: sbin/geom/class/sched sys/geom/sched

2010-04-13 Thread Luigi Rizzo
Author: luigi
Date: Tue Apr 13 09:56:17 2010
New Revision: 206552
URL: http://svn.freebsd.org/changeset/base/206552

Log:
  fix copyright format, as requested by Joel Dahl

Modified:
  head/sbin/geom/class/sched/geom_sched.c
  head/sbin/geom/class/sched/gsched.8
  head/sys/geom/sched/g_sched.c
  head/sys/geom/sched/g_sched.h
  head/sys/geom/sched/gs_rr.c
  head/sys/geom/sched/gs_scheduler.h

Modified: head/sbin/geom/class/sched/geom_sched.c
==
--- head/sbin/geom/class/sched/geom_sched.c Tue Apr 13 09:53:08 2010
(r206551)
+++ head/sbin/geom/class/sched/geom_sched.c Tue Apr 13 09:56:17 2010
(r206552)
@@ -1,5 +1,6 @@
 /*-
- * Copyright (c) 2009 Fabio Checconi, Luigi Rizzo
+ * Copyright (c) 2009 Fabio Checconi
+ * Copyright (c) 2010 Luigi Rizzo, Universita` di Pisa
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: head/sbin/geom/class/sched/gsched.8
==
--- head/sbin/geom/class/sched/gsched.8 Tue Apr 13 09:53:08 2010
(r206551)
+++ head/sbin/geom/class/sched/gsched.8 Tue Apr 13 09:56:17 2010
(r206552)
@@ -1,6 +1,6 @@
-.\" Copyright (c) 2009-2010 Fabio Checconi, Luigi Rizzo
+.\" Copyright (c) 2009-2010 Fabio Checconi
+.\" Copyright (c) 2009-2010 Luigi Rizzo, Universita` di Pisa
 .\" All rights reserved.
-.\" $FreeBSD$
 .\"
 .\" Redistribution and use in source and binary forms, with or without
 .\" modification, are permitted provided that the following conditions
@@ -23,6 +23,8 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
+.\" $FreeBSD$
+.\"
 .Dd April 12, 2010
 .Dt GSCHED 8
 .Os

Modified: head/sys/geom/sched/g_sched.c
==
--- head/sys/geom/sched/g_sched.c   Tue Apr 13 09:53:08 2010
(r206551)
+++ head/sys/geom/sched/g_sched.c   Tue Apr 13 09:56:17 2010
(r206552)
@@ -1,5 +1,6 @@
 /*-
- * Copyright (c) 2009-2010 Fabio Checconi, Luigi Rizzo
+ * Copyright (c) 2009-2010 Fabio Checconi
+ * Copyright (c) 2009-2010 Luigi Rizzo, Universita` di Pisa
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: head/sys/geom/sched/g_sched.h
==
--- head/sys/geom/sched/g_sched.h   Tue Apr 13 09:53:08 2010
(r206551)
+++ head/sys/geom/sched/g_sched.h   Tue Apr 13 09:56:17 2010
(r206552)
@@ -1,5 +1,6 @@
 /*-
- * Copyright (c) 2009-2010 Fabio Checconi, Luigi Rizzo
+ * Copyright (c) 2009-2010 Fabio Checconi
+ * Copyright (c) 2009-2010 Luigi Rizzo, Universita` di Pisa
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: head/sys/geom/sched/gs_rr.c
==
--- head/sys/geom/sched/gs_rr.c Tue Apr 13 09:53:08 2010(r206551)
+++ head/sys/geom/sched/gs_rr.c Tue Apr 13 09:56:17 2010(r206552)
@@ -1,5 +1,6 @@
 /*-
- * Copyright (c) 2009-2010 Fabio Checconi, Luigi Rizzo
+ * Copyright (c) 2009-2010 Fabio Checconi
+ * Copyright (c) 2009-2010 Luigi Rizzo, Universita` di Pisa
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: head/sys/geom/sched/gs_scheduler.h
==
--- head/sys/geom/sched/gs_scheduler.h  Tue Apr 13 09:53:08 2010
(r206551)
+++ head/sys/geom/sched/gs_scheduler.h  Tue Apr 13 09:56:17 2010
(r206552)
@@ -1,5 +1,6 @@
 /*-
- * Copyright (c) 2009-2010 Fabio Checconi, Luigi Rizzo
+ * Copyright (c) 2009-2010 Fabio Checconi
+ * Copyright (c) 2009-2010 Luigi Rizzo, Universita` di Pisa
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r206551 - head/sys/geom/sched

2010-04-13 Thread Luigi Rizzo
Author: luigi
Date: Tue Apr 13 09:53:08 2010
New Revision: 206551
URL: http://svn.freebsd.org/changeset/base/206551

Log:
  make code compile with KTR

Modified:
  head/sys/geom/sched/g_sched.c

Modified: head/sys/geom/sched/g_sched.c
==
--- head/sys/geom/sched/g_sched.c   Tue Apr 13 09:52:42 2010
(r206550)
+++ head/sys/geom/sched/g_sched.c   Tue Apr 13 09:53:08 2010
(r206551)
@@ -753,13 +753,6 @@ g_gsched_modevent(module_t mod, int cmd,
 
 #ifdef KTR
 #defineTRC_BIO_EVENT(e, bp)g_sched_trace_bio_ ## e (bp)
-static inline int
-g_sched_issuer_pid(struct bio *bp)
-{
-   struct thread *thread = g_sched_issuer(bp);
-
-   return (thread->td_tid);
-}
 
 static inline char
 g_sched_type(struct bio *bp)
@@ -776,7 +769,7 @@ static inline void
 g_sched_trace_bio_START(struct bio *bp)
 {
 
-   CTR5(KTR_GSCHED, "S %d %c %lu/%lu %lu", g_sched_issuer_pid(bp),
+   CTR5(KTR_GSCHED, "S %lu %c %lu/%lu %lu", g_sched_classify(bp),
g_sched_type(bp), bp->bio_offset / ULONG_MAX,
bp->bio_offset, bp->bio_length);
 }
@@ -785,13 +778,13 @@ static inline void
 g_sched_trace_bio_DONE(struct bio *bp)
 {
 
-   CTR5(KTR_GSCHED, "D %d %c %lu/%lu %lu", g_sched_issuer_pid(bp),
+   CTR5(KTR_GSCHED, "D %lu %c %lu/%lu %lu", g_sched_classify(bp),
g_sched_type(bp), bp->bio_offset / ULONG_MAX,
bp->bio_offset, bp->bio_length);
 }
-#else
+#else /* !KTR */
 #defineTRC_BIO_EVENT(e, bp)
-#endif
+#endif /* !KTR */
 
 /*
  * g_sched_done() and g_sched_start() dispatch the geom requests to
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r206550 - head/sbin/geom/class/sched

2010-04-13 Thread Luigi Rizzo
Author: luigi
Date: Tue Apr 13 09:52:42 2010
New Revision: 206550
URL: http://svn.freebsd.org/changeset/base/206550

Log:
  use correct .PATH, remove unused CFLAGS

Modified:
  head/sbin/geom/class/sched/Makefile

Modified: head/sbin/geom/class/sched/Makefile
==
--- head/sbin/geom/class/sched/Makefile Tue Apr 13 08:56:03 2010
(r206549)
+++ head/sbin/geom/class/sched/Makefile Tue Apr 13 09:52:42 2010
(r206550)
@@ -1,9 +1,8 @@
 # GEOM_LIBRARY_PATH
 # $FreeBSD$
 
-.PATH: /usr/src/sbin/geom/misc
-
-CFLAGS += -I/usr/src/sbin/geom
+.PATH: ${.CURDIR}/../../misc
+#CFLAGS += -I/usr/src/sbin/geom
 
 CLASS=sched
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r206497 - in head: sbin/geom/class sbin/geom/class/sched sys/geom/sched sys/modules/geom sys/modules/geom/geom_sched sys/modules/geom/geom_sched/gs_sched sys/modules/geom/geom_sched/gs

2010-04-13 Thread Rui Paulo
On 12 Apr 2010, at 22:05, Luigi Rizzo wrote:

> On Mon, Apr 12, 2010 at 10:49:26PM +0200, Pawel Jakub Dawidek wrote:
> ...
>>> @@ -0,0 +1,19 @@
>>> +# GEOM_LIBRARY_PATH
>>> +# $FreeBSD$
>>> +
>>> +.PATH: /usr/src/sbin/geom/misc
>>> +
>>> +CFLAGS += -I/usr/src/sbin/geom
>> 
>> This doesn't look right.
> 
> probably a leftover from older versions of this code for 6.x .
> I will do more tests tomorrow (for 7.x at this point, there is
> no point in trying to support 6.x I believe) and try to remove
> it if not necessary.

Even if you need geom/misc, this is not the correct way to include it.

M=  ${.CURDIR}/../../misc
.PATH:  ${M}
CFLAGS+=-I${M}

is probably what you want. There are many people out there (me included) that 
don't use /usr/src.

Regards,
--
Rui Paulo

___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r206549 - head/lib/libc/sys

2010-04-13 Thread Konstantin Belousov
Author: kib
Date: Tue Apr 13 08:56:03 2010
New Revision: 206549
URL: http://svn.freebsd.org/changeset/base/206549

Log:
  Align the declaration for sa_sigaction with POSIX.
  
  MFC after:3 days

Modified:
  head/lib/libc/sys/sigaction.2

Modified: head/lib/libc/sys/sigaction.2
==
--- head/lib/libc/sys/sigaction.2   Tue Apr 13 08:54:53 2010
(r206548)
+++ head/lib/libc/sys/sigaction.2   Tue Apr 13 08:56:03 2010
(r206549)
@@ -28,7 +28,7 @@
 .\"From: @(#)sigaction.2   8.2 (Berkeley) 4/3/94
 .\" $FreeBSD$
 .\"
-.Dd June 7, 2004
+.Dd April 13, 2010
 .Dt SIGACTION 2
 .Os
 .Sh NAME
@@ -42,7 +42,7 @@
 struct  sigaction {
 union {
 void(*__sa_handler)(int);
-void(*__sa_sigaction)(int, struct __siginfo *, void *);
+void(*__sa_sigaction)(int, siginfo_t *, void *);
 } __sigaction_u;/* signal handler */
 int sa_flags;   /* see signal options below */
 sigset_t sa_mask;   /* signal mask to apply */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r206548 - head/bin/ps

2010-04-13 Thread Konstantin Belousov
Author: kib
Date: Tue Apr 13 08:54:53 2010
New Revision: 206548
URL: http://svn.freebsd.org/changeset/base/206548

Log:
  Update the list of the process flags for P_WKILLED.
  
  MFC after:4 weeks

Modified:
  head/bin/ps/ps.1

Modified: head/bin/ps/ps.1
==
--- head/bin/ps/ps.1Tue Apr 13 08:52:20 2010(r206547)
+++ head/bin/ps/ps.1Tue Apr 13 08:54:53 2010(r206548)
@@ -29,7 +29,7 @@
 .\" @(#)ps.1   8.3 (Berkeley) 4/18/94
 .\" $FreeBSD$
 .\"
-.Dd March 17, 2010
+.Dd April 13, 2010
 .Dt PS 1
 .Os
 .Sh NAME
@@ -298,6 +298,7 @@ the include file
 .It Dv "P_WAITED" Ta No "0x01000   Someone is waiting for us"
 .It Dv "P_WEXIT" Ta No "0x02000Working on exiting"
 .It Dv "P_EXEC" Ta No "0x04000 Process called exec"
+.It Dv "P_WKILLED" Ta No "0x08000  Killed, shall go to kernel/user 
boundary ASAP"
 .It Dv "P_CONTINUED" Ta No "0x1Proc has continued from a stopped state"
 .It Dv "P_STOPPED_SIG" Ta No "0x2  Stopped due to SIGSTOP/SIGTSTP"
 .It Dv "P_STOPPED_TRACE" Ta No "0x4Stopped because of tracing"
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r206547 - head/sys/kern

2010-04-13 Thread Konstantin Belousov
Author: kib
Date: Tue Apr 13 08:52:20 2010
New Revision: 206547
URL: http://svn.freebsd.org/changeset/base/206547

Log:
  Handle a case in kern_openat() when vn_open() change file type from
  DTYPE_VNODE.
  
  Only acquire locks for O_EXLOCK/O_SHLOCK if file type is still vnode,
  since we allow for fcntl(2) to process with advisory locks for
  DTYPE_VNODE only. Another reason is that all fo_close() routines need to
  check and release locks otherwise.
  
  For O_TRUNC, call fo_truncate() instead of truncating the vnode.
  
  Discussed with:   rwatson
  MFC after:2 week

Modified:
  head/sys/kern/vfs_syscalls.c

Modified: head/sys/kern/vfs_syscalls.c
==
--- head/sys/kern/vfs_syscalls.cTue Apr 13 08:45:55 2010
(r206546)
+++ head/sys/kern/vfs_syscalls.cTue Apr 13 08:52:20 2010
(r206547)
@@ -1047,8 +1047,6 @@ kern_openat(struct thread *td, int fd, c
struct filedesc *fdp = p->p_fd;
struct file *fp;
struct vnode *vp;
-   struct vattr vat;
-   struct mount *mp;
int cmode;
struct file *nfp;
int type, indx, error;
@@ -1141,7 +1139,7 @@ kern_openat(struct thread *td, int fd, c
}
 
VOP_UNLOCK(vp, 0);
-   if (flags & (O_EXLOCK | O_SHLOCK)) {
+   if (fp->f_type == DTYPE_VNODE && (flags & (O_EXLOCK | O_SHLOCK)) != 0) {
lf.l_whence = SEEK_SET;
lf.l_start = 0;
lf.l_len = 0;
@@ -1158,18 +1156,7 @@ kern_openat(struct thread *td, int fd, c
atomic_set_int(&fp->f_flag, FHASLOCK);
}
if (flags & O_TRUNC) {
-   if ((error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0)
-   goto bad;
-   VATTR_NULL(&vat);
-   vat.va_size = 0;
-   vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
-#ifdef MAC
-   error = mac_vnode_check_write(td->td_ucred, fp->f_cred, vp);
-   if (error == 0)
-#endif
-   error = VOP_SETATTR(vp, &vat, td->td_ucred);
-   VOP_UNLOCK(vp, 0);
-   vn_finished_write(mp);
+   error = fo_truncate(fp, 0, td->td_ucred, td);
if (error)
goto bad;
}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r206546 - head/sys/kern

2010-04-13 Thread Konstantin Belousov
Author: kib
Date: Tue Apr 13 08:45:55 2010
New Revision: 206546
URL: http://svn.freebsd.org/changeset/base/206546

Log:
  Remove XXX comment. Add another comment, describing why f_vnode assignment
  is useful.
  
  MFC after:3 days

Modified:
  head/sys/kern/vfs_syscalls.c

Modified: head/sys/kern/vfs_syscalls.c
==
--- head/sys/kern/vfs_syscalls.cTue Apr 13 06:48:37 2010
(r206545)
+++ head/sys/kern/vfs_syscalls.cTue Apr 13 08:45:55 2010
(r206546)
@@ -1124,7 +1124,12 @@ kern_openat(struct thread *td, int fd, c
NDFREE(&nd, NDF_ONLY_PNBUF);
vp = nd.ni_vp;
 
-   fp->f_vnode = vp;   /* XXX Does devfs need this? */
+   /*
+* Store the vnode, for any f_type. Typically, the vnode use
+* count is decremented by direct call to vn_closefile() for
+* files that switched type in the cdevsw fdopen() method.
+*/
+   fp->f_vnode = vp;
/*
 * If the file wasn't claimed by devfs bind it to the normal
 * vnode operations here.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"