svn commit: r248820 - head/etc

2013-03-28 Thread Andriy Gapon
Author: avg
Date: Thu Mar 28 08:13:52 2013
New Revision: 248820
URL: http://svnweb.freebsd.org/changeset/base/248820

Log:
  rc.subr: disabling globbing while processing devfs rules
  
  The rules themselves typically have shell-like patterns and it is
  incorrect when they get replaced with matching filesystem entries.
  
  Shell magic by:   jilles
  MFC after:2 weeks

Modified:
  head/etc/rc.subr

Modified: head/etc/rc.subr
==
--- head/etc/rc.subrThu Mar 28 06:59:58 2013(r248819)
+++ head/etc/rc.subrThu Mar 28 08:13:52 2013(r248820)
@@ -1285,7 +1285,7 @@ make_symlink()
 #
 devfs_rulesets_from_file()
 {
-   local file _err _me
+   local file _err _me _opts
file="$1"
_me="devfs_rulesets_from_file"
_err=0
@@ -1298,6 +1298,11 @@ devfs_rulesets_from_file()
debug "$_me: no such file ($file)"
return 0
fi
+
+   # Disable globbing so that the rule patterns are not expanded
+   # by accident with matching filesystem entries.
+   _opts=$-; set -f
+
debug "reading rulesets from file ($file)"
{ while read line
do
@@ -1344,6 +1349,7 @@ devfs_rulesets_from_file()
break
fi
done } < $file
+   case $_opts in *f*) ;; *) set +f ;; esac
return $_err
 }
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r248824 - head/sys/dev/ciss

2013-03-28 Thread Sean Bruno
Author: sbruno
Date: Thu Mar 28 11:00:41 2013
New Revision: 248824
URL: http://svnweb.freebsd.org/changeset/base/248824

Log:
  Fix compile of ciss(4) with CISS_DEBUG defined
  
  Obtained from:Yahoo! Inc.
  MFC after:2 weeks

Modified:
  head/sys/dev/ciss/ciss.c

Modified: head/sys/dev/ciss/ciss.c
==
--- head/sys/dev/ciss/ciss.cThu Mar 28 10:08:58 2013(r248823)
+++ head/sys/dev/ciss/ciss.cThu Mar 28 11:00:41 2013(r248824)
@@ -1868,7 +1868,7 @@ ciss_accept_media(struct ciss_softc *sc,
 
 ldrive = CISS_LUN_TO_TARGET(ld->cl_address.logical.lun);
 
-debug(0, "bringing logical drive %d back online");
+debug(0, "bringing logical drive %d back online", ldrive);
 
 /*
  * Build a CISS BMIC command to bring the drive back online.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r248825 - head/sys/dev/mps

2013-03-28 Thread Alexander Motin
Author: mav
Date: Thu Mar 28 11:24:30 2013
New Revision: 248825
URL: http://svnweb.freebsd.org/changeset/base/248825

Log:
  Except one case mps(4) driver does not touch the data and works well with
  unmapped I/O.  That one exception is access to INQUIRY VPD request result.
  Those requests are never unmapped now, but to be safe add respective check
  there and allow unmapped I/O for the SIM by setting PIM_UNMAPPED flag.

Modified:
  head/sys/dev/mps/mps_sas.c

Modified: head/sys/dev/mps/mps_sas.c
==
--- head/sys/dev/mps/mps_sas.c  Thu Mar 28 11:00:41 2013(r248824)
+++ head/sys/dev/mps/mps_sas.c  Thu Mar 28 11:24:30 2013(r248825)
@@ -914,7 +914,7 @@ mpssas_action(struct cam_sim *sim, union
cpi->version_num = 1;
cpi->hba_inquiry = PI_SDTR_ABLE|PI_TAG_ABLE|PI_WIDE_16;
cpi->target_sprt = 0;
-   cpi->hba_misc = PIM_NOBUSRESET;
+   cpi->hba_misc = PIM_NOBUSRESET | PIM_UNMAPPED;
cpi->hba_eng_cnt = 0;
cpi->max_target = sassc->sc->facts->MaxTargets - 1;
cpi->max_lun = 255;
@@ -2238,6 +2238,7 @@ mpssas_scsiio_complete(struct mps_softc 
if ((csio->cdb_io.cdb_bytes[0] == INQUIRY) &&
(csio->cdb_io.cdb_bytes[1] & SI_EVPD) &&
(csio->cdb_io.cdb_bytes[2] == SVPD_SUPPORTED_PAGE_LIST) &&
+   ((csio->ccb_h.flags & CAM_DATA_MASK) == CAM_DATA_VADDR) &&
(csio->data_ptr != NULL) && (((uint8_t *)cm->cm_data)[0] ==
T_SEQUENTIAL) && (sc->control_TLR) &&
(sc->mapping_table[csio->ccb_h.target_id].device_info &
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r248826 - head/sys/dev/ciss

2013-03-28 Thread Sean Bruno
Author: sbruno
Date: Thu Mar 28 12:44:43 2013
New Revision: 248826
URL: http://svnweb.freebsd.org/changeset/base/248826

Log:
  Restore DB_COMMAND capabilities of ciss(4) for debugging and diagnostics
  
  Obtained from:Yahoo! Inc.
  MFC after:2 weeks

Modified:
  head/sys/dev/ciss/ciss.c

Modified: head/sys/dev/ciss/ciss.c
==
--- head/sys/dev/ciss/ciss.cThu Mar 28 11:24:30 2013(r248825)
+++ head/sys/dev/ciss/ciss.cThu Mar 28 12:44:43 2013(r248826)
@@ -4301,6 +4301,9 @@ ciss_print_ldrive(struct ciss_softc *sc,
 }
 
 #ifdef CISS_DEBUG
+#include "opt_ddb.h"
+#ifdef DDB
+#include 
 /
  * Print information about the controller/driver.
  */
@@ -4335,8 +4338,7 @@ ciss_print_adapter(struct ciss_softc *sc
 }
 
 /* DDB hook */
-static void
-ciss_print0(void)
+DB_COMMAND(ciss_prt, db_ciss_prt)
 {
 struct ciss_softc  *sc;
 
@@ -4348,6 +4350,7 @@ ciss_print0(void)
 }
 }
 #endif
+#endif
 
 /
  * Return a name for a logical drive status value.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r248827 - head/share/misc

2013-03-28 Thread Tijl Coosemans
Author: tijl
Date: Thu Mar 28 12:46:04 2013
New Revision: 248827
URL: http://svnweb.freebsd.org/changeset/base/248827

Log:
  Add myself as ports committer.
  
  Approved by:  crees (mentor)

Modified:
  head/share/misc/committers-ports.dot

Modified: head/share/misc/committers-ports.dot
==
--- head/share/misc/committers-ports.dotThu Mar 28 12:44:43 2013
(r248826)
+++ head/share/misc/committers-ports.dotThu Mar 28 12:46:04 2013
(r248827)
@@ -194,6 +194,7 @@ sylvio [label="Sylvio Cesar Teixeira\nsy
 tabthorpe [label="Thomas Abthorpe\ntabtho...@freebsd.org\n2007/08/20"]
 tdb [label="Tim Bishop\n...@freebsd.org\n2005/11/30"]
 thierry [label="Thierry Thomas\nthie...@freebsd.org\n2004/03/15"]
+tijl [label="Tijl Coosemans\nt...@freebsd.org\n2013/03/27"]
 timur [label="Timur Bakeyev\nti...@freebsd.org\n2007/06/07"]
 tj [label="Tom Judge\n...@freebsd.org\n2012/05/28"]
 tmclaugh [label="Tom McLaughlin\ntmcla...@freebsd.org\n2005/09/15"]
@@ -266,6 +267,7 @@ crees -> gjb
 crees -> jgh
 crees -> madpilot
 crees -> gblach
+crees -> tijl
 
 culot -> jase
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r248830 - head/sys/kern

2013-03-28 Thread Scott Long
Author: scottl
Date: Thu Mar 28 14:14:28 2013
New Revision: 248830
URL: http://svnweb.freebsd.org/changeset/base/248830

Log:
  Several fixes and improvements to sendfile()
  
  1.  If we wanted to send exactly as many bytes as the socket buffer is
  sized for, the inner loop of kern_sendfile() would see that the
  socket is full before seeing that it had no more bytes left to send.
  This would cause it to return EAGAIN to the caller instead of
  success.  Fix by changing the order that these conditions are tested.
  2.  Simplify the calculation for the bytes to send in each iteration of
  the inner loop of kern_sendfile()
  3.  Fix some calls with bogus arguments to sf_buf_ext().  These would
  only trigger on mbuf allocation failure, but would be hilariously
  bad if they did trigger.
  
  Submitted by: gibbs(3), andre(2)
  Reviewed by:  emax, andre
  Obtained from:Netflix
  MFC after:1 week

Modified:
  head/sys/kern/uipc_syscalls.c

Modified: head/sys/kern/uipc_syscalls.c
==
--- head/sys/kern/uipc_syscalls.c   Thu Mar 28 13:45:45 2013
(r248829)
+++ head/sys/kern/uipc_syscalls.c   Thu Mar 28 14:14:28 2013
(r248830)
@@ -2115,7 +2115,7 @@ retry_space:
 * Loop and construct maximum sized mbuf chain to be bulk
 * dumped into socket buffer.
 */
-   while (space > loopbytes) {
+   while (1) {
vm_pindex_t pindex;
vm_offset_t pgoff;
struct mbuf *m0;
@@ -2127,15 +2127,12 @@ retry_space:
 * or the passed in nbytes.
 */
pgoff = (vm_offset_t)(off & PAGE_MASK);
-   xfsize = omin(PAGE_SIZE - pgoff,
-   obj->un_pager.vnp.vnp_size - uap->offset -
-   fsbytes - loopbytes);
if (uap->nbytes)
rem = (uap->nbytes - fsbytes - loopbytes);
else
rem = obj->un_pager.vnp.vnp_size -
uap->offset - fsbytes - loopbytes;
-   xfsize = omin(rem, xfsize);
+   xfsize = omin(PAGE_SIZE - pgoff, rem);
xfsize = omin(space - loopbytes, xfsize);
if (xfsize <= 0) {
VM_OBJECT_WUNLOCK(obj);
@@ -2144,6 +2141,16 @@ retry_space:
}
 
/*
+* We've already overfilled the socket.
+* Let the outer loop figure out how to handle it.
+*/
+   if (space <= loopbytes) {
+   VM_OBJECT_WUNLOCK(obj);
+   done = 0;
+   break;
+   }
+
+   /*
 * Attempt to look up the page.  Allocate
 * if not found or wait and loop if busy.
 */
@@ -2249,14 +2256,14 @@ retry_space:
m0 = m_get((mnw ? M_NOWAIT : M_WAITOK), MT_DATA);
if (m0 == NULL) {
error = (mnw ? EAGAIN : ENOBUFS);
-   sf_buf_mext((void *)sf_buf_kva(sf), sf);
+   sf_buf_mext(NULL, sf);
break;
}
if (m_extadd(m0, (caddr_t )sf_buf_kva(sf), PAGE_SIZE,
sf_buf_mext, sfs, sf, M_RDONLY, EXT_SFBUF,
(mnw ? M_NOWAIT : M_WAITOK)) != 0) {
error = (mnw ? EAGAIN : ENOBUFS);
-   sf_buf_mext((void *)sf_buf_kva(sf), sf);
+   sf_buf_mext(NULL, sf);
m_freem(m0);
break;
}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r248834 - head/sys/dev/nvme

2013-03-28 Thread Jim Harris
Author: jimharris
Date: Thu Mar 28 16:54:19 2013
New Revision: 248834
URL: http://svnweb.freebsd.org/changeset/base/248834

Log:
  Delete extra IO qpairs allocated based on number of MSI-X vectors, but
  later found to not be usable because the controller doesn't support the
  same number of queues.
  
  This is not the normal case, but does occur with the Chatham prototype
  board.
  
  Sponsored by: Intel

Modified:
  head/sys/dev/nvme/nvme_ctrlr.c

Modified: head/sys/dev/nvme/nvme_ctrlr.c
==
--- head/sys/dev/nvme/nvme_ctrlr.c  Thu Mar 28 15:04:03 2013
(r248833)
+++ head/sys/dev/nvme/nvme_ctrlr.c  Thu Mar 28 16:54:19 2013
(r248834)
@@ -489,7 +489,7 @@ static int
 nvme_ctrlr_set_num_qpairs(struct nvme_controller *ctrlr)
 {
struct nvme_completion_poll_status  status;
-   int cq_allocated, sq_allocated;
+   int cq_allocated, i, sq_allocated;
 
status.done = FALSE;
nvme_ctrlr_cmd_set_num_queues(ctrlr, ctrlr->num_io_queues,
@@ -511,16 +511,24 @@ nvme_ctrlr_set_num_qpairs(struct nvme_co
 
/*
 * Check that the controller was able to allocate the number of
-*  queues we requested.  If not, revert to one IO queue.
+*  queues we requested.  If not, revert to one IO queue pair.
 */
if (sq_allocated < ctrlr->num_io_queues ||
cq_allocated < ctrlr->num_io_queues) {
-   ctrlr->num_io_queues = 1;
-   ctrlr->per_cpu_io_queues = 0;
 
-   /* TODO: destroy extra queues that were created
-*  previously but now found to be not needed.
+   /*
+* Destroy extra IO queue pairs that were created at
+*  controller construction time but are no longer
+*  needed.  This will only happen when a controller
+*  supports fewer queues than MSI-X vectors.  This
+*  is not the normal case, but does occur with the
+*  Chatham prototype board.
 */
+   for (i = 1; i < ctrlr->num_io_queues; i++)
+   nvme_io_qpair_destroy(&ctrlr->ioq[i]);
+
+   ctrlr->num_io_queues = 1;
+   ctrlr->per_cpu_io_queues = 0;
}
 
return (0);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r248835 - head/sys/dev/nvme

2013-03-28 Thread Jim Harris
Author: jimharris
Date: Thu Mar 28 16:57:48 2013
New Revision: 248835
URL: http://svnweb.freebsd.org/changeset/base/248835

Log:
  Remove obsolete comment.  This code has now been tested with the QEMU
  NVMe device emulator.

Modified:
  head/sys/dev/nvme/nvme_ns.c

Modified: head/sys/dev/nvme/nvme_ns.c
==
--- head/sys/dev/nvme/nvme_ns.c Thu Mar 28 16:54:19 2013(r248834)
+++ head/sys/dev/nvme/nvme_ns.c Thu Mar 28 16:57:48 2013(r248835)
@@ -248,10 +248,6 @@ nvme_ns_bio_process(struct nvme_namespac
err = nvme_ns_cmd_flush(ns, nvme_ns_bio_done, bp);
break;
case BIO_DELETE:
-   /*
-* Note: Chatham2 doesn't support DSM, so this code
-*  can't be fully tested yet.
-*/
dsm_range =
malloc(sizeof(struct nvme_dsm_range), M_NVME,
M_ZERO | M_WAITOK);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r248836 - head/gnu/usr.bin/gdb/kgdb

2013-03-28 Thread Will Andrews
Author: will
Date: Thu Mar 28 17:04:59 2013
New Revision: 248836
URL: http://svnweb.freebsd.org/changeset/base/248836

Log:
  KGDB: Allow modules to be loaded from the specified kernel's directory.
  
  When looking up the absolute path for a kld, call find_kld_path() first.
  This enables locating the module in a different directory than the one
  stored in kernel memory.
  
  With this change, kgdb can now be run on a kernel & vmcore whose associated
  modules are located in the same directory as the kernel.  This makes
  independent triaging of problems much easier.
  
  This change also does not break the normal kgdb use case where no arguments
  are specified; in that case kgdb loads the running kernel and its modules.
  
  Reviewed by:  adrian
  Approved by:  ken (mentor)
  Sponsored by: Spectra Logic
  MFC after:1 month

Modified:
  head/gnu/usr.bin/gdb/kgdb/kld.c

Modified: head/gnu/usr.bin/gdb/kgdb/kld.c
==
--- head/gnu/usr.bin/gdb/kgdb/kld.c Thu Mar 28 16:57:48 2013
(r248835)
+++ head/gnu/usr.bin/gdb/kgdb/kld.c Thu Mar 28 17:04:59 2013
(r248836)
@@ -382,7 +382,10 @@ kld_current_sos (void)
 * Try to read the pathname (if it exists) and store
 * it in so_name.
 */
-   if (off_pathname != 0) {
+   if (find_kld_path(new->so_original_name, new->so_name,
+   sizeof(new->so_name))) {
+   /* we found the kld */;
+   } else if (off_pathname != 0) {
target_read_string(read_pointer(kld + off_pathname),
&path, sizeof(new->so_name), &error);
if (error != 0) {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r248838 - head/gnu/usr.bin/gdb/kgdb

2013-03-28 Thread Will Andrews
Author: will
Date: Thu Mar 28 17:07:02 2013
New Revision: 248838
URL: http://svnweb.freebsd.org/changeset/base/248838

Log:
  KGDB: Accept KLD symbol files with the ".symbols" extension.
  
  Submitted by: gibbs
  Approved by:  ken (mentor)
  Sponsored by: Spectra Logic
  MFC after:1 month

Modified:
  head/gnu/usr.bin/gdb/kgdb/kld.c

Modified: head/gnu/usr.bin/gdb/kgdb/kld.c
==
--- head/gnu/usr.bin/gdb/kgdb/kld.c Thu Mar 28 17:06:08 2013
(r248837)
+++ head/gnu/usr.bin/gdb/kgdb/kld.c Thu Mar 28 17:07:02 2013
(r248838)
@@ -78,6 +78,7 @@ kld_ok (char *path)
  */
 static const char *kld_suffixes[] = {
".debug",
+   ".symbols",
"",
NULL
 };
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r248840 - head/share/examples/bhyve

2013-03-28 Thread Neel Natu
Author: neel
Date: Thu Mar 28 18:03:39 2013
New Revision: 248840
URL: http://svnweb.freebsd.org/changeset/base/248840

Log:
  Add the "-g " option to the vmrun.sh script that enables remote
  debugging of the guest via kgdb.
  
  See also: https://wiki.freebsd.org/BHyVe/gdb
  
  Obtained from:NetApp

Modified:
  head/share/examples/bhyve/vmrun.sh

Modified: head/share/examples/bhyve/vmrun.sh
==
--- head/share/examples/bhyve/vmrun.sh  Thu Mar 28 17:27:46 2013
(r248839)
+++ head/share/examples/bhyve/vmrun.sh  Thu Mar 28 18:03:39 2013
(r248840)
@@ -39,11 +39,12 @@ DEFAULT_VIRTIO_DISK="./diskdev"
 DEFAULT_ISOFILE="./release.iso"
 
 usage() {
-   echo "Usage: vmrun.sh [-hai][-m ][-d ][-I ][-t ] "
+   echo "Usage: vmrun.sh [-hai][-g ][-m ][-d ][-I ][-t ] "
echo "   -h: display this help message"
echo "   -a: force memory mapped local apic access"
echo "   -c: number of virtual cpus (default is ${DEFAULT_CPUS})"
echo "   -d: virtio diskdev file (default is 
${DEFAULT_VIRTIO_DISK})"
+   echo "   -g: listen for connection from kgdb at "
echo "   -i: force boot of the Installation CDROM image"
echo "   -I: Installation CDROM image location (default is 
${DEFAULT_ISOFILE})"
echo "   -m: memory size in MB (default is ${DEFAULT_MEMSIZE}MB)"
@@ -71,8 +72,9 @@ cpus=${DEFAULT_CPUS}
 virtio_diskdev=${DEFAULT_VIRTIO_DISK}
 tapdev=${DEFAULT_TAPDEV}
 apic_opt=""
+gdbport=0
 
-while getopts haic:I:m:d:t: c ; do
+while getopts haic:g:I:m:d:t: c ; do
case $c in
h)
usage
@@ -83,6 +85,8 @@ while getopts haic:I:m:d:t: c ; do
d)
virtio_diskdev=${OPTARG}
;;
+   g)  gdbport=${OPTARG}
+   ;;
i)
force_install=1
;;
@@ -164,7 +168,8 @@ while [ 1 ]; do
break
fi
 
-   ${FBSDRUN} -c ${cpus} -m ${memsize} ${apic_opt} -AI -H -P -g 0  \
+   ${FBSDRUN} -c ${cpus} -m ${memsize} ${apic_opt} -AI -H -P   \
+   -g ${gdbport}   \
-s 0:0,hostbridge   \
-s 1:0,virtio-net,${tapdev} \
-s 2:0,virtio-blk,${virtio_diskdev} \
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r248842 - in head: lib/libpmc sys/dev/hwpmc sys/sys

2013-03-28 Thread Sean Bruno
Author: sbruno
Date: Thu Mar 28 19:15:54 2013
New Revision: 248842
URL: http://svnweb.freebsd.org/changeset/base/248842

Log:
  Update hwpmc to support Haswell class processors.
  0x3C:  /* Per Intel document 325462-045US 01/2013. */
  
  Add manpage to document all the goodness that is available in this
  processor model.
  
  Submitted by: hiren panchasara 
  Reviewed by:  jimharris, sbruno
  Obtained from:Yahoo! Inc.
  MFC after:2 weeks

Added:
  head/lib/libpmc/pmc.haswell.3   (contents, props changed)
  head/lib/libpmc/pmc.haswelluc.3   (contents, props changed)
Modified:
  head/lib/libpmc/Makefile
  head/lib/libpmc/libpmc.c
  head/sys/dev/hwpmc/hwpmc_core.c
  head/sys/dev/hwpmc/hwpmc_intel.c
  head/sys/dev/hwpmc/hwpmc_uncore.c
  head/sys/dev/hwpmc/pmc_events.h
  head/sys/sys/pmc.h

Modified: head/lib/libpmc/Makefile
==
--- head/lib/libpmc/MakefileThu Mar 28 18:06:09 2013(r248841)
+++ head/lib/libpmc/MakefileThu Mar 28 19:15:54 2013(r248842)
@@ -27,6 +27,8 @@ MAN+= pmc.soft.3
 MAN+=  pmc.atom.3
 MAN+=  pmc.core.3
 MAN+=  pmc.core2.3
+MAN+=  pmc.haswell.3
+MAN+=  pmc.haswelluc.3
 MAN+=  pmc.iaf.3
 MAN+=  pmc.ivybridge.3
 MAN+=  pmc.ivybridgexeon.3

Modified: head/lib/libpmc/libpmc.c
==
--- head/lib/libpmc/libpmc.cThu Mar 28 18:06:09 2013(r248841)
+++ head/lib/libpmc/libpmc.cThu Mar 28 19:15:54 2013(r248842)
@@ -183,6 +183,11 @@ static const struct pmc_event_descr core
__PMC_EV_ALIAS_COREI7()
 };
 
+static const struct pmc_event_descr haswell_event_table[] =
+{
+   __PMC_EV_ALIAS_HASWELL()
+};
+
 static const struct pmc_event_descr ivybridge_event_table[] =
 {
__PMC_EV_ALIAS_IVYBRIDGE()
@@ -213,6 +218,11 @@ static const struct pmc_event_descr core
__PMC_EV_ALIAS_COREI7UC()
 };
 
+static const struct pmc_event_descr haswelluc_event_table[] =
+{
+   __PMC_EV_ALIAS_HASWELLUC()
+};
+
 static const struct pmc_event_descr sandybridgeuc_event_table[] =
 {
__PMC_EV_ALIAS_SANDYBRIDGEUC()
@@ -237,6 +247,7 @@ PMC_MDEP_TABLE(atom, IAP, PMC_CLASS_SOFT
 PMC_MDEP_TABLE(core, IAP, PMC_CLASS_SOFT, PMC_CLASS_TSC);
 PMC_MDEP_TABLE(core2, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC);
 PMC_MDEP_TABLE(corei7, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, 
PMC_CLASS_UCF, PMC_CLASS_UCP);
+PMC_MDEP_TABLE(haswell, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, 
PMC_CLASS_UCF, PMC_CLASS_UCP);
 PMC_MDEP_TABLE(ivybridge, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC);
 PMC_MDEP_TABLE(ivybridge_xeon, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, 
PMC_CLASS_TSC);
 PMC_MDEP_TABLE(sandybridge, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, 
PMC_CLASS_UCF, PMC_CLASS_UCP);
@@ -277,6 +288,7 @@ PMC_CLASS_TABLE_DESC(atom, IAP, atom, ia
 PMC_CLASS_TABLE_DESC(core, IAP, core, iap);
 PMC_CLASS_TABLE_DESC(core2, IAP, core2, iap);
 PMC_CLASS_TABLE_DESC(corei7, IAP, corei7, iap);
+PMC_CLASS_TABLE_DESC(haswell, IAP, haswell, iap);
 PMC_CLASS_TABLE_DESC(ivybridge, IAP, ivybridge, iap);
 PMC_CLASS_TABLE_DESC(ivybridge_xeon, IAP, ivybridge_xeon, iap);
 PMC_CLASS_TABLE_DESC(sandybridge, IAP, sandybridge, iap);
@@ -284,6 +296,7 @@ PMC_CLASS_TABLE_DESC(sandybridge_xeon, I
 PMC_CLASS_TABLE_DESC(westmere, IAP, westmere, iap);
 PMC_CLASS_TABLE_DESC(ucf, UCF, ucf, ucf);
 PMC_CLASS_TABLE_DESC(corei7uc, UCP, corei7uc, ucp);
+PMC_CLASS_TABLE_DESC(haswelluc, UCP, haswelluc, ucp);
 PMC_CLASS_TABLE_DESC(sandybridgeuc, UCP, sandybridgeuc, ucp);
 PMC_CLASS_TABLE_DESC(westmereuc, UCP, westmereuc, ucp);
 #endif
@@ -582,6 +595,8 @@ static struct pmc_event_alias core2_alia
 #defineatom_aliases_without_iafcore2_aliases_without_iaf
 #define corei7_aliases core2_aliases
 #define corei7_aliases_without_iaf core2_aliases_without_iaf
+#define haswell_aliasescore2_aliases
+#define haswell_aliases_without_iafcore2_aliases_without_iaf
 #define ivybridge_aliases  core2_aliases
 #define ivybridge_aliases_without_iaf  core2_aliases_without_iaf
 #define ivybridge_xeon_aliases core2_aliases
@@ -740,6 +755,31 @@ static struct pmc_masks iap_rsp_mask_sb_
NULLMASK
 };
 
+static struct pmc_masks iap_rsp_mask_haswell[] = {
+   PMCMASK(REQ_DMND_DATA_RD,   (1ULL <<  0)),
+   PMCMASK(REQ_DMND_RFO,   (1ULL <<  1)),
+   PMCMASK(REQ_DMND_IFETCH,(1ULL <<  2)),
+   PMCMASK(REQ_PF_DATA_RD, (1ULL <<  4)),
+   PMCMASK(REQ_PF_RFO, (1ULL <<  5)),
+   PMCMASK(REQ_PF_IFETCH,  (1ULL <<  6)),
+   PMCMASK(REQ_OTHER,  (1ULL << 15)),
+   PMCMASK(RES_ANY,(1ULL << 16)),
+   PMCMASK(RES_SUPPLIER_SUPP,  (1ULL << 17)),
+   PMCMASK(RES_SUPPLIER_LLC_HITM,  (1ULL << 18)),
+   PMCMASK(RES_SUPPLIER_LLC_HITE,  (1ULL << 19)),
+   PMCMASK(RE

svn commit: r248843 - head/sys/mips/atheros

2013-03-28 Thread Adrian Chadd
Author: adrian
Date: Thu Mar 28 19:27:06 2013
New Revision: 248843
URL: http://svnweb.freebsd.org/changeset/base/248843

Log:
  Bring over the initial, CPU-only UART support for the AR933x SoC.
  
  This implements the kernel glue needed (getc, putc, rxready).
  
  This isn't a 16550 UART, even if the datasheet overview claims so.
  
  The Linux ar933x support was used as a reference, however the uart code
  is a reimplementation.
  
  Attentive viewers will note that the uart code is based off of the ns8250
  code and the UART bus code is a stubbed-out version of this.  I'll be
  replacing it with non-stubbed versions soon, making this a fully featured
  driver.
  
  Tested:
  
  * AP121 reference board (AR933x), booting through the mountroot> prompt;
then doing some basic interactive tests in ddb.

Added:
  head/sys/mips/atheros/uart_bus_ar933x.c   (contents, props changed)
  head/sys/mips/atheros/uart_cpu_ar933x.c   (contents, props changed)
  head/sys/mips/atheros/uart_dev_ar933x.c   (contents, props changed)
  head/sys/mips/atheros/uart_dev_ar933x.h   (contents, props changed)

Added: head/sys/mips/atheros/uart_bus_ar933x.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/mips/atheros/uart_bus_ar933x.c Thu Mar 28 19:27:06 2013
(r248843)
@@ -0,0 +1,91 @@
+/*-
+ * Copyright (c) 2012, Adrian Chadd 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ */
+#include "opt_uart.h"
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+
+#include "uart_if.h"
+
+static int uart_ar933x_probe(device_t dev);
+extern struct uart_class uart_ar933x_uart_class;
+
+static device_method_t uart_ar933x_methods[] = {
+   /* Device interface */
+   DEVMETHOD(device_probe, uart_ar933x_probe),
+   DEVMETHOD(device_attach,uart_bus_attach),
+   DEVMETHOD(device_detach,uart_bus_detach),
+   { 0, 0 }
+};
+
+static driver_t uart_ar933x_driver = {
+   uart_driver_name,
+   uart_ar933x_methods,
+   sizeof(struct uart_softc),
+};
+
+extern SLIST_HEAD(uart_devinfo_list, uart_devinfo) uart_sysdevs;
+
+static int
+uart_ar933x_probe(device_t dev)
+{
+   struct uart_softc *sc;
+   uint64_t freq;
+
+   freq = ar71xx_ahb_freq();
+
+   sc = device_get_softc(dev);
+   sc->sc_sysdev = SLIST_FIRST(&uart_sysdevs);
+   sc->sc_class = &uart_ar933x_class;
+   bcopy(&sc->sc_sysdev->bas, &sc->sc_bas, sizeof(sc->sc_bas));
+   sc->sc_sysdev->bas.regshft = 0;
+   sc->sc_sysdev->bas.bst = mips_bus_space_generic;
+   sc->sc_sysdev->bas.bsh = MIPS_PHYS_TO_KSEG1(AR71XX_UART_ADDR);
+   sc->sc_bas.regshft = 0;
+   sc->sc_bas.bst = mips_bus_space_generic;
+   sc->sc_bas.bsh = MIPS_PHYS_TO_KSEG1(AR71XX_UART_ADDR);
+
+   return (uart_bus_probe(dev, 2, freq, 0, 0));
+}
+
+DRIVER_MODULE(uart, apb, uart_ar933x_driver, uart_devclass, 0, 0);

Added: head/sys/mips/atheros/uart_cpu_ar933x.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/mips/atheros/uart_cpu_ar933x.c Thu Mar 28 19:27:06 2013
(r248843)
@@ -0,0 +1,78 @@
+/*-
+ * Copyright (c) 2012 Adrian Chadd 
+ * 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 

svn commit: r248844 - head/sys/mips/atheros

2013-03-28 Thread Adrian Chadd
Author: adrian
Date: Thu Mar 28 19:30:56 2013
New Revision: 248844
URL: http://svnweb.freebsd.org/changeset/base/248844

Log:
  Tie in the AR933x support into -HEAD.

Modified:
  head/sys/mips/atheros/ar71xx_setup.c
  head/sys/mips/atheros/files.ar71xx

Modified: head/sys/mips/atheros/ar71xx_setup.c
==
--- head/sys/mips/atheros/ar71xx_setup.cThu Mar 28 19:27:06 2013
(r248843)
+++ head/sys/mips/atheros/ar71xx_setup.cThu Mar 28 19:30:56 2013
(r248844)
@@ -52,6 +52,8 @@ __FBSDID("$FreeBSD$");
 #include 
  
 #include 
+#include 
+
 #include 
 
 #include 
@@ -59,8 +61,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-
-#include 
+#include 
 
 #defineAR71XX_SYS_TYPE_LEN 128
 
@@ -142,7 +143,18 @@ ar71xx_detect_sys_type(void)
break;
}
break;
-
+   case REV_ID_MAJOR_AR9330:
+   minor = 0;
+   rev = (id & AR933X_REV_ID_REVISION_MASK);
+   chip = "9330";
+   ar71xx_cpu_ops = &ar933x_chip_def;
+   break;
+   case REV_ID_MAJOR_AR9331:
+   minor = 1;
+   rev = (id & AR933X_REV_ID_REVISION_MASK);
+   chip = "9331";
+   ar71xx_cpu_ops = &ar933x_chip_def;
+   break;
 
default:
panic("ar71xx: unknown chip id:0x%08x\n", id);

Modified: head/sys/mips/atheros/files.ar71xx
==
--- head/sys/mips/atheros/files.ar71xx  Thu Mar 28 19:27:06 2013
(r248843)
+++ head/sys/mips/atheros/files.ar71xx  Thu Mar 28 19:30:56 2013
(r248844)
@@ -14,6 +14,9 @@ mips/atheros/ar71xx_wdog.coptional ar71
 mips/atheros/if_arge.c optional arge
 mips/atheros/uart_bus_ar71xx.c optional uart_ar71xx
 mips/atheros/uart_cpu_ar71xx.c optional uart_ar71xx
+mips/atheros/uart_bus_ar933x.c optional uart_ar933x
+mips/atheros/uart_cpu_ar933x.c optional uart_ar933x
+mips/atheros/uart_dev_ar933x.c optional uart_ar933x
 mips/atheros/ar71xx_bus_space_reversed.c   standard
 mips/mips/intr_machdep.cstandard
 mips/mips/tick.c   standard
@@ -21,6 +24,7 @@ mips/atheros/ar71xx_setup.c   standard
 mips/atheros/ar71xx_chip.c standard
 mips/atheros/ar724x_chip.c standard
 mips/atheros/ar91xx_chip.c standard
+mips/atheros/ar933x_chip.c standard
 mips/atheros/ar71xx_fixup.coptional ar71xx_ath_eeprom
 
 dev/hwpmc/hwpmc_mips24k.c  optional hwpmc_mips24k
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r248845 - head/cddl/lib/libdtrace

2013-03-28 Thread George V. Neville-Neil
Author: gnn
Date: Thu Mar 28 20:12:46 2013
New Revision: 248845
URL: http://svnweb.freebsd.org/changeset/base/248845

Log:
  Remove dependency code that caused a double inclusion.
  
  Pointed out by: rpaulo and others

Modified:
  head/cddl/lib/libdtrace/io.d

Modified: head/cddl/lib/libdtrace/io.d
==
--- head/cddl/lib/libdtrace/io.dThu Mar 28 19:30:56 2013
(r248844)
+++ head/cddl/lib/libdtrace/io.dThu Mar 28 20:12:46 2013
(r248845)
@@ -27,8 +27,6 @@
 
 #pragma ident  "%Z%%M% %I% %E% SMI"
 
-#pragma D depends_on provider io
-
 typedef struct devinfo {
 int dev_major;  /* major number */
 int dev_minor;  /* minor number */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r248846 - head/cddl/lib/libdtrace

2013-03-28 Thread George V. Neville-Neil
Author: gnn
Date: Thu Mar 28 20:22:43 2013
New Revision: 248846
URL: http://svnweb.freebsd.org/changeset/base/248846

Log:
  Revert previous change in favor of a fix to the actual dtrace
  libraries that addresses a #pragma issue.

Modified:
  head/cddl/lib/libdtrace/io.d

Modified: head/cddl/lib/libdtrace/io.d
==
--- head/cddl/lib/libdtrace/io.dThu Mar 28 20:12:46 2013
(r248845)
+++ head/cddl/lib/libdtrace/io.dThu Mar 28 20:22:43 2013
(r248846)
@@ -27,6 +27,8 @@
 
 #pragma ident  "%Z%%M% %I% %E% SMI"
 
+#pragma D depends_on provider io
+
 typedef struct devinfo {
 int dev_major;  /* major number */
 int dev_minor;  /* minor number */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r248848 - head/cddl/contrib/opensolaris/lib/libdtrace/common

2013-03-28 Thread George V. Neville-Neil
Author: gnn
Date: Thu Mar 28 20:31:03 2013
New Revision: 248848
URL: http://svnweb.freebsd.org/changeset/base/248848

Log:
  Commit a patch that fixes a problem in the #pragma statement when searching
  for and loading dependent modules.  This addresses a bug seen with
  io.d where it was being doubly included.
  
  PR:   171678
  Submitted by:  Mark Johnston
  MFC after:2 weeks

Modified:
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pragma.c

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pragma.c
==
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pragma.c  Thu Mar 
28 20:27:01 2013(r248847)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pragma.c  Thu Mar 
28 20:31:03 2013(r248848)
@@ -241,6 +241,8 @@ dt_pragma_depends(const char *prname, dt
int found;
dt_lib_depend_t *dld;
char lib[MAXPATHLEN];
+   size_t plen;
+   char *provs, *cpy, *tok;
 
if (cnp == NULL || nnp == NULL ||
cnp->dn_kind != DT_NODE_IDENT || nnp->dn_kind != DT_NODE_IDENT) {
@@ -248,9 +250,31 @@ dt_pragma_depends(const char *prname, dt
" \n", prname);
}
 
-   if (strcmp(cnp->dn_string, "provider") == 0)
-   found = dt_provider_lookup(dtp, nnp->dn_string) != NULL;
-   else if (strcmp(cnp->dn_string, "module") == 0) {
+   if (strcmp(cnp->dn_string, "provider") == 0) {
+   /*
+* First try to get the provider list using the
+* debug.dtrace.providers sysctl, since that'll work even if
+* we're not running as root.
+*/
+   provs = NULL;
+   if (sysctlbyname("debug.dtrace.providers", NULL, &plen, NULL, 
0) ||
+   ((provs = dt_alloc(dtp, plen)) == NULL) ||
+   sysctlbyname("debug.dtrace.providers", provs, &plen, NULL, 
0))
+   found = dt_provider_lookup(dtp, nnp->dn_string) != NULL;
+   else {
+   found = B_FALSE;
+   for (cpy = provs; (tok = strsep(&cpy, " ")) != NULL; )
+   if (strcmp(tok, nnp->dn_string) == 0) {
+   found = B_TRUE;
+   break;
+   }
+   if (found == B_FALSE)
+   found = dt_provider_lookup(dtp,
+   nnp->dn_string) != NULL;
+   }
+   if (provs != NULL)
+   dt_free(dtp, provs);
+   } else if (strcmp(cnp->dn_string, "module") == 0) {
dt_module_t *mp = dt_module_lookup_by_name(dtp, nnp->dn_string);
found = mp != NULL && dt_module_getctf(dtp, mp) != NULL;
} else if (strcmp(cnp->dn_string, "library") == 0) {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r248849 - head/usr.bin/unifdef

2013-03-28 Thread Tony Finch
Author: fanf
Date: Thu Mar 28 20:33:07 2013
New Revision: 248849
URL: http://svnweb.freebsd.org/changeset/base/248849

Log:
  Update to upstream version 2.7
  
  The most notable new feature is support for processing multiple
  files in one invocation. There is also support for more make-friendly
  exit statuses.
  
  The most notable bug fix is #line directives now include the input
  file name.
  
  Obtained from: http://dotat.at/prog/unifdef

Added:
  head/usr.bin/unifdef/unifdef.h   (contents, props changed)
Modified:
  head/usr.bin/unifdef/unifdef.1
  head/usr.bin/unifdef/unifdef.c
  head/usr.bin/unifdef/unifdefall.sh

Modified: head/usr.bin/unifdef/unifdef.1
==
--- head/usr.bin/unifdef/unifdef.1  Thu Mar 28 20:31:03 2013
(r248848)
+++ head/usr.bin/unifdef/unifdef.1  Thu Mar 28 20:33:07 2013
(r248849)
@@ -1,6 +1,6 @@
 .\" Copyright (c) 1985, 1991, 1993
 .\"The Regents of the University of California.  All rights reserved.
-.\" Copyright (c) 2002 - 2010 Tony Finch .  All rights reserved.
+.\" Copyright (c) 2002 - 2013 Tony Finch .  All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Dave Yost. It was rewritten to support ANSI C by Tony Finch.
@@ -31,23 +31,23 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 11, 2010
-.Dt UNIFDEF 1
-.Os
+.Dd February 21, 2012
+.Dt UNIFDEF 1 PRM
+.Os " "
 .Sh NAME
 .Nm unifdef , unifdefall
 .Nd remove preprocessor conditionals from code
 .Sh SYNOPSIS
 .Nm
-.Op Fl bBcdeKknsStV
+.Op Fl bBcdehKkmnsStV
 .Op Fl I Ns Ar path
-.Op Fl D Ns Ar sym Ns Op = Ns Ar val
-.Op Fl U Ns Ar sym
-.Op Fl iD Ns Ar sym Ns Op = Ns Ar val
-.Op Fl iU Ns Ar sym
+.Op Fl [i]D Ns Ar sym Ns Op = Ns Ar val
+.Op Fl [i]U Ns Ar sym
 .Ar ...
+.Op Fl x Bro Ar 012 Brc
+.Op Fl M Ar backext
 .Op Fl o Ar outfile
-.Op Ar infile
+.Op Ar infile ...
 .Nm unifdefall
 .Op Fl I Ns Ar path
 .Ar ...
@@ -66,7 +66,8 @@ while otherwise leaving the file alone.
 The
 .Nm
 utility acts on
-.Ic #if , #ifdef , #ifndef , #elif , #else ,
+.Ic #if , #ifdef , #ifndef ,
+.Ic #elif , #else ,
 and
 .Ic #endif
 lines.
@@ -114,7 +115,9 @@ the
 .Fn defined
 operator,
 the operators
-.Ic \&! , < , > , <= , >= , == , != , && , || ,
+.Ic \&! , < , > ,
+.Ic <= , >= , == , != ,
+.Ic && , || ,
 and parenthesized expressions.
 A kind of
 .Dq "short circuit"
@@ -181,6 +184,18 @@ Specify that a symbol is undefined.
 If the same symbol appears in more than one argument,
 the last occurrence dominates.
 .Pp
+.It Fl iD Ns Ar sym Ns Op = Ns Ar val
+.It Fl iU Ns Ar sym
+C strings, comments,
+and line continuations
+are ignored within
+.Ic #ifdef
+and
+.Ic #ifndef
+blocks
+controlled by symbols
+specified with these options.
+.Pp
 .It Fl b
 Replace removed lines with blank lines
 instead of deleting them.
@@ -195,35 +210,39 @@ Mutually exclusive with the
 option.
 .Pp
 .It Fl c
-If the
-.Fl c
-flag is specified,
-then the operation of
-.Nm
-is complemented,
-i.e., the lines that would have been removed or blanked
+Complement,
+i.e., lines that would have been removed or blanked
 are retained and vice versa.
 .Pp
 .It Fl d
 Turn on printing of debugging messages.
 .Pp
 .It Fl e
-Because
-.Nm
-processes its input one line at a time,
-it cannot remove preprocessor directives that span more than one line.
-The most common example of this is a directive with a multi-line
-comment hanging off its right hand end.
 By default,
-if
 .Nm
-has to process such a directive,
-it will complain that the line is too obfuscated.
+will report an error if it needs to remove
+a preprocessor directive that spans more than one line,
+for example, if it has a multi-line
+comment hanging off its right hand end.
 The
 .Fl e
-option changes the behaviour so that,
-where possible,
-such lines are left unprocessed instead of reporting an error.
+flag makes it ignore the line instead.
+.Pp
+.It Fl h
+Print help.
+.Pp
+.It Fl I Ns Ar path
+Specifies to
+.Nm unifdefall
+an additional place to look for
+.Ic #include
+files.
+This option is ignored by
+.Nm
+for compatibility with
+.Xr cpp 1
+and to simplify the implementation of
+.Nm unifdefall .
 .Pp
 .It Fl K
 Always treat the result of
@@ -247,6 +266,15 @@ because they typically start
 and are used as a kind of comment to sketch out future or past development.
 It would be rude to strip them out, just as it would be for normal comments.
 .Pp
+.It Fl m
+Modify one or more input files in place.
+.Pp
+.It Fl M Ar backext
+Modify input files in place, and keep backups of the original files by
+appending the
+.Ar backext
+to the input filenames.
+.Pp
 .It Fl n
 Add
 .Li #line
@@ -257,17 +285,10 @@ line numbers in the input file.
 .It Fl o Ar outfile
 Write output to the file
 .Ar outfile
-instead of the standard output.
-If
-.Ar outfile
-is the same as the input file,
-the output is written to a temporary file
-which is renamed into place when
-.Nm
-completes successfully.
+instead of the standard ou

svn commit: r248851 - head/sys/net

2013-03-28 Thread Mark Johnston
Author: markj
Date: Thu Mar 28 20:37:07 2013
New Revision: 248851
URL: http://svnweb.freebsd.org/changeset/base/248851

Log:
  Ignore interface renames instead of removing the interface from the bridge
  group.
  
  Reviewed by:  rstone
  Approved by:  rstone (co-mentor)
  Sponsored by: Sandvine Incorporated
  MFC after:1 week

Modified:
  head/sys/net/if_bridge.c

Modified: head/sys/net/if_bridge.c
==
--- head/sys/net/if_bridge.cThu Mar 28 20:35:37 2013(r248850)
+++ head/sys/net/if_bridge.cThu Mar 28 20:37:07 2013(r248851)
@@ -1700,6 +1700,9 @@ bridge_ifdetach(void *arg __unused, stru
struct bridge_softc *sc = ifp->if_bridge;
struct bridge_iflist *bif;
 
+   if (ifp->if_flags & IFF_RENAMING)
+   return;
+
/* Check if the interface is a bridge member */
if (sc != NULL) {
BRIDGE_LOCK(sc);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r248853 - head/sys/mips/conf

2013-03-28 Thread Adrian Chadd
Author: adrian
Date: Thu Mar 28 20:48:58 2013
New Revision: 248853
URL: http://svnweb.freebsd.org/changeset/base/248853

Log:
  Initial (unfinished!) AR933x support.

Added:
  head/sys/mips/conf/AP121   (contents, props changed)
  head/sys/mips/conf/AP121.hints   (contents, props changed)
  head/sys/mips/conf/AR933X_BASE   (contents, props changed)
  head/sys/mips/conf/AR933X_BASE.hints   (contents, props changed)

Added: head/sys/mips/conf/AP121
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/mips/conf/AP121Thu Mar 28 20:48:58 2013(r248853)
@@ -0,0 +1,50 @@
+#
+# AP121 - the AP121 reference board from Qualcomm Atheros includes:
+#
+# * AR9330 SoC
+# * 16MB RAM
+# * 4MB flash
+# * Integrated 1x1 2GHz wifi and 10/100 bridge
+#
+# $FreeBSD$
+#
+
+# Include the default AR933x parameters
+include "AR933X_BASE"
+
+ident   AP121
+
+# Override hints with board values
+hints   "AP121.hints"
+
+# Force the board memory - the base AP121 only has 16MB RAM
+options AR71XX_REALMEM=16*1024*1024
+
+# i2c GPIO bus
+#devicegpioiic
+#deviceiicbb
+#deviceiicbus
+#deviceiic
+
+# ethernet switch device
+#deviceetherswitch
+
+# RTL8366RB support
+#devicertl8366rb
+
+# read MSDOS formatted disks - USB
+#options   MSDOSFS
+
+# Enable the uboot environment stuff rather then the
+# redboot stuff.
+optionsAR71XX_ENV_UBOOT
+
+# uzip - to boot natively from flash
+#devicegeom_uzip
+#options   GEOM_UZIP
+
+# Used for the static uboot partition map
+device  geom_map
+
+# Boot off of the rootfs, as defined in the geom_map setup.
+optionsROOTDEVNAME=\"ufs:map/rootfs.uzip\"

Added: head/sys/mips/conf/AP121.hints
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/mips/conf/AP121.hints  Thu Mar 28 20:48:58 2013
(r248853)
@@ -0,0 +1,130 @@
+#
+# This file adds to the values in AR91XX_BASE.hints.
+#
+# $FreeBSD$
+
+# Hard-code the PHY for now, until there's switch phy support.
+# hint.arge.0.phymask=0x000c
+hint.arge.0.phymask=0x
+hint.arge.0.media=1000
+hint.arge.0.fduplex=1
+# Where is the MAC address stored in flash for this particular unit.
+hint.arge.0.eeprommac=0x1f01fc00
+
+# This isn't used, but configure it anyway.
+# This should eventually just not be configured, but the if then
+# needs to be properly disabled or spurious interrupts occur.
+hint.arge.1.phymask=0x0
+
+# Where the ART is
+# hint.ath.0.eepromaddr=0x1fff1000
+
+# The AP121 4MB flash layout:
+#
+# bootargs=console=ttyS0,115200 root=31:02 rootfstype=squashfs
+#init=/sbin/init mtdparts=ar7240-nor0:256k(u-boot),64k(u-boot-env),
+#2752k(rootfs),896k(uImage),64k(NVRAM),64k(ART)
+#
+# So:
+# 256k: uboot
+# 64: uboot-env
+# 2752k: rootfs
+# 896k: kernel
+# 64k: config
+# 64k: ART
+
+hint.map.0.at="flash/spi0"
+hint.map.0.start=0x
+hint.map.0.end=0x4
+hint.map.0.name="uboot"
+hint.map.0.readonly=1
+
+hint.map.1.at="flash/spi0"
+hint.map.1.start=0x0004
+hint.map.1.end=0x0005
+hint.map.1.name="uboot-env"
+hint.map.1.readonly=0
+
+hint.map.2.at="flash/spi0"
+hint.map.2.start=0x0005
+hint.map.2.end=0x0030
+hint.map.2.name="rootfs"
+hint.map.2.readonly=0
+
+hint.map.3.at="flash/spi0"
+hint.map.3.start=0x0030
+hint.map.3.end=0x003e
+hint.map.3.name="kernel"
+hint.map.3.readonly=0
+
+hint.map.4.at="flash/spi0"
+hint.map.4.start=0x003e
+hint.map.4.end=0x003f
+hint.map.4.name="cfg"
+hint.map.4.readonly=0
+
+# This is radio calibration section.  It is (or should be!) unique
+# for each board, to take into account thermal and electrical differences
+# as well as the regulatory compliance data.
+#
+hint.map.5.at="flash/spi0"
+hint.map.5.start=0x003f
+hint.map.5.end=0x0040
+hint.map.5.name="art"
+hint.map.5.readonly=1
+
+# GPIO specific configuration block
+
+# Don't flip on anything that isn't already enabled.
+# This includes leaving the SPI CS1/CS2 pins as GPIO pins as they're
+# not used here.
+hint.gpio.0.function_set=0x2000
+hint.gpio.0.function_clear=0x
+
+# These are the GPIO LEDs and buttons which can be software controlled.
+#hint.gpio.0.pinmask=0x001c02ae
+hint.gpio.0.pinmask=0x0
+
+# pin 1 - USB (LED)
+# pin 2 - System (LED)
+# Pin 3 - Reset (input)
+# Pin 5 - QSS (LED)
+# Pin 7 - QSS Button (input)
+# Pin 8 - wired into the chip reset line
+# Pin 9 - WLAN
+# Pin 10 - UART TX (not GPIO)
+# Pin 13 - UART RX (not GPIO)
+# Pin 18 - RTL8366RB switch data line
+# Pin 19 - RTL8366RB switch clock line
+# Pin 20 - "GPIO20"
+
+# LEDs are configured separately and driven by the LED device
+#hint.gpioled.0.at="gpiobus0"
+#hint.gpioled.0.name="usb"
+#hint.gpioled.0.p

svn commit: r248854 - head/usr.sbin/jail

2013-03-28 Thread Jamie Gritton
Author: jamie
Date: Thu Mar 28 21:02:49 2013
New Revision: 248854
URL: http://svnweb.freebsd.org/changeset/base/248854

Log:
  Reverse the order of some implicit commands (FS mounts and ifconfigs)
  when stopping jails.  This matters particularly for nested filesystem
  mounts.
  
  PR:   kern/177325
  Submitted by: Harald Schmalzbauer
  MFC after:3 days

Modified:
  head/usr.sbin/jail/command.c
  head/usr.sbin/jail/config.c
  head/usr.sbin/jail/jailp.h

Modified: head/usr.sbin/jail/command.c
==
--- head/usr.sbin/jail/command.cThu Mar 28 20:48:58 2013
(r248853)
+++ head/usr.sbin/jail/command.cThu Mar 28 21:02:49 2013
(r248854)
@@ -88,13 +88,14 @@ int
 next_command(struct cfjail *j)
 {
enum intparam comparam;
-   int create_failed;
+   int create_failed, stopping;
 
if (paralimit == 0) {
requeue(j, &runnable);
return 1;
}
create_failed = (j->flags & (JF_STOP | JF_FAILED)) == JF_FAILED;
+   stopping = (j->flags & JF_STOP) != 0;
comparam = *j->comparam;
for (;;) {
if (j->comstring == NULL) {
@@ -113,14 +114,16 @@ next_command(struct cfjail *j)
default:
if (j->intparams[comparam] == NULL)
continue;
-   j->comstring = create_failed
+   j->comstring = create_failed || (stopping &&
+   (j->intparams[comparam]->flags & PF_REV))
? TAILQ_LAST(&j->intparams[comparam]->val,
cfstrings)
: TAILQ_FIRST(&j->intparams[comparam]->val);
}
} else {
j->comstring = j->comstring == &dummystring ? NULL :
-   create_failed
+   create_failed || (stopping &&
+   (j->intparams[comparam]->flags & PF_REV))
? TAILQ_PREV(j->comstring, cfstrings, tq)
: TAILQ_NEXT(j->comstring, tq);
}

Modified: head/usr.sbin/jail/config.c
==
--- head/usr.sbin/jail/config.c Thu Mar 28 20:48:58 2013(r248853)
+++ head/usr.sbin/jail/config.c Thu Mar 28 21:02:49 2013(r248854)
@@ -81,18 +81,18 @@ static const struct ipspec intparams[] =
 [IP_INTERFACE] =   {"interface",   PF_INTERNAL},
 [IP_IP_HOSTNAME] = {"ip_hostname", PF_INTERNAL | PF_BOOL},
 #endif
-[IP_MOUNT] =   {"mount",   PF_INTERNAL},
+[IP_MOUNT] =   {"mount",   PF_INTERNAL | PF_REV},
 [IP_MOUNT_DEVFS] = {"mount.devfs", PF_INTERNAL | PF_BOOL},
 [IP_MOUNT_FSTAB] = {"mount.fstab", PF_INTERNAL},
 [IP_STOP_TIMEOUT] ={"stop.timeout",PF_INTERNAL | 
PF_INT},
 [IP_VNET_INTERFACE] =  {"vnet.interface",  PF_INTERNAL},
 #ifdef INET
-[IP__IP4_IFADDR] = {"ip4.addr",PF_INTERNAL | PF_CONV},
+[IP__IP4_IFADDR] = {"ip4.addr",PF_INTERNAL | PF_CONV | PF_REV},
 #endif
 #ifdef INET6
-[IP__IP6_IFADDR] = {"ip6.addr",PF_INTERNAL | PF_CONV},
+[IP__IP6_IFADDR] = {"ip6.addr",PF_INTERNAL | PF_CONV | PF_REV},
 #endif
-[IP__MOUNT_FROM_FSTAB] =   {"mount.fstab", PF_INTERNAL | PF_CONV},
+[IP__MOUNT_FROM_FSTAB] =   {"mount.fstab", PF_INTERNAL | PF_CONV | PF_REV},
 [IP__OP] = {NULL,  PF_CONV},
 [KP_ALLOW_CHFLAGS] =   {"allow.chflags",   0},
 [KP_ALLOW_MOUNT] = {"allow.mount", 0},

Modified: head/usr.sbin/jail/jailp.h
==
--- head/usr.sbin/jail/jailp.h  Thu Mar 28 20:48:58 2013(r248853)
+++ head/usr.sbin/jail/jailp.h  Thu Mar 28 21:02:49 2013(r248854)
@@ -50,6 +50,7 @@
 #define PF_BOOL0x10/* Boolean parameter */
 #define PF_INT 0x20/* Integer parameter */
 #define PF_CONV0x40/* Parameter duplicated in converted 
form */
+#define PF_REV 0x80/* Run commands in reverse order on stopping */
 
 #define JF_START   0x0001  /* -c */
 #define JF_SET 0x0002  /* -m */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r248855 - in head/sys/amd64: include vmm

2013-03-28 Thread Neel Natu
Author: neel
Date: Thu Mar 28 21:26:19 2013
New Revision: 248855
URL: http://svnweb.freebsd.org/changeset/base/248855

Log:
  Allow caller to skip 'guest linear address' validation when doing instruction
  decode. This is to accomodate hardware assist implementations that do not
  provide the 'guest linear address' as part of nested page fault collateral.
  
  Submitted by: Anish Gupta (akgupt3 at gmail dot com)

Modified:
  head/sys/amd64/include/vmm_instruction_emul.h
  head/sys/amd64/vmm/vmm_instruction_emul.c

Modified: head/sys/amd64/include/vmm_instruction_emul.h
==
--- head/sys/amd64/include/vmm_instruction_emul.h   Thu Mar 28 21:02:49 
2013(r248854)
+++ head/sys/amd64/include/vmm_instruction_emul.h   Thu Mar 28 21:26:19 
2013(r248855)
@@ -107,6 +107,18 @@ int vmm_fetch_instruction(struct vm *vm,
  uint64_t rip, int inst_length, uint64_t cr3,
  struct vie *vie);
 
+/*
+ * Decode the instruction fetched into 'vie' so it can be emulated.
+ *
+ * 'gla' is the guest linear address provided by the hardware assist
+ * that caused the nested page table fault. It is used to verify that
+ * the software instruction decoding is in agreement with the hardware.
+ * 
+ * Some hardware assists do not provide the 'gla' to the hypervisor.
+ * To skip the 'gla' verification for this or any other reason pass
+ * in VIE_INVALID_GLA instead.
+ */
+#defineVIE_INVALID_GLA (1UL << 63) /* a non-canonical 
address */
 int vmm_decode_instruction(struct vm *vm, int cpuid,
   uint64_t gla, struct vie *vie);
 #endif /* _KERNEL */

Modified: head/sys/amd64/vmm/vmm_instruction_emul.c
==
--- head/sys/amd64/vmm/vmm_instruction_emul.c   Thu Mar 28 21:02:49 2013
(r248854)
+++ head/sys/amd64/vmm/vmm_instruction_emul.c   Thu Mar 28 21:26:19 2013
(r248855)
@@ -790,18 +790,20 @@ decode_immediate(struct vie *vie)
return (0);
 }
 
-#defineVERIFY_GLA
 /*
  * Verify that the 'guest linear address' provided as collateral of the nested
  * page table fault matches with our instruction decoding.
  */
-#ifdef VERIFY_GLA
 static int
 verify_gla(struct vm *vm, int cpuid, uint64_t gla, struct vie *vie)
 {
int error;
uint64_t base, idx;
 
+   /* Skip 'gla' verification */
+   if (gla == VIE_INVALID_GLA)
+   return (0);
+
base = 0;
if (vie->base_register != VM_REG_LAST) {
error = vm_get_register(vm, cpuid, vie->base_register, &base);
@@ -832,7 +834,6 @@ verify_gla(struct vm *vm, int cpuid, uin
 
return (0);
 }
-#endif /* VERIFY_GLA */
 
 int
 vmm_decode_instruction(struct vm *vm, int cpuid, uint64_t gla, struct vie *vie)
@@ -856,10 +857,8 @@ vmm_decode_instruction(struct vm *vm, in
if (decode_immediate(vie))
return (-1);
 
-#ifdef VERIFY_GLA
if (verify_gla(vm, cpuid, gla, vie))
return (-1);
-#endif
 
vie->decoded = 1;   /* success */
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r248856 - head/share/mk

2013-03-28 Thread Andrew Turner
Author: andrew
Date: Thu Mar 28 22:49:49 2013
New Revision: 248856
URL: http://svnweb.freebsd.org/changeset/base/248856

Log:
  Welcome clang as the default compiler on ARM.
  
  Change the default compiler for little-endian ARM to clang to allow for more
  testing before 10.0 is released. As LLVM and clang currnetly lack support
  for big-endian ARM leave gcc as the default there.
  
  This will also allow us to investigate moving to use the hard floating-point
  version of the ARM EABI on SoCs that include the Vector Floating Point unit.
  A version of this is included in all ARMv6 and ARMv7 SoCs we currently, and
  are likely to support.
  
  Both the current ABI and the new EABI are supported by clang and it will be
  built correctly depending on which is selected by the user.

Modified:
  head/share/mk/bsd.own.mk

Modified: head/share/mk/bsd.own.mk
==
--- head/share/mk/bsd.own.mkThu Mar 28 21:26:19 2013(r248855)
+++ head/share/mk/bsd.own.mkThu Mar 28 22:49:49 2013(r248856)
@@ -401,8 +401,9 @@ __DEFAULT_NO_OPTIONS+=CLANG_FULL
 .else
 __DEFAULT_NO_OPTIONS+=CLANG CLANG_FULL
 .endif
-# Clang the default system compiler only on x86.
-.if ${__T} == "amd64" || ${__T} == "i386"
+# Clang the default system compiler only on little-endian arm and x86.
+.if ${__T} == "amd64" || ${__T} == "arm" || ${__T} == "armv6" || \
+${__T} == "i386"
 __DEFAULT_YES_OPTIONS+=CLANG_IS_CC
 .else
 __DEFAULT_NO_OPTIONS+=CLANG_IS_CC
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r248857 - head/release/doc/en_US.ISO8859-1/hardware

2013-03-28 Thread Glen Barber
Author: gjb (doc,ports committer)
Date: Thu Mar 28 22:52:42 2013
New Revision: 248857
URL: http://svnweb.freebsd.org/changeset/base/248857

Log:
   - Update hardware notes to reflect that amd64 is no longer "young"[1]
   - Bump copyright year
  
  Patched by:   skreuzer

Modified:
  head/release/doc/en_US.ISO8859-1/hardware/article.xml

Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml
==
--- head/release/doc/en_US.ISO8859-1/hardware/article.xml   Thu Mar 28 
22:49:49 2013(r248856)
+++ head/release/doc/en_US.ISO8859-1/hardware/article.xml   Thu Mar 28 
22:52:42 2013(r248857)
@@ -31,6 +31,7 @@
   2010
   2011
   2012
+  2013
   mailto:d...@freebsd.org";>The &os; Documentation 
Project
 
 
@@ -135,20 +136,13 @@
to &intel; EM64T as 64-bit extension technology
or IA-32e.
 
-  The largest tested memory configuration to date is 64GB.
-   SMP support has been recently completed and is reasonably
-   robust.
+  Both Uniprocessor (UP) and Symmetric Multi-processor (SMP)
+   configurations are supported.
 
   In many respects, &os;/&arch.amd64; is similar to
-   &os;/&arch.i386;, in terms of drivers supported.  There may be
-   some issues with 64-bit cleanliness in some (particularly
-   older) drivers.  Generally, drivers that already function
-   correctly on other 64-bit platforms should work.
-
-  &os;/&arch.amd64; is a very young platform on &os;.  While
-   the core &os; kernel and base system components are generally
-   fairly robust, there are likely to still be rough edges,
-   particularly with third party packages.
+   &os;/&arch.i386;, in terms of drivers supported.  Generally,
+   drivers that already function correctly on other 64-bit
+   platforms should work.
 
 
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r248865 - head/sys/mips/atheros

2013-03-28 Thread Adrian Chadd
Author: adrian
Date: Fri Mar 29 06:31:31 2013
New Revision: 248865
URL: http://svnweb.freebsd.org/changeset/base/248865

Log:
  Print out the platform reference frequency.
  
  This is useful for AR933x platforms where that matters.

Modified:
  head/sys/mips/atheros/ar71xx_machdep.c

Modified: head/sys/mips/atheros/ar71xx_machdep.c
==
--- head/sys/mips/atheros/ar71xx_machdep.c  Fri Mar 29 05:39:25 2013
(r248864)
+++ head/sys/mips/atheros/ar71xx_machdep.c  Fri Mar 29 06:31:31 2013
(r248865)
@@ -232,9 +232,9 @@ platform_start(__register_t a0 __unused,
printf("CPU platform: %s\n", ar71xx_get_system_type());
printf("CPU Frequency=%d MHz\n", u_ar71xx_cpu_freq / 100);
printf("CPU DDR Frequency=%d MHz\n", u_ar71xx_ddr_freq / 100);
-   printf("CPU AHB Frequency=%d MHz\n", u_ar71xx_ahb_freq / 100); 
-
+   printf("CPU AHB Frequency=%d MHz\n", u_ar71xx_ahb_freq / 100);
printf("platform frequency: %lld\n", platform_counter_freq);
+   printf("CPU reference clock: %d MHz\n", u_ar71xx_refclk / 100);
printf("arguments: \n");
printf("  a0 = %08x\n", a0);
printf("  a1 = %08x\n", a1);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r248866 - head/sys/mips/atheros

2013-03-28 Thread Adrian Chadd
Author: adrian
Date: Fri Mar 29 06:32:02 2013
New Revision: 248866
URL: http://svnweb.freebsd.org/changeset/base/248866

Log:
  * Fix clock register definitions
  * Add maximum clock register values

Modified:
  head/sys/mips/atheros/ar933x_uart.h

Modified: head/sys/mips/atheros/ar933x_uart.h
==
--- head/sys/mips/atheros/ar933x_uart.h Fri Mar 29 06:31:31 2013
(r248865)
+++ head/sys/mips/atheros/ar933x_uart.h Fri Mar 29 06:32:02 2013
(r248866)
@@ -68,10 +68,13 @@
 #defineAR933X_UART_CS_TX_BUSY  (1 << 14)
 #defineAR933X_UART_CS_RX_BUSY  (1 << 15)
 
-#defineAR933X_UART_CLOCK_STEP_M0x
-#defineAR933X_UART_CLOCK_SCALE_M   0xfff
+#defineAR933X_UART_CLOCK_SCALE_M   0xff
 #defineAR933X_UART_CLOCK_SCALE_S   16
 #defineAR933X_UART_CLOCK_STEP_M0x
+#defineAR933X_UART_CLOCK_STEP_S0
+
+#defineAR933X_UART_MAX_SCALE   0xff
+#defineAR933X_UART_MAX_STEP0x
 
 #defineAR933X_UART_INT_RX_VALID(1 << 0)
 #defineAR933X_UART_INT_TX_READY(1 << 1)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r248867 - head/sys/mips/atheros

2013-03-28 Thread Adrian Chadd
Author: adrian
Date: Fri Mar 29 06:32:39 2013
New Revision: 248867
URL: http://svnweb.freebsd.org/changeset/base/248867

Log:
  For the AR933x UART, the serial clock is not the AHB clock, it's the
  reference clock.  So use that instead.

Modified:
  head/sys/mips/atheros/uart_bus_ar933x.c
  head/sys/mips/atheros/uart_cpu_ar933x.c

Modified: head/sys/mips/atheros/uart_bus_ar933x.c
==
--- head/sys/mips/atheros/uart_bus_ar933x.c Fri Mar 29 06:32:02 2013
(r248866)
+++ head/sys/mips/atheros/uart_bus_ar933x.c Fri Mar 29 06:32:39 2013
(r248867)
@@ -72,7 +72,7 @@ uart_ar933x_probe(device_t dev)
struct uart_softc *sc;
uint64_t freq;
 
-   freq = ar71xx_ahb_freq();
+   freq = ar71xx_refclk();
 
sc = device_get_softc(dev);
sc->sc_sysdev = SLIST_FIRST(&uart_sysdevs);

Modified: head/sys/mips/atheros/uart_cpu_ar933x.c
==
--- head/sys/mips/atheros/uart_cpu_ar933x.c Fri Mar 29 06:32:02 2013
(r248866)
+++ head/sys/mips/atheros/uart_cpu_ar933x.c Fri Mar 29 06:32:39 2013
(r248867)
@@ -58,7 +58,7 @@ uart_cpu_getdev(int devtype, struct uart
 {
uint64_t freq;
 
-   freq = ar71xx_ahb_freq();
+   freq = ar71xx_refclk();
 
di->ops = uart_getops(&uart_ar933x_class);
di->bas.chan = 0;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"