svn commit: r201989 - in head: contrib/one-true-awk usr.bin/awk

2010-01-10 Thread Ruslan Ermilov
Author: ru
Date: Sun Jan 10 08:02:07 2010
New Revision: 201989
URL: http://svn.freebsd.org/changeset/base/201989

Log:
  Apply patches directly to sources.  Their effect is as follows:
  
  - Make one-true-awk respect locale's collating order in [a-z]
bracket expressions, until a more complete fix (like handing
BREs) is ready.
  
  - Don't require a space between -[fv] and its argument.

Deleted:
  head/usr.bin/awk/b.c.diff
  head/usr.bin/awk/main.c.diff
  head/usr.bin/awk/run.c.diff
Modified:
  head/contrib/one-true-awk/b.c
  head/contrib/one-true-awk/main.c
  head/contrib/one-true-awk/run.c
  head/usr.bin/awk/Makefile

Modified: head/contrib/one-true-awk/b.c
==
--- head/contrib/one-true-awk/b.c   Sun Jan 10 07:18:35 2010
(r201988)
+++ head/contrib/one-true-awk/b.c   Sun Jan 10 08:02:07 2010
(r201989)
@@ -24,6 +24,9 @@ THIS SOFTWARE.
 
 /* lasciate ogne speranza, voi ch'intrate. */
 
+#include 
+__FBSDID("$FreeBSD$");
+
 #defineDEBUG
 
 #include 
@@ -285,9 +288,21 @@ int quoted(char **pp)  /* pick up next th
return c;
 }
 
+static int collate_range_cmp(int a, int b)
+{
+   static char s[2][2];
+
+   if ((uschar)a == (uschar)b)
+   return 0;
+   s[0][0] = a;
+   s[1][0] = b;
+   return (strcoll(s[0], s[1]));
+}
+
 char *cclenter(const char *argp)   /* add a character class */
 {
int i, c, c2;
+   int j;
uschar *p = (uschar *) argp;
uschar *op, *bp;
static uschar *buf = 0;
@@ -306,15 +321,18 @@ char *cclenter(const char *argp)  /* add 
c2 = *p++;
if (c2 == '\\')
c2 = quoted((char **) &p);
-   if (c > c2) {   /* empty; ignore */
+   if (collate_range_cmp(c, c2) > 0) {
bp--;
i--;
continue;
}
-   while (c < c2) {
+   for (j = 0; j < NCHARS; j++) {
+   if ((collate_range_cmp(c, j) > 0) ||
+   collate_range_cmp(j, c2) > 0)
+   continue;
if (!adjbuf((char **) &buf, &bufsz, 
bp-buf+2, 100, (char **) &bp, "cclenter1"))
FATAL("out of space for 
character class [%.10s...] 2", p);
-   *bp++ = ++c;
+   *bp++ = j;
i++;
}
continue;

Modified: head/contrib/one-true-awk/main.c
==
--- head/contrib/one-true-awk/main.cSun Jan 10 07:18:35 2010
(r201988)
+++ head/contrib/one-true-awk/main.cSun Jan 10 08:02:07 2010
(r201989)
@@ -22,7 +22,10 @@ ARISING OUT OF OR IN CONNECTION WITH THE
 THIS SOFTWARE.
 /
 
-const char *version = "version 20091126";
+#include 
+__FBSDID("$FreeBSD$");
+
+const char *version = "version 20091126 (FreeBSD)";
 
 #define DEBUG
 #include 
@@ -58,6 +61,7 @@ int main(int argc, char *argv[])
const char *fs = NULL;
 
setlocale(LC_CTYPE, "");
+   setlocale(LC_COLLATE, "");
setlocale(LC_NUMERIC, "C"); /* for parsing cmdline & prog */
cmdname = argv[0];
if (argc == 1) {
@@ -86,13 +90,18 @@ int main(int argc, char *argv[])
safe = 1;
break;
case 'f':   /* next argument is program filename */
-   argc--;
-   argv++;
-   if (argc <= 1)
-   FATAL("no program filename");
-   if (npfile >= MAX_PFILE - 1)
-   FATAL("too many -f options"); 
-   pfile[npfile++] = argv[1];
+   if (argv[1][2] != 0) {  /* arg is -fsomething */
+   if (npfile >= MAX_PFILE - 1)
+   FATAL("too many -f options"); 
+   pfile[npfile++] = &argv[1][2];
+   } else {/* arg is -f something */
+   argc--; argv++;
+   if (argc <= 1)
+   FATAL("no program filename");
+   if (npfile >= MAX_PFILE - 1)
+   FATAL("too many -f options"); 
+   pfile[npfile++] = a

Re: svn commit: r201604 - head/lib/libc/gen

2010-01-10 Thread Andrey Chernov
Well. Since I see no objections so far, I'll plan to commit 
strcmp()->strcoll() replacement in alphasort() soon.

-- 
http://ache.pp.ru/
___
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: r201990 - in head/sys: cam/ata dev/ata

2010-01-10 Thread Alexander Motin
Author: mav
Date: Sun Jan 10 09:20:56 2010
New Revision: 201990
URL: http://svn.freebsd.org/changeset/base/201990

Log:
  - Report SATA in legacy emulation mode still as SATA.
  - Make ATA XPT able to handle such case.

Modified:
  head/sys/cam/ata/ata_xpt.c
  head/sys/dev/ata/ata-all.c

Modified: head/sys/cam/ata/ata_xpt.c
==
--- head/sys/cam/ata/ata_xpt.c  Sun Jan 10 08:02:07 2010(r201989)
+++ head/sys/cam/ata/ata_xpt.c  Sun Jan 10 09:20:56 2010(r201990)
@@ -1001,7 +1001,6 @@ typedef struct {
union   ccb *request_ccb;
struct  ccb_pathinq *cpi;
int counter;
-   int found;
 } ata_scan_bus_info;
 
 /*
@@ -1049,14 +1048,11 @@ ata_scan_bus(struct cam_periph *periph, 
}
scan_info->request_ccb = request_ccb;
scan_info->cpi = &work_ccb->cpi;
-   if (scan_info->cpi->transport == XPORT_ATA)
-   scan_info->found = 0x0003;
-   else
-   scan_info->found = 0x8001;
-   scan_info->counter = 0;
/* If PM supported, probe it first. */
if (scan_info->cpi->hba_inquiry & PI_SATAPM)
-   scan_info->counter = 15;
+   scan_info->counter = scan_info->cpi->max_target;
+   else
+   scan_info->counter = 0;
 
work_ccb = xpt_alloc_ccb_nowait();
if (work_ccb == NULL) {
@@ -1073,10 +1069,11 @@ ata_scan_bus(struct cam_periph *periph, 
/* Free the current request path- we're done with it. */
xpt_free_path(work_ccb->ccb_h.path);
/* If there is PMP... */
-   if (scan_info->counter == 15) {
+   if ((scan_info->cpi->hba_inquiry & PI_SATAPM) &&
+   (scan_info->counter == scan_info->cpi->max_target)) {
if (work_ccb->ccb_h.ppriv_field1 != 0) {
/* everything else willbe probed by it */
-   scan_info->found = 0x8000;
+   goto done;
} else {
struct ccb_trans_settings cts;
 
@@ -1091,11 +1088,10 @@ ata_scan_bus(struct cam_periph *periph, 
xpt_action((union ccb *)&cts);
}
}
-take_next:
-   /* Take next device. Wrap from 15 (PM) to 0. */
-   scan_info->counter = (scan_info->counter + 1 ) & 0x0f;
-   if (scan_info->counter > scan_info->cpi->max_target -
-   ((scan_info->cpi->hba_inquiry & PI_SATAPM) ? 1 : 0)) {
+   if (scan_info->counter ==
+   ((scan_info->cpi->hba_inquiry & PI_SATAPM) ?
+   0 : scan_info->cpi->max_target)) {
+done:
xpt_free_ccb(work_ccb);
xpt_free_ccb((union ccb *)scan_info->cpi);
request_ccb = scan_info->request_ccb;
@@ -1104,9 +1100,10 @@ take_next:
xpt_done(request_ccb);
break;
}
+   /* Take next device. Wrap from max (PMP) to 0. */
+   scan_info->counter = (scan_info->counter + 1 ) %
+   (scan_info->cpi->max_target + 1);
 scan_next:
-   if ((scan_info->found & (1 << scan_info->counter)) == 0)
-   goto take_next;
status = xpt_create_path(&path, xpt_periph,
scan_info->request_ccb->ccb_h.path_id,
scan_info->counter, 0);

Modified: head/sys/dev/ata/ata-all.c
==
--- head/sys/dev/ata/ata-all.c  Sun Jan 10 08:02:07 2010(r201989)
+++ head/sys/dev/ata/ata-all.c  Sun Jan 10 09:20:56 2010(r201990)
@@ -1473,7 +1473,7 @@ ataaction(struct cam_sim *sim, union ccb
d = &ch->curr[ccb->ccb_h.target_id];
else
d = &ch->user[ccb->ccb_h.target_id];
-   if ((ch->flags & ATA_SATA) && (ch->flags & ATA_NO_SLAVE)) {
+   if (ch->flags & ATA_SATA) {
if (cts->xport_specific.sata.valid & 
CTS_SATA_VALID_REVISION)
d->revision = cts->xport_specific.sata.revision;
if (cts->xport_specific.ata.valid & 
CTS_SATA_VALID_MODE) {
@@ -1497,8 +1497,6 @@ ataaction(struct cam_sim *sim, union ccb
}
if (cts->xport_specific.ata.valid & 
CTS_ATA_VALID_BYTECOUNT)
d->bytecount = 
cts->xport_specific.ata.bytecount;
-   if (ch->flags & ATA_SATA)
-   d->bytecount = min(8192, d->bytecount);
}
ccb->ccb_h.status = CAM_RE

svn commit: r201991 - head/sys/kern

2010-01-10 Thread David Xu
Author: davidxu
Date: Sun Jan 10 09:31:57 2010
New Revision: 201991
URL: http://svn.freebsd.org/changeset/base/201991

Log:
  Make a chain be a list of queues, and make threads waiting
  for same key coalesce to same queue, this makes searching
  path shorter and improves performance.
  Also fix comments about shared PI-mutex.

Modified:
  head/sys/kern/kern_umtx.c

Modified: head/sys/kern/kern_umtx.c
==
--- head/sys/kern/kern_umtx.c   Sun Jan 10 09:20:56 2010(r201990)
+++ head/sys/kern/kern_umtx.c   Sun Jan 10 09:31:57 2010(r201991)
@@ -144,20 +144,38 @@ struct umtx_q {
 
/* Inherited priority from PP mutex */
u_char  uq_inherited_pri;
+   
+   /* Spare queue ready to be reused */
+   struct umtxq_queue  *uq_spare_queue;
+
+   /* The queue we on */
+   struct umtxq_queue  *uq_cur_queue;
 };
 
 TAILQ_HEAD(umtxq_head, umtx_q);
 
+/* Per-key wait-queue */
+struct umtxq_queue {
+   struct umtxq_head   head;
+   struct umtx_key key;
+   LIST_ENTRY(umtxq_queue) link;
+   int length;
+};
+
+LIST_HEAD(umtxq_list, umtxq_queue);
+
 /* Userland lock object's wait-queue chain */
 struct umtxq_chain {
/* Lock for this chain. */
struct mtx  uc_lock;
 
/* List of sleep queues. */
-   struct umtxq_head   uc_queue[2];
+   struct umtxq_list   uc_queue[2];
 #define UMTX_SHARED_QUEUE  0
 #define UMTX_EXCLUSIVE_QUEUE   1
 
+   LIST_HEAD(, umtxq_queue) uc_spare_queue;
+
/* Busy flag */
charuc_busy;
 
@@ -166,6 +184,7 @@ struct umtxq_chain {
 
/* All PI in the list */
TAILQ_HEAD(,umtx_pi)uc_pi_list;
+
 };
 
 #defineUMTXQ_LOCKED_ASSERT(uc) mtx_assert(&(uc)->uc_lock, 
MA_OWNED)
@@ -247,8 +266,9 @@ umtxq_sysinit(void *arg __unused)
for (j = 0; j < UMTX_CHAINS; ++j) {
mtx_init(&umtxq_chains[i][j].uc_lock, "umtxql", NULL,
 MTX_DEF | MTX_DUPOK);
-   TAILQ_INIT(&umtxq_chains[i][j].uc_queue[0]);
-   TAILQ_INIT(&umtxq_chains[i][j].uc_queue[1]);
+   LIST_INIT(&umtxq_chains[i][j].uc_queue[0]);
+   LIST_INIT(&umtxq_chains[i][j].uc_queue[1]);
+   LIST_INIT(&umtxq_chains[i][j].uc_spare_queue);
TAILQ_INIT(&umtxq_chains[i][j].uc_pi_list);
umtxq_chains[i][j].uc_busy = 0;
umtxq_chains[i][j].uc_waiters = 0;
@@ -265,6 +285,8 @@ umtxq_alloc(void)
struct umtx_q *uq;
 
uq = malloc(sizeof(struct umtx_q), M_UMTX, M_WAITOK | M_ZERO);
+   uq->uq_spare_queue = malloc(sizeof(struct umtxq_queue), M_UMTX, 
M_WAITOK | M_ZERO);
+   TAILQ_INIT(&uq->uq_spare_queue->head);
TAILQ_INIT(&uq->uq_pi_contested);
uq->uq_inherited_pri = PRI_MAX;
return (uq);
@@ -273,6 +295,8 @@ umtxq_alloc(void)
 void
 umtxq_free(struct umtx_q *uq)
 {
+   MPASS(uq->uq_spare_queue != NULL);
+   free(uq->uq_spare_queue, M_UMTX);
free(uq, M_UMTX);
 }
 
@@ -371,27 +395,72 @@ umtxq_unbusy(struct umtx_key *key)
wakeup_one(uc);
 }
 
+static struct umtxq_queue *
+umtxq_queue_lookup(struct umtx_key *key, int q)
+{
+   struct umtxq_queue *uh;
+   struct umtxq_chain *uc;
+
+   uc = umtxq_getchain(key);
+   UMTXQ_LOCKED_ASSERT(uc);
+   LIST_FOREACH(uh, &uc->uc_queue[q], link) {
+   if (umtx_key_match(&uh->key, key))
+   return (uh);
+   }
+
+   return (NULL);
+}
+
 static inline void
 umtxq_insert_queue(struct umtx_q *uq, int q)
 {
+   struct umtxq_queue *uh;
struct umtxq_chain *uc;
 
uc = umtxq_getchain(&uq->uq_key);
UMTXQ_LOCKED_ASSERT(uc);
-   TAILQ_INSERT_TAIL(&uc->uc_queue[q], uq, uq_link);
+   KASSERT((uq->uq_flags & UQF_UMTXQ) == 0, ("umtx_q is already on 
queue"));
+   uh = umtxq_queue_lookup(&uq->uq_key, UMTX_SHARED_QUEUE);
+   if (uh != NULL) {
+   LIST_INSERT_HEAD(&uc->uc_spare_queue, uq->uq_spare_queue, link);
+   } else {
+   uh = uq->uq_spare_queue;
+   uh->key = uq->uq_key;
+   LIST_INSERT_HEAD(&uc->uc_queue[q], uh, link);
+   }
+   uq->uq_spare_queue = NULL;
+
+   TAILQ_INSERT_TAIL(&uh->head, uq, uq_link);
+   uh->length++;
uq->uq_flags |= UQF_UMTXQ;
+   uq->uq_cur_queue = uh;
+   return;
 }
 
 static inline void
 umtxq_remove_queue(struct umtx_q *uq, int q)
 {
struct umtxq_chain *uc;
+   struct umtxq_queue *uh;
 
uc = umtxq_getchain(&uq->uq_key);
UMTXQ_LOCKED_ASSERT(uc);
if (uq->uq_flags & UQF_UMTXQ) {
-   TAILQ_REMOVE(&uc->uc_queue[q], uq, uq_link);
+   uh = uq->uq_cur_queue;
+   TAI

svn commit: r201993 - head/sys/dev/ata/chipsets

2010-01-10 Thread Alexander Motin
Author: mav
Date: Sun Jan 10 11:02:10 2010
New Revision: 201993
URL: http://svn.freebsd.org/changeset/base/201993

Log:
  Report which of IXP700 legacy ATA channels is SATA.

Modified:
  head/sys/dev/ata/chipsets/ata-ati.c

Modified: head/sys/dev/ata/chipsets/ata-ati.c
==
--- head/sys/dev/ata/chipsets/ata-ati.c Sun Jan 10 10:42:58 2010
(r201992)
+++ head/sys/dev/ata/chipsets/ata-ati.c Sun Jan 10 11:02:10 2010
(r201993)
@@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$");
 
 /* local prototypes */
 static int ata_ati_chipinit(device_t dev);
+static int ata_ati_ixp700_ch_attach(device_t dev);
 static int ata_ati_setmode(device_t dev, int target, int mode);
 
 /* misc defines */
@@ -121,7 +122,7 @@ ata_ati_chipinit(device_t dev)
 {
 struct ata_pci_controller *ctlr = device_get_softc(dev);
 device_t smbdev;
-int satacfg;
+uint8_t satacfg;
 
 if (ata_setup_interrupt(dev, ata_generic_intr))
return ENXIO;
@@ -145,13 +146,16 @@ ata_ati_chipinit(device_t dev)
(satacfg & 0x01) == 0 ? "disabled" : "enabled",
(satacfg & 0x08) == 0 ? "" : "combined mode, ",
(satacfg & 0x10) == 0 ? "primary" : "secondary");
-
+   ctlr->chipset_data = (void *)(uintptr_t)satacfg;
/*
 * If SATA controller is enabled but combined mode is disabled,
 * we have only one PATA channel.  Ignore a non-existent channel.
 */
if ((satacfg & 0x09) == 0x01)
ctlr->ichannels &= ~(1 << ((satacfg & 0x10) >> 4));
+   else {
+   ctlr->ch_attach = ata_ati_ixp700_ch_attach;
+   }
}
break;
 }
@@ -161,6 +165,23 @@ ata_ati_chipinit(device_t dev)
 }
 
 static int
+ata_ati_ixp700_ch_attach(device_t dev)
+{
+   struct ata_pci_controller *ctlr = 
device_get_softc(device_get_parent(dev));
+   struct ata_channel *ch = device_get_softc(dev);
+   uint8_t satacfg = (uint8_t)(uintptr_t)ctlr->chipset_data;
+
+   /* Setup the usual register normal pci style. */
+   if (ata_pci_ch_attach(dev))
+   return ENXIO;
+
+   /* One of channels is PATA, another is SATA. */
+   if (ch->unit == ((satacfg & 0x10) >> 4))
+   ch->flags |= ATA_SATA;
+   return (0);
+}
+
+static int
 ata_ati_setmode(device_t dev, int target, int mode)
 {
device_t parent = device_get_parent(dev);
___
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: r201994 - stable/8/lib/libc/sys

2010-01-10 Thread Konstantin Belousov
Author: kib
Date: Sun Jan 10 11:25:34 2010
New Revision: 201994
URL: http://svn.freebsd.org/changeset/base/201994

Log:
  MFC r201743:
  Give some information on SF_MNOWAIT flag.
  
  MFC r201759 (by brueffer):
  Fix a typo and bump date for the previous commit.
  
  MFC r201760:
  Further fix grammar.

Modified:
  stable/8/lib/libc/sys/sendfile.2
Directory Properties:
  stable/8/lib/libc/   (props changed)
  stable/8/lib/libc/stdtime/   (props changed)

Modified: stable/8/lib/libc/sys/sendfile.2
==
--- stable/8/lib/libc/sys/sendfile.2Sun Jan 10 11:02:10 2010
(r201993)
+++ stable/8/lib/libc/sys/sendfile.2Sun Jan 10 11:25:34 2010
(r201994)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 24, 2006
+.Dd January 7, 2010
 .Dt SENDFILE 2
 .Os
 .Sh NAME
@@ -116,9 +116,17 @@ Busy servers may benefit by transferring
 block to a separate I/O worker thread.
 .It
 .Dv SF_MNOWAIT .
-(description missing)
+Do not wait for some kernel resource to become available,
+in particular,
+.Vt mbuf
+and
+.Vt sf_buf .
+The flag does not make the
+.Fn sendfile
+syscall truly non-blocking, since other resources are still allocated
+in a blocking fashion.
 .It
-.Dv SF_SYNC ,
+.Dv SF_SYNC .
 .Nm
 sleeps until the network stack no longer references the VM pages
 of the file, making subsequent modifications to it safe.
___
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: r201995 - head/sys/net

2010-01-10 Thread Bjoern A. Zeeb
Author: bz
Date: Sun Jan 10 12:03:53 2010
New Revision: 201995
URL: http://svn.freebsd.org/changeset/base/201995

Log:
  Correct a typo.
  
  MFC after:5 days

Modified:
  head/sys/net/if_epair.c

Modified: head/sys/net/if_epair.c
==
--- head/sys/net/if_epair.c Sun Jan 10 11:25:34 2010(r201994)
+++ head/sys/net/if_epair.c Sun Jan 10 12:03:53 2010(r201995)
@@ -323,7 +323,7 @@ epair_add_ifp_for_draining(struct ifnet 
STAILQ_FOREACH(elm, &epair_dpcpu->epair_ifp_drain_list, ifp_next)
if (elm->ifp == ifp)
break;
-   /* If the ipf is there already, return success. */
+   /* If the ifp is there already, return success. */
if (elm != NULL)
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: r201988 - stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2010-01-10 Thread Maxim Dounin
Hello!

On Sun, Jan 10, 2010 at 07:18:36AM +, Xin LI wrote:

> Author: delphij
> Date: Sun Jan 10 07:18:35 2010
> New Revision: 201988
> URL: http://svn.freebsd.org/changeset/base/201988
> 
> Log:
>   MFC r201756:
>   
>   Re-apply onnv-gate revisions 7994 and 8986 (corresponds to FreeBSD
>   revision 200726 and 200727).

For source control onnv-gate uses Mercurial, and this means that 
revision numbers make sense only for one particular clone.  It 
make sense to record changeset hash instead, which is stable 
between clones.  See here for more details:

http://mercurial.selenic.com/wiki/RevisionNumber

Just for the record:

7994:7a573dc88b73 
8986:45c289aff7c9

Maxim Dounin
___
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: r201999 - head/lib/libc/stdio

2010-01-10 Thread Colin Percival
Author: cperciva
Date: Sun Jan 10 14:30:30 2010
New Revision: 201999
URL: http://svn.freebsd.org/changeset/base/201999

Log:
  Give a less silly response to a silly request.
  
  Prior to this commit, fread/fwrite calls with size * nmemb > SIZE_MAX
  were handled by reading or writing (size_t)(size * nmemb) bytes; for
  example, on 32-bit platforms, fread(ptr, 641, 6700417, f) would read 1
  byte and indicate that the requested 6700417 blocks had been read.
  
  This commit adds a check for such integer overflows, and treats them as
  if an overly large request was passed to read/write; i.e., it sets errno
  to EINVAL, sets the error indicator on the file, and returns a short
  object count (0, to be specific).
  
  The overflow check involves an integer division, so as a performance
  optimization we check first to see if both size and nmemb are less than
  2^16; if they are, no overflow is possible and we avoid the division.
  We assume here that size_t is at least 32 bits; this appears to be true
  on all platforms FreeBSD supports.
  
  Although this commit fixes an integer overflow, it is not likely to have
  any security implications, since any program which would be affected by
  this bug fix is quite clearly already very confused.
  
  Reviewed by:  kib
  MFC after:1 month

Modified:
  head/lib/libc/stdio/fread.c
  head/lib/libc/stdio/fwrite.c

Modified: head/lib/libc/stdio/fread.c
==
--- head/lib/libc/stdio/fread.c Sun Jan 10 13:30:45 2010(r201998)
+++ head/lib/libc/stdio/fread.c Sun Jan 10 14:30:30 2010(r201999)
@@ -37,6 +37,8 @@ static char sccsid[] = "@(#)fread.c   8.2 
 __FBSDID("$FreeBSD$");
 
 #include "namespace.h"
+#include 
+#include 
 #include 
 #include 
 #include "un-namespace.h"
@@ -69,8 +71,27 @@ __fread(void * __restrict buf, size_t si
/*
 * ANSI and SUSv2 require a return value of 0 if size or count are 0.
 */
-   if ((resid = count * size) == 0)
+   if ((count == 0) || (size == 0))
return (0);
+
+   /*
+* Check for integer overflow.  As an optimization, first check that
+* at least one of {count, size} is at least 2^16, since if both
+* values are less than that, their product can't possible overflow
+* (size_t is always at least 32 bits on FreeBSD).
+*/
+   if (((count | size) > 0x) &&
+   (count > SIZE_MAX / size)) {
+   errno = EINVAL;
+   fp->_flags |= __SERR;
+   return (0);
+   }
+
+   /*
+* Compute the (now required to not overflow) number of bytes to
+* read and actually do the work.
+*/
+   resid = count * size;
ORIENT(fp, -1);
if (fp->_r < 0)
fp->_r = 0;

Modified: head/lib/libc/stdio/fwrite.c
==
--- head/lib/libc/stdio/fwrite.cSun Jan 10 13:30:45 2010
(r201998)
+++ head/lib/libc/stdio/fwrite.cSun Jan 10 14:30:30 2010
(r201999)
@@ -37,6 +37,8 @@ static char sccsid[] = "@(#)fwrite.c  8.1
 __FBSDID("$FreeBSD$");
 
 #include "namespace.h"
+#include 
+#include 
 #include 
 #include "un-namespace.h"
 #include "local.h"
@@ -60,10 +62,24 @@ fwrite(buf, size, count, fp)
/*
 * ANSI and SUSv2 require a return value of 0 if size or count are 0.
 */
-   n = count * size;
-   if (n == 0)
+   if ((count == 0) || (size == 0))
return (0);
 
+   /*
+* Check for integer overflow.  As an optimization, first check that
+* at least one of {count, size} is at least 2^16, since if both
+* values are less than that, their product can't possible overflow
+* (size_t is always at least 32 bits on FreeBSD).
+*/
+   if (((count | size) > 0x) &&
+   (count > SIZE_MAX / size)) {
+   errno = EINVAL;
+   fp->_flags |= __SERR;
+   return (0);
+   }
+
+   n = count * size;
+
iov.iov_base = (void *)buf;
uio.uio_resid = iov.iov_len = n;
uio.uio_iov = &iov;
___
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: r202000 - head/sys/dev/ae

2010-01-10 Thread Gavin Atkinson
Author: gavin
Date: Sun Jan 10 14:48:42 2010
New Revision: 202000
URL: http://svn.freebsd.org/changeset/base/202000

Log:
  Don't panic on attach if we can't allocate ifp
  
  Approved by:  ed (mentor)
  MFC after:2 weeks

Modified:
  head/sys/dev/ae/if_ae.c

Modified: head/sys/dev/ae/if_ae.c
==
--- head/sys/dev/ae/if_ae.c Sun Jan 10 14:30:30 2010(r201999)
+++ head/sys/dev/ae/if_ae.c Sun Jan 10 14:48:42 2010(r202000)
@@ -367,6 +367,7 @@ ae_attach(device_t dev)
if (ifp == NULL) {
device_printf(dev, "could not allocate ifnet structure.\n");
error = ENXIO;
+   goto fail;
}
 
ifp->if_softc = sc;
___
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: r202003 - head/sys/sparc64/pci

2010-01-10 Thread Marius Strobl
Author: marius
Date: Sun Jan 10 15:12:15 2010
New Revision: 202003
URL: http://svn.freebsd.org/changeset/base/202003

Log:
  - According to OpenSolaris it's sufficient to align the MSIs of a
device in the table based on the count rather than the maxcount.
Also the previous code didn't work properly as it would have been
necessary to reserve the entire maxcount range in order keep later
requests from filling the spare MSIs between count and maxcount,
which would be complicated to unreserve in fire_release_msi().
  - For MSIs with filters rather than handlers only don't clear the
event queue interrupt via fire_intr_clear() since given that these
are executed directly would clear it while we're still processing
the event queue, which in turn would lead to lost MSIs.
  - Save one level of indentation in fire_setup_intr().
  - Correct a bug in fire_teardown_intr() which prevented it from
correctly restoring the MSI in the resource, causing allocation of
a resource representing an MSI to fail after the first pass when
repeatedly loading and unloading a driver module.

Modified:
  head/sys/sparc64/pci/fire.c

Modified: head/sys/sparc64/pci/fire.c
==
--- head/sys/sparc64/pci/fire.c Sun Jan 10 14:55:38 2010(r202002)
+++ head/sys/sparc64/pci/fire.c Sun Jan 10 15:12:15 2010(r202003)
@@ -83,6 +83,8 @@ __FBSDID("$FreeBSD$");
 
 #include "pcib_if.h"
 
+struct fire_msiqarg;
+
 static bus_space_tag_t fire_alloc_bus_tag(struct fire_softc *sc, int type);
 static const struct fire_desc *fire_get_desc(device_t dev);
 static void fire_dmamap_sync(bus_dma_tag_t dt __unused, bus_dmamap_t map,
@@ -94,6 +96,9 @@ static void fire_intr_clear(void *arg);
 static void fire_intr_disable(void *arg);
 static void fire_intr_enable(void *arg);
 static int fire_intr_register(struct fire_softc *sc, u_int ino);
+static inline void fire_msiq_common(struct intr_vector *iv,
+struct fire_msiqarg *fmqa);
+static void fire_msiq_filter(void *cookie);
 static void fire_msiq_handler(void *cookie);
 static void fire_set_intr(struct fire_softc *sc, u_int index, u_int ino,
 driver_filter_t handler, void *arg);
@@ -184,6 +189,13 @@ struct fire_icarg {
bus_addr_t  fica_clr;
 };
 
+static const struct intr_controller fire_msiqc_filter = {
+   fire_intr_enable,
+   fire_intr_disable,
+   fire_intr_assign,
+   NULL
+};
+
 struct fire_msiqarg {
struct fire_icarg   fmqa_fica;
struct mtx  fmqa_mtx;
@@ -1611,7 +1623,7 @@ fire_intr_clear(void *arg)
  */
 
 static int
-fire_alloc_msi(device_t dev, device_t child, int count, int maxcount,
+fire_alloc_msi(device_t dev, device_t child, int count, int maxcount __unused,
 int *irqs)
 {
struct fire_softc *sc;
@@ -1637,16 +1649,11 @@ fire_alloc_msi(device_t dev, device_t ch
mtx_unlock(&sc->sc_msi_mtx);
return (ENXIO);
}
-   /*
-* It's unclear whether we need to actually align the MSIs in the
-* mapping table based on the maxcount or just the count. We use
-* maxcount to be on the safe side.
-*/
-   for (i = 0; i + maxcount < sc->sc_msi_count; i += maxcount) {
-   for (j = i; j < i + maxcount; j++)
+   for (i = 0; i + count < sc->sc_msi_count; i += count) {
+   for (j = i; j < i + count; j++)
if (isclr(sc->sc_msi_bitmap, j) == 0)
break;
-   if (j == i + maxcount) {
+   if (j == i + count) {
for (j = 0; j < count; j++) {
setbit(sc->sc_msiq_bitmap, msiqrun + j);
setbit(sc->sc_msi_bitmap, i + j);
@@ -1765,33 +1772,67 @@ fire_msiq_handler(void *cookie)
 {
struct intr_vector *iv;
struct fire_msiqarg *fmqa;
-   struct fire_softc *sc;
-   struct fo_msiq_record *qrec;
-   device_t dev;
-   uint64_t word0;
-   u_int head, msi, msiq;
 
iv = cookie;
fmqa = iv->iv_icarg;
-   sc = fmqa->fmqa_fica.fica_sc;
-   dev = sc->sc_dev;
-   msiq = fmqa->fmqa_msiq;
/*
 * Note that since fire_intr_clear() will clear the event queue
-* interrupt after the filter/handler associated with the MSI [sic]
-* has been executed we have to protect the access to the event queue
-* as otherwise nested event queue interrupts cause corruption of the
+* interrupt after the handler associated with the MSI [sic] has
+* been executed we have to protect the access to the event queue as
+* otherwise nested event queue interrupts cause corruption of the
 * event queue on MP machines.  Obviously especially when abandoning
 * the 1:1 mapping it would be better to not clear the event queue
-* interrupt after each filter/handler inv

svn commit: r202006 - in head/sys: conf modules modules/epic sparc64/conf sparc64/ebus

2010-01-10 Thread Marius Strobl
Author: marius
Date: Sun Jan 10 15:44:48 2010
New Revision: 202006
URL: http://svn.freebsd.org/changeset/base/202006

Log:
  Add epic(4), a driver for the front panel LEDs in Sun Fire V215/V245.
  It's named after the driver doing the same job in OpenSolaris.

Added:
  head/sys/modules/epic/
  head/sys/modules/epic/Makefile   (contents, props changed)
  head/sys/sparc64/ebus/epic.c   (contents, props changed)
Modified:
  head/sys/conf/files.sparc64
  head/sys/modules/Makefile
  head/sys/sparc64/conf/GENERIC

Modified: head/sys/conf/files.sparc64
==
--- head/sys/conf/files.sparc64 Sun Jan 10 15:25:45 2010(r202005)
+++ head/sys/conf/files.sparc64 Sun Jan 10 15:44:48 2010(r202006)
@@ -67,6 +67,7 @@ libkern/flsl.cstandard
 libkern/memmove.c  standard
 sparc64/central/central.c  optionalcentral
 sparc64/ebus/ebus.coptionalebus
+sparc64/ebus/epic.coptionalepic ebus
 sparc64/fhc/clkbrd.c   optionalfhc
 sparc64/fhc/fhc.c  optionalfhc
 sparc64/isa/isa.c  optionalisa

Modified: head/sys/modules/Makefile
==
--- head/sys/modules/Makefile   Sun Jan 10 15:25:45 2010(r202005)
+++ head/sys/modules/Makefile   Sun Jan 10 15:44:48 2010(r202006)
@@ -81,6 +81,7 @@ SUBDIR=   ${_3dfx} \
${_em} \
en \
${_ep} \
+   ${_epic} \
${_et} \
${_ex} \
${_exca} \
@@ -602,6 +603,7 @@ _sound= sound
 .if ${MACHINE_ARCH} == "sparc64"
 _auxio=auxio
 _em=   em
+_epic= epic
 _i2c=  i2c
 _igb=  igb
 .if ${MK_CDDL} != "no" || defined(ALL_MODULES)

Added: head/sys/modules/epic/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/modules/epic/Makefile  Sun Jan 10 15:44:48 2010
(r202006)
@@ -0,0 +1,8 @@
+# $FreeBSD$
+
+.PATH: ${.CURDIR}/../../sparc64/ebus
+
+KMOD=  epic
+SRCS=  device_if.h epic.c bus_if.h ofw_bus_if.h
+
+.include 

Modified: head/sys/sparc64/conf/GENERIC
==
--- head/sys/sparc64/conf/GENERIC   Sun Jan 10 15:25:45 2010
(r202005)
+++ head/sys/sparc64/conf/GENERIC   Sun Jan 10 15:44:48 2010
(r202006)
@@ -150,6 +150,7 @@ device  eeprom  # eeprom (really a front
 device mk48txx # Mostek MK48Txx clocks
 device rtc # rtc (really a front-end for the MC146818)
 device mc146818# Motorola MC146818 and compatible clocks
+device epic# Sun Fire V215/V245 LEDs
 
 # Serial (COM) ports
 device puc # Multi-channel uarts

Added: head/sys/sparc64/ebus/epic.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/sparc64/ebus/epic.cSun Jan 10 15:44:48 2010
(r202006)
@@ -0,0 +1,216 @@
+/*-
+ * Copyright (c) 2009 Marius Strobl 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+
+#defineEPIC_DELAY  1
+
+#defineEPIC_NREG   1
+#defineEPIC_FW_LED  

svn commit: r202008 - in stable/8/sys: dev/hwpmc sys

2010-01-10 Thread Fabien Thomas
Author: fabient
Date: Sun Jan 10 16:00:00 2010
New Revision: 202008
URL: http://svn.freebsd.org/changeset/base/202008

Log:
  MFC 201021:
  Log process mappings for existing processes at PMC start time.

Modified:
  stable/8/sys/dev/hwpmc/hwpmc_mod.c
  stable/8/sys/sys/pmc.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/hwpmc/hwpmc_mod.c
==
--- stable/8/sys/dev/hwpmc/hwpmc_mod.c  Sun Jan 10 15:59:59 2010
(r202007)
+++ stable/8/sys/dev/hwpmc/hwpmc_mod.c  Sun Jan 10 16:00:00 2010
(r202008)
@@ -63,6 +63,12 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include 
+#include 
+#include 
+#include 
+#include 
+
 /*
  * Types
  */
@@ -1619,6 +1625,151 @@ pmc_log_kernel_mappings(struct pmc *pm)
 static void
 pmc_log_process_mappings(struct pmc_owner *po, struct proc *p)
 {
+   vm_map_t map;
+   struct vnode *vp;
+   struct vmspace *vm;
+   vm_map_entry_t entry;
+   vm_offset_t last_end;
+   u_int last_timestamp;
+   struct vnode *last_vp;
+   vm_offset_t start_addr;
+   vm_object_t obj, lobj, tobj;
+   char *fullpath, *freepath;
+
+   last_vp = NULL;
+   last_end = (vm_offset_t) 0;
+   fullpath = freepath = NULL;
+
+   if ((vm = vmspace_acquire_ref(p)) == NULL)
+   return;
+
+   map = &vm->vm_map;
+   vm_map_lock_read(map);
+
+   for (entry = map->header.next; entry != &map->header; entry = 
entry->next) {
+
+   if (entry == NULL) {
+   PMCDBG(LOG,OPS,2, "hwpmc: vm_map entry unexpectedly "
+   "NULL! pid=%d vm_map=%p\n", p->p_pid, map);
+   break;
+   }
+
+   /*
+* We only care about executable map entries.
+*/
+   if ((entry->eflags & MAP_ENTRY_IS_SUB_MAP) ||
+   !(entry->protection & VM_PROT_EXECUTE) ||
+   (entry->object.vm_object == NULL)) {
+   continue;
+   }
+
+   obj = entry->object.vm_object;
+   VM_OBJECT_LOCK(obj);
+
+   /* 
+* Walk the backing_object list to find the base
+* (non-shadowed) vm_object.
+*/
+   for (lobj = tobj = obj; tobj != NULL; tobj = 
tobj->backing_object) {
+   if (tobj != obj)
+   VM_OBJECT_LOCK(tobj);
+   if (lobj != obj)
+   VM_OBJECT_UNLOCK(lobj);
+   lobj = tobj;
+   }
+
+   /*
+* At this point lobj is the base vm_object and it is locked.
+*/
+   if (lobj == NULL) {
+   PMCDBG(LOG,OPS,2, "hwpmc: lobj unexpectedly NULL! 
pid=%d "
+   "vm_map=%p vm_obj=%p\n", p->p_pid, map, obj);
+   VM_OBJECT_UNLOCK(obj);
+   continue;
+   }
+
+   if (lobj->type != OBJT_VNODE || lobj->handle == NULL) {
+   if (lobj != obj)
+   VM_OBJECT_UNLOCK(lobj);
+   VM_OBJECT_UNLOCK(obj);
+   continue;
+   }
+
+   /*
+* Skip contiguous regions that point to the same
+* vnode, so we don't emit redundant MAP-IN
+* directives.
+*/
+   if (entry->start == last_end && lobj->handle == last_vp) {
+   last_end = entry->end;
+   if (lobj != obj)
+   VM_OBJECT_UNLOCK(lobj);
+   VM_OBJECT_UNLOCK(obj);
+   continue;
+   }
+
+   /* 
+* We don't want to keep the proc's vm_map or this
+* vm_object locked while we walk the pathname, since
+* vn_fullpath() can sleep.  However, if we drop the
+* lock, it's possible for concurrent activity to
+* modify the vm_map list.  To protect against this,
+* we save the vm_map timestamp before we release the
+* lock, and check it after we reacquire the lock
+* below.
+*/
+   start_addr = entry->start;
+   last_end = entry->end;
+   last_timestamp = map->timestamp;
+   vm_map_unlock_read(map);
+
+   vp = lobj->handle;
+   vref(vp);
+   if (lobj != obj)
+   VM_OBJECT_UNLOCK(lobj);
+
+ 

svn commit: r202009 - stable/8/sys/dev/hwpmc

2010-01-10 Thread Fabien Thomas
Author: fabient
Date: Sun Jan 10 16:04:32 2010
New Revision: 202009
URL: http://svn.freebsd.org/changeset/base/202009

Log:
  MFC 201023:
   * Support the L1D_CACHE_LD event on Core2 processors.
   * Correct a group of typos: for Core2 programmable events, check
 user supplied umask values against the correct event descriptor
 field.

Modified:
  stable/8/sys/dev/hwpmc/hwpmc_core.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/hwpmc/hwpmc_core.c
==
--- stable/8/sys/dev/hwpmc/hwpmc_core.c Sun Jan 10 16:00:00 2010
(r202008)
+++ stable/8/sys/dev/hwpmc/hwpmc_core.c Sun Jan 10 16:04:32 2010
(r202009)
@@ -669,7 +669,7 @@ static struct iap_event_descr iap_events
 IAPDESCR(3CH_01H, 0x3C, 0x01, IAP_F_FM | IAP_F_ALLCPUS),
 IAPDESCR(3CH_02H, 0x3C, 0x02, IAP_F_FM | IAP_F_ALLCPUS),
 
-IAPDESCR(40H, 0x40, IAP_M_MESI, IAP_F_CC),
+IAPDESCR(40H, 0x40, IAP_M_MESI, IAP_F_CC | IAP_F_CC2),
 IAPDESCR(40H_21H, 0x40, 0x21, IAP_F_FM | IAP_F_CA),
 
 IAPDESCR(41H, 0x41, IAP_M_MESI, IAP_F_CC | IAP_F_CC2),
@@ -1419,17 +1419,17 @@ iap_allocate_pmc(int cpu, int ri, struct
 
mask = 0;
 
-   if (ie->iap_flags & IAP_M_CORE) {
+   if (ie->iap_umask & IAP_M_CORE) {
if ((c = (config & IAP_F_CORE)) != IAP_CORE_ALL &&
c != IAP_CORE_THIS)
return (EINVAL);
mask |= IAP_F_CORE;
}
 
-   if (ie->iap_flags & IAP_M_AGENT)
+   if (ie->iap_umask & IAP_M_AGENT)
mask |= IAP_F_AGENT;
 
-   if (ie->iap_flags & IAP_M_PREFETCH) {
+   if (ie->iap_umask & IAP_M_PREFETCH) {
 
if ((c = (config & IAP_F_PREFETCH)) ==
IAP_PREFETCH_RESERVED)
@@ -1438,16 +1438,16 @@ iap_allocate_pmc(int cpu, int ri, struct
mask |= IAP_F_PREFETCH;
}
 
-   if (ie->iap_flags & IAP_M_MESI)
+   if (ie->iap_umask & IAP_M_MESI)
mask |= IAP_F_MESI;
 
-   if (ie->iap_flags & IAP_M_SNOOPRESPONSE)
+   if (ie->iap_umask & IAP_M_SNOOPRESPONSE)
mask |= IAP_F_SNOOPRESPONSE;
 
-   if (ie->iap_flags & IAP_M_SNOOPTYPE)
+   if (ie->iap_umask & IAP_M_SNOOPTYPE)
mask |= IAP_F_SNOOPTYPE;
 
-   if (ie->iap_flags & IAP_M_TRANSITION)
+   if (ie->iap_umask & IAP_M_TRANSITION)
mask |= IAP_F_TRANSITION;
 
/*
___
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: r202010 - head/sys/conf

2010-01-10 Thread Marius Strobl
Author: marius
Date: Sun Jan 10 16:04:55 2010
New Revision: 202010
URL: http://svn.freebsd.org/changeset/base/202010

Log:
  Now that everything required to properly support Sun Fire V215/V245
  is in place (r201932 and r202003 were the last parts missing), hook
  up fire(4).

Modified:
  head/sys/conf/files.sparc64

Modified: head/sys/conf/files.sparc64
==
--- head/sys/conf/files.sparc64 Sun Jan 10 16:04:32 2010(r202009)
+++ head/sys/conf/files.sparc64 Sun Jan 10 16:04:55 2010(r202010)
@@ -74,6 +74,7 @@ sparc64/isa/isa.c optionalisa
 sparc64/isa/isa_dma.c  optionalisa
 sparc64/isa/ofw_isa.c  optionalebus | isa
 sparc64/pci/apb.c  optionalpci
+sparc64/pci/fire.c optionalpci
 sparc64/pci/ofw_pcib.c optionalpci
 sparc64/pci/ofw_pcib_subr.coptionalpci
 sparc64/pci/ofw_pcibus.c   optionalpci
___
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: r202011 - head/sys/dev/ahci

2010-01-10 Thread Alexander Motin
Author: mav
Date: Sun Jan 10 16:05:05 2010
New Revision: 202011
URL: http://svn.freebsd.org/changeset/base/202011

Log:
  While AHCI specification tells that multi-vector MSI doesn't use global IS
  register, nVidia chipsets have different oppinion, requiring every interrupt
  to be acknowledged there.
  
  While there, add interrupt descriptions in multi-vector MSI mode.

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

Modified: head/sys/dev/ahci/ahci.c
==
--- head/sys/dev/ahci/ahci.cSun Jan 10 16:04:55 2010(r202010)
+++ head/sys/dev/ahci/ahci.cSun Jan 10 16:05:05 2010(r202011)
@@ -570,6 +570,12 @@ ahci_setup_interrupt(device_t dev)
device_printf(dev, "unable to setup interrupt\n");
return ENXIO;
}
+   if (ctlr->numirqs > 1) {
+   bus_describe_intr(dev, ctlr->irqs[i].r_irq,
+   ctlr->irqs[i].handle,
+   ctlr->irqs[i].mode == AHCI_IRQ_MODE_ONE ?
+   "ch%d" : "%d", i);
+   }
}
return (0);
 }
@@ -622,8 +628,14 @@ ahci_intr_one(void *data)
int unit;
 
unit = irq->r_irq_rid - 1;
+   /* Some controllers have edge triggered IS. */
+   if (ctlr->quirks & AHCI_Q_EDGEIS)
+   ATA_OUTL(ctlr->r_mem, AHCI_IS, 1 << unit);
if ((arg = ctlr->interrupt[unit].argument))
ctlr->interrupt[unit].function(arg);
+   /* AHCI declares level triggered IS. */
+   if (!(ctlr->quirks & AHCI_Q_EDGEIS))
+   ATA_OUTL(ctlr->r_mem, AHCI_IS, 1 << unit);
 }
 
 static struct resource *
___
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: r202012 - stable/8/sys/dev/hwpmc

2010-01-10 Thread Fabien Thomas
Author: fabient
Date: Sun Jan 10 16:08:14 2010
New Revision: 202012
URL: http://svn.freebsd.org/changeset/base/202012

Log:
  MFC 201151:
   Use VFS_{LOCK,UNLOCK}_GIANT() around the call to vrele().

Modified:
  stable/8/sys/dev/hwpmc/hwpmc_mod.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/hwpmc/hwpmc_mod.c
==
--- stable/8/sys/dev/hwpmc/hwpmc_mod.c  Sun Jan 10 16:05:05 2010
(r202011)
+++ stable/8/sys/dev/hwpmc/hwpmc_mod.c  Sun Jan 10 16:08:14 2010
(r202012)
@@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1625,6 +1626,7 @@ pmc_log_kernel_mappings(struct pmc *pm)
 static void
 pmc_log_process_mappings(struct pmc_owner *po, struct proc *p)
 {
+   int locked;
vm_map_t map;
struct vnode *vp;
struct vmspace *vm;
@@ -1733,7 +1735,11 @@ pmc_log_process_mappings(struct pmc_owne
freepath = NULL;
pmc_getfilename(vp, &fullpath, &freepath);
last_vp = vp;
+
+   locked = VFS_LOCK_GIANT(vp->v_mount);
vrele(vp);
+   VFS_UNLOCK_GIANT(locked);
+
vp = NULL;
pmclog_process_map_in(po, p->p_pid, start_addr, fullpath);
if (freepath)
___
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: r202014 - in stable/7/sys: dev/hwpmc sys

2010-01-10 Thread Fabien Thomas
Author: fabient
Date: Sun Jan 10 16:36:43 2010
New Revision: 202014
URL: http://svn.freebsd.org/changeset/base/202014

Log:
  MFC 201021:
  Log process mappings for existing processes at PMC start time.

Modified:
  stable/7/sys/dev/hwpmc/hwpmc_mod.c
  stable/7/sys/sys/pmc.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/hwpmc/hwpmc_mod.c
==
--- stable/7/sys/dev/hwpmc/hwpmc_mod.c  Sun Jan 10 16:30:54 2010
(r202013)
+++ stable/7/sys/dev/hwpmc/hwpmc_mod.c  Sun Jan 10 16:36:43 2010
(r202014)
@@ -63,6 +63,12 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include 
+#include 
+#include 
+#include 
+#include 
+
 /*
  * Types
  */
@@ -1622,6 +1628,151 @@ pmc_log_kernel_mappings(struct pmc *pm)
 static void
 pmc_log_process_mappings(struct pmc_owner *po, struct proc *p)
 {
+   vm_map_t map;
+   struct vnode *vp;
+   struct vmspace *vm;
+   vm_map_entry_t entry;
+   vm_offset_t last_end;
+   u_int last_timestamp;
+   struct vnode *last_vp;
+   vm_offset_t start_addr;
+   vm_object_t obj, lobj, tobj;
+   char *fullpath, *freepath;
+
+   last_vp = NULL;
+   last_end = (vm_offset_t) 0;
+   fullpath = freepath = NULL;
+
+   if ((vm = vmspace_acquire_ref(p)) == NULL)
+   return;
+
+   map = &vm->vm_map;
+   vm_map_lock_read(map);
+
+   for (entry = map->header.next; entry != &map->header; entry = 
entry->next) {
+
+   if (entry == NULL) {
+   PMCDBG(LOG,OPS,2, "hwpmc: vm_map entry unexpectedly "
+   "NULL! pid=%d vm_map=%p\n", p->p_pid, map);
+   break;
+   }
+
+   /*
+* We only care about executable map entries.
+*/
+   if ((entry->eflags & MAP_ENTRY_IS_SUB_MAP) ||
+   !(entry->protection & VM_PROT_EXECUTE) ||
+   (entry->object.vm_object == NULL)) {
+   continue;
+   }
+
+   obj = entry->object.vm_object;
+   VM_OBJECT_LOCK(obj);
+
+   /* 
+* Walk the backing_object list to find the base
+* (non-shadowed) vm_object.
+*/
+   for (lobj = tobj = obj; tobj != NULL; tobj = 
tobj->backing_object) {
+   if (tobj != obj)
+   VM_OBJECT_LOCK(tobj);
+   if (lobj != obj)
+   VM_OBJECT_UNLOCK(lobj);
+   lobj = tobj;
+   }
+
+   /*
+* At this point lobj is the base vm_object and it is locked.
+*/
+   if (lobj == NULL) {
+   PMCDBG(LOG,OPS,2, "hwpmc: lobj unexpectedly NULL! 
pid=%d "
+   "vm_map=%p vm_obj=%p\n", p->p_pid, map, obj);
+   VM_OBJECT_UNLOCK(obj);
+   continue;
+   }
+
+   if (lobj->type != OBJT_VNODE || lobj->handle == NULL) {
+   if (lobj != obj)
+   VM_OBJECT_UNLOCK(lobj);
+   VM_OBJECT_UNLOCK(obj);
+   continue;
+   }
+
+   /*
+* Skip contiguous regions that point to the same
+* vnode, so we don't emit redundant MAP-IN
+* directives.
+*/
+   if (entry->start == last_end && lobj->handle == last_vp) {
+   last_end = entry->end;
+   if (lobj != obj)
+   VM_OBJECT_UNLOCK(lobj);
+   VM_OBJECT_UNLOCK(obj);
+   continue;
+   }
+
+   /* 
+* We don't want to keep the proc's vm_map or this
+* vm_object locked while we walk the pathname, since
+* vn_fullpath() can sleep.  However, if we drop the
+* lock, it's possible for concurrent activity to
+* modify the vm_map list.  To protect against this,
+* we save the vm_map timestamp before we release the
+* lock, and check it after we reacquire the lock
+* below.
+*/
+   start_addr = entry->start;
+   last_end = entry->end;
+   last_timestamp = map->timestamp;
+   vm_map_unlock_read(map);
+
+   vp = lobj->handle;
+   vref(vp);
+   if (lobj != obj)
+   VM_OBJECT_UNLOCK(lobj);
+
+   VM_OBJECT_UNLOCK(obj);
+
+   freepath = NULL;
+   pmc_getfilena

svn commit: r202015 - stable/7/sys/dev/hwpmc

2010-01-10 Thread Fabien Thomas
Author: fabient
Date: Sun Jan 10 16:40:14 2010
New Revision: 202015
URL: http://svn.freebsd.org/changeset/base/202015

Log:
  MFC 201023:
   * Support the L1D_CACHE_LD event on Core2 processors.
   * Correct a group of typos: for Core2 programmable events, check
 user supplied umask values against the correct event descriptor
 field.

Modified:
  stable/7/sys/dev/hwpmc/hwpmc_core.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/hwpmc/hwpmc_core.c
==
--- stable/7/sys/dev/hwpmc/hwpmc_core.c Sun Jan 10 16:36:43 2010
(r202014)
+++ stable/7/sys/dev/hwpmc/hwpmc_core.c Sun Jan 10 16:40:14 2010
(r202015)
@@ -669,7 +669,7 @@ static struct iap_event_descr iap_events
 IAPDESCR(3CH_01H, 0x3C, 0x01, IAP_F_FM | IAP_F_ALLCPUS),
 IAPDESCR(3CH_02H, 0x3C, 0x02, IAP_F_FM | IAP_F_ALLCPUS),
 
-IAPDESCR(40H, 0x40, IAP_M_MESI, IAP_F_CC),
+IAPDESCR(40H, 0x40, IAP_M_MESI, IAP_F_CC | IAP_F_CC2),
 IAPDESCR(40H_21H, 0x40, 0x21, IAP_F_FM | IAP_F_CA),
 
 IAPDESCR(41H, 0x41, IAP_M_MESI, IAP_F_CC | IAP_F_CC2),
@@ -1419,17 +1419,17 @@ iap_allocate_pmc(int cpu, int ri, struct
 
mask = 0;
 
-   if (ie->iap_flags & IAP_M_CORE) {
+   if (ie->iap_umask & IAP_M_CORE) {
if ((c = (config & IAP_F_CORE)) != IAP_CORE_ALL &&
c != IAP_CORE_THIS)
return (EINVAL);
mask |= IAP_F_CORE;
}
 
-   if (ie->iap_flags & IAP_M_AGENT)
+   if (ie->iap_umask & IAP_M_AGENT)
mask |= IAP_F_AGENT;
 
-   if (ie->iap_flags & IAP_M_PREFETCH) {
+   if (ie->iap_umask & IAP_M_PREFETCH) {
 
if ((c = (config & IAP_F_PREFETCH)) ==
IAP_PREFETCH_RESERVED)
@@ -1438,16 +1438,16 @@ iap_allocate_pmc(int cpu, int ri, struct
mask |= IAP_F_PREFETCH;
}
 
-   if (ie->iap_flags & IAP_M_MESI)
+   if (ie->iap_umask & IAP_M_MESI)
mask |= IAP_F_MESI;
 
-   if (ie->iap_flags & IAP_M_SNOOPRESPONSE)
+   if (ie->iap_umask & IAP_M_SNOOPRESPONSE)
mask |= IAP_F_SNOOPRESPONSE;
 
-   if (ie->iap_flags & IAP_M_SNOOPTYPE)
+   if (ie->iap_umask & IAP_M_SNOOPTYPE)
mask |= IAP_F_SNOOPTYPE;
 
-   if (ie->iap_flags & IAP_M_TRANSITION)
+   if (ie->iap_umask & IAP_M_TRANSITION)
mask |= IAP_F_TRANSITION;
 
/*
___
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: r202016 - stable/7/sys/dev/hwpmc

2010-01-10 Thread Fabien Thomas
Author: fabient
Date: Sun Jan 10 16:43:45 2010
New Revision: 202016
URL: http://svn.freebsd.org/changeset/base/202016

Log:
  MFC 201151:
   Use VFS_{LOCK,UNLOCK}_GIANT() around the call to vrele().

Modified:
  stable/7/sys/dev/hwpmc/hwpmc_mod.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/hwpmc/hwpmc_mod.c
==
--- stable/7/sys/dev/hwpmc/hwpmc_mod.c  Sun Jan 10 16:40:14 2010
(r202015)
+++ stable/7/sys/dev/hwpmc/hwpmc_mod.c  Sun Jan 10 16:43:45 2010
(r202016)
@@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1628,6 +1629,7 @@ pmc_log_kernel_mappings(struct pmc *pm)
 static void
 pmc_log_process_mappings(struct pmc_owner *po, struct proc *p)
 {
+   int locked;
vm_map_t map;
struct vnode *vp;
struct vmspace *vm;
@@ -1736,7 +1738,11 @@ pmc_log_process_mappings(struct pmc_owne
freepath = NULL;
pmc_getfilename(vp, &fullpath, &freepath);
last_vp = vp;
+
+   locked = VFS_LOCK_GIANT(vp->v_mount);
vrele(vp);
+   VFS_UNLOCK_GIANT(locked);
+
vp = NULL;
pmclog_process_map_in(po, p->p_pid, start_addr, fullpath);
if (freepath)
___
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: r202017 - stable/8/tools/regression/bin/sh/expansion

2010-01-10 Thread Jilles Tjoelker
Author: jilles
Date: Sun Jan 10 16:58:12 2010
New Revision: 202017
URL: http://svn.freebsd.org/changeset/base/202017

Log:
  MFC r210428: sh: Add a regression test that tries out all arithmetic ops.
  
  The gaps in the numbering sequence cannot really be avoided, as HEAD changes
  are not necessarily merged in the same order as they are made (if they are
  merged at all).

Added:
  stable/8/tools/regression/bin/sh/expansion/arith2.0
 - copied unchanged from r201428, 
head/tools/regression/bin/sh/expansion/arith2.0
Modified:
Directory Properties:
  stable/8/tools/regression/bin/sh/   (props changed)

Copied: stable/8/tools/regression/bin/sh/expansion/arith2.0 (from r201428, 
head/tools/regression/bin/sh/expansion/arith2.0)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/8/tools/regression/bin/sh/expansion/arith2.0 Sun Jan 10 16:58:12 
2010(r202017, copy of r201428, 
head/tools/regression/bin/sh/expansion/arith2.0)
@@ -0,0 +1,76 @@
+# $FreeBSD$
+
+failures=0
+
+check() {
+   if [ $(($1)) != $2 ]; then
+   failures=$((failures+1))
+   echo "For $1, expected $2 actual $(($1))"
+   fi
+}
+
+# variables
+unset v
+check "v=2" 2
+check "v" 2
+check "$(($v))" 2
+check "v+=1" 3
+check "v" 3
+
+# constants
+check "4611686018427387904" 4611686018427387904
+check "0x4000" 4611686018427387904
+check "04" 4611686018427387904
+check "0x4Ab0" 5381801554707742720
+
+# try out all operators
+v=42
+check "!v" 0
+check "!!v" 1
+check "!0" 1
+check "~0" -1
+check "~(-1)" 0
+check "-0" 0
+check "-v" -42
+check "v*v" 1764
+check "v/2" 21
+check "v%10" 2
+check "v+v" 84
+check "v-4" 38
+check "v<<1" 84
+check "v>>1" 21
+check "v<43" 1
+check "v>42" 0
+check "v<=43" 1
+check "v>=43" 0
+check "v==41" 0
+check "v!=42" 0
+check "v&3" 2
+check "v^3" 41
+check "v|3" 43
+check "v>=40&&v<=44" 1
+check "v<40||v>44" 0
+check "(v=42)&&(v+=1)==43" 1
+check "v" 43
+check "(v=42)&&(v-=1)==41" 1
+check "v" 41
+check "(v=42)&&(v*=2)==84" 1
+check "v" 84
+check "(v=42)&&(v/=10)==4" 1
+check "v" 4
+check "(v=42)&&(v%=10)==2" 1
+check "v" 2
+check "(v=42)&&(v<<=1)==84" 1
+check "v" 84
+check "(v=42)&&(v>>=2)==10" 1
+check "v" 10
+check "(v=42)&&(v&=32)==32" 1
+check "v" 32
+check "(v=42)&&(v^=32)==10" 1
+check "v" 10
+check "(v=42)&&(v|=32)==42" 1
+check "v" 42
+
+# missing: ternary, comma
+
+exit $((failures != 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: r201988 - stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2010-01-10 Thread Xin LI
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 2010/01/10 05:36, Maxim Dounin wrote:
> Hello!
> 
> On Sun, Jan 10, 2010 at 07:18:36AM +, Xin LI wrote:
> 
>> Author: delphij
>> Date: Sun Jan 10 07:18:35 2010
>> New Revision: 201988
>> URL: http://svn.freebsd.org/changeset/base/201988
>>
>> Log:
>>   MFC r201756:
>>   
>>   Re-apply onnv-gate revisions 7994 and 8986 (corresponds to FreeBSD
>>   revision 200726 and 200727).
> 
> For source control onnv-gate uses Mercurial, and this means that 
> revision numbers make sense only for one particular clone.  It 
> make sense to record changeset hash instead, which is stable 
> between clones.  See here for more details:
> 
> http://mercurial.selenic.com/wiki/RevisionNumber
> 
> Just for the record:
> 
> 7994:7a573dc88b73 
> 8986:45c289aff7c9

Thanks for the hint, I'll make sure that these information be included
next time.

Cheers,
- -- 
Xin LI http://www.delphij.net/
FreeBSD - The Power to Serve!  Live free or die
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.14 (FreeBSD)

iQEcBAEBAgAGBQJLShDoAAoJEATO+BI/yjfBBQ8H/1YjObGpgT9uV7T6P65DNuSa
7sT279l89dafIYcaeBGiCkeajW9mQFM82Z3o3jJ1m4RLrZltoi7IlSzwUmQvs3oY
wXOo/58x17N8XFTd2fB0Yxl/ph80hx3tB8G0jb9kqYlQGW+zsMKYyhemUsHUBexs
dUu6Pn3bmVpuC1URNBjRaV+oqaLb8PE06+ZBZNJ4/iLSM569Twl+VepON+AIl0M3
JMq/EDB62Ad2pXR8tYNGRU8KVYfjn6AqsNiIQA/dMmBXdx7INmvIU9IU9SpP9ok6
AgBrh8FQqWBGgkaOuA2Tlt2OSeRHRQmSuJNywYPVP8SaaU+LhqoOYEd2l2lE7qU=
=go2M
-END PGP SIGNATURE-
___
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: r202019 - in head/sys: amd64/conf i386/conf ia64/conf pc98/conf powerpc/conf sparc64/conf sun4v/conf

2010-01-10 Thread Warner Losh
Author: imp
Date: Sun Jan 10 17:44:22 2010
New Revision: 202019
URL: http://svn.freebsd.org/changeset/base/202019

Log:
  Add INCLUDE_CONFIG_FILE in GENERIC on all non-embedded platforms.
  
  # This is the resolution of removing it from DEFAULTS...
  
  MFC after:5 days

Modified:
  head/sys/amd64/conf/GENERIC
  head/sys/i386/conf/GENERIC
  head/sys/ia64/conf/GENERIC
  head/sys/pc98/conf/GENERIC
  head/sys/powerpc/conf/GENERIC
  head/sys/sparc64/conf/GENERIC
  head/sys/sun4v/conf/GENERIC

Modified: head/sys/amd64/conf/GENERIC
==
--- head/sys/amd64/conf/GENERIC Sun Jan 10 17:15:36 2010(r202018)
+++ head/sys/amd64/conf/GENERIC Sun Jan 10 17:44:22 2010(r202019)
@@ -75,6 +75,7 @@ options   MAC # TrustedBSD MAC 
Framewor
 optionsFLOWTABLE   # per-cpu routing cache
 #options   KDTRACE_FRAME   # Ensure frames are compiled in
 #options   KDTRACE_HOOKS   # Kernel DTrace hooks
+optionsINCLUDE_CONFIG_FILE # Include this file in kernel
 
 # Debugging for use in -current
 optionsKDB # Enable kernel debugger support.

Modified: head/sys/i386/conf/GENERIC
==
--- head/sys/i386/conf/GENERIC  Sun Jan 10 17:15:36 2010(r202018)
+++ head/sys/i386/conf/GENERIC  Sun Jan 10 17:44:22 2010(r202019)
@@ -75,6 +75,7 @@ options   AUDIT   # Security event auditi
 optionsMAC # TrustedBSD MAC Framework
 optionsFLOWTABLE   # per-cpu routing cache
 #options   KDTRACE_HOOKS   # Kernel DTrace hooks
+optionsINCLUDE_CONFIG_FILE # Include this file in kernel
 
 # Debugging for use in -current
 optionsKDB # Enable kernel debugger support.

Modified: head/sys/ia64/conf/GENERIC
==
--- head/sys/ia64/conf/GENERIC  Sun Jan 10 17:15:36 2010(r202018)
+++ head/sys/ia64/conf/GENERIC  Sun Jan 10 17:44:22 2010(r202019)
@@ -67,6 +67,7 @@ options   WITNESS # Enable checks to det
 optionsWITNESS_SKIPSPIN # Don't run witness on spinlocks for speed
 options_KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B RT extensions
 optionsHWPMC_HOOKS # Necessary kernel hooks for hwpmc(4)
+optionsINCLUDE_CONFIG_FILE # Include this file in kernel
 
 # Various "busses"
 device firewire# FireWire bus code

Modified: head/sys/pc98/conf/GENERIC
==
--- head/sys/pc98/conf/GENERIC  Sun Jan 10 17:15:36 2010(r202018)
+++ head/sys/pc98/conf/GENERIC  Sun Jan 10 17:44:22 2010(r202019)
@@ -75,6 +75,7 @@ options   KBD_INSTALL_CDEV# install a CD
 optionsHWPMC_HOOKS # Necessary kernel hooks for hwpmc(4)
 optionsAUDIT   # Security event auditing
 optionsMAC # TrustedBSD MAC Framework
+optionsINCLUDE_CONFIG_FILE # Include this file in kernel
 
 # Debugging for use in -current
 optionsKDB # Enable kernel debugger support.

Modified: head/sys/powerpc/conf/GENERIC
==
--- head/sys/powerpc/conf/GENERIC   Sun Jan 10 17:15:36 2010
(r202018)
+++ head/sys/powerpc/conf/GENERIC   Sun Jan 10 17:44:22 2010
(r202019)
@@ -66,6 +66,7 @@ options   _KPOSIX_PRIORITY_SCHEDULING #Po
 optionsHWPMC_HOOKS # Necessary kernel hooks for hwpmc(4)
 optionsAUDIT   # Security event auditing
 optionsMAC # TrustedBSD MAC Framework
+optionsINCLUDE_CONFIG_FILE # Include this file in kernel
 
 # Debugging for use in -current
 optionsKDB #Enable the kernel debugger

Modified: head/sys/sparc64/conf/GENERIC
==
--- head/sys/sparc64/conf/GENERIC   Sun Jan 10 17:15:36 2010
(r202018)
+++ head/sys/sparc64/conf/GENERIC   Sun Jan 10 17:44:22 2010
(r202019)
@@ -72,6 +72,7 @@ options   PRINTF_BUFR_SIZE=128# Prevent 
 optionsHWPMC_HOOKS # Necessary kernel hooks for hwpmc(4)
 optionsAUDIT   # Security event auditing
 optionsMAC # TrustedBSD MAC Framework
+optionsINCLUDE_CONFIG_FILE # Include this file in kernel
 
 # Debugging for use in -current
 optionsKDB # Enable kernel debugger support.

Modified: head/sys/sun4v/conf/GENERIC
==
--- head/sys/sun

svn commit: r202023 - head/sys/sparc64/pci

2010-01-10 Thread Marius Strobl
Author: marius
Date: Sun Jan 10 18:39:29 2010
New Revision: 202023
URL: http://svn.freebsd.org/changeset/base/202023

Log:
  When setting up MSIs with a filter ensure that the event queue interrupt
  is cleared as it might have triggered before and given we supply NULL
  as ic_clear, inthand_add() won't do this for us in this case.

Modified:
  head/sys/sparc64/pci/fire.c

Modified: head/sys/sparc64/pci/fire.c
==
--- head/sys/sparc64/pci/fire.c Sun Jan 10 18:09:33 2010(r202022)
+++ head/sys/sparc64/pci/fire.c Sun Jan 10 18:39:29 2010(r202023)
@@ -1882,6 +1882,7 @@ fire_setup_intr(device_t dev, device_t c
 void **cookiep)
 {
struct fire_softc *sc;
+   struct fire_msiqarg *fmqa;
u_long vec;
int error;
u_int msi, msiq;
@@ -1914,17 +1915,24 @@ fire_setup_intr(device_t dev, device_t c
rman_set_end(ires, msi);
if (error != 0)
return (error);
+   fmqa = intr_vectors[vec].iv_icarg;
/*
 * XXX inject our event queue handler.
 */
if (filt != NULL) {
intr_vectors[vec].iv_func = fire_msiq_filter;
intr_vectors[vec].iv_ic = &fire_msiqc_filter;
+   /*
+* Ensure the event queue interrupt is cleared, it
+* might have triggered before.  Given we supply NULL
+* as ic_clear, inthand_add() won't do this for us.
+*/
+   FIRE_PCI_WRITE_8(sc, fmqa->fmqa_fica.fica_clr,
+   INTCLR_IDLE);
} else
intr_vectors[vec].iv_func = fire_msiq_handler;
/* Record the MSI/MSI-X as long as we we use a 1:1 mapping. */
-   ((struct fire_msiqarg *)intr_vectors[vec].iv_icarg)->
-   fmqa_msi = msi;
+   fmqa->fmqa_msi = msi;
FIRE_PCI_WRITE_8(sc, FO_PCI_EQ_CTRL_SET_BASE + (msiq << 3),
FO_PCI_EQ_CTRL_SET_EN);
msi <<= 3;
___
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: r202024 - head/share/man/man5

2010-01-10 Thread Andrew Thompson
Author: thompsa
Date: Sun Jan 10 18:53:15 2010
New Revision: 202024
URL: http://svn.freebsd.org/changeset/base/202024

Log:
  Change the second usb example for ulpt to one describing libusb which would be
  more common.

Modified:
  head/share/man/man5/devfs.rules.5

Modified: head/share/man/man5/devfs.rules.5
==
--- head/share/man/man5/devfs.rules.5   Sun Jan 10 18:39:29 2010
(r202023)
+++ head/share/man/man5/devfs.rules.5   Sun Jan 10 18:53:15 2010
(r202024)
@@ -100,13 +100,15 @@ The first line declares and starts a new
 .Va localrules
 and the number 10.
 .Pp
-To make all the
-.Xr ulpt 4
-devices accessible to their owner and the
+To give
+.Xr usbconfig 8
+and
+.Xr libusb 3
+enabled applications permission to all usb devices for their owner and the
 .Dq Li usb
 group, a similar rule may be used:
 .Pp
-.Dl "add path 'ulpt*' mode 0660 group usb"
+.Dl "add path 'usb/*' mode 0660 group usb"
 .Sh SEE ALSO
 .Xr glob 3 ,
 .Xr devfs 5 ,
___
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: r202025 - head/lib/libusb

2010-01-10 Thread Andrew Thompson
Author: thompsa
Date: Sun Jan 10 19:18:49 2010
New Revision: 202025
URL: http://svn.freebsd.org/changeset/base/202025

Log:
  Reset variable fields in case the transfer is opened again
  
  Submitted by: Hans Petter Selasky

Modified:
  head/lib/libusb/libusb20.c

Modified: head/lib/libusb/libusb20.c
==
--- head/lib/libusb/libusb20.c  Sun Jan 10 18:53:15 2010(r202024)
+++ head/lib/libusb/libusb20.c  Sun Jan 10 19:18:49 2010(r202025)
@@ -130,8 +130,19 @@ libusb20_tr_close(struct libusb20_transf
if (xfer->ppBuffer) {
free(xfer->ppBuffer);
}
-   /* clear some fields */
+   /* reset variable fields in case the transfer is opened again */
+   xfer->priv_sc0 = 0;
+   xfer->priv_sc1 = 0;
xfer->is_opened = 0;
+   xfer->is_pending = 0;
+   xfer->is_cancel = 0;
+   xfer->is_draining = 0;
+   xfer->is_restart = 0;
+   xfer->status = 0;
+   xfer->flags = 0;
+   xfer->nFrames = 0;
+   xfer->aFrames = 0;
+   xfer->timeout = 0;
xfer->maxFrames = 0;
xfer->maxTotalLength = 0;
xfer->maxPacketLen = 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"


svn commit: r202026 - head/usr.sbin/usbconfig

2010-01-10 Thread Andrew Thompson
Author: thompsa
Date: Sun Jan 10 19:21:23 2010
New Revision: 202026
URL: http://svn.freebsd.org/changeset/base/202026

Log:
  Print error messages to stderr.
  
  Submitted by: Hans Petter Selasky

Modified:
  head/usr.sbin/usbconfig/usbconfig.c

Modified: head/usr.sbin/usbconfig/usbconfig.c
==
--- head/usr.sbin/usbconfig/usbconfig.c Sun Jan 10 19:18:49 2010
(r202025)
+++ head/usr.sbin/usbconfig/usbconfig.c Sun Jan 10 19:21:23 2010
(r202026)
@@ -175,7 +175,7 @@ be_dev_remove_quirk(struct libusb20_back
 
error = libusb20_be_remove_dev_quirk(pbe, &q);
if (error) {
-   printf("Removing quirk '%s' failed, continuing.\n", str);
+   fprintf(stderr, "Removing quirk '%s' failed, continuing.\n", 
str);
}
return;
 }
@@ -198,7 +198,7 @@ be_dev_add_quirk(struct libusb20_backend
 
error = libusb20_be_add_dev_quirk(pbe, &q);
if (error) {
-   printf("Adding quirk '%s' failed, continuing.\n", str);
+   fprintf(stderr, "Adding quirk '%s' failed, continuing.\n", str);
}
return;
 }
@@ -257,7 +257,7 @@ get_int(const char *s)
 static void
 duplicate_option(const char *ptr)
 {
-   printf("Syntax error: "
+   fprintf(stderr, "Syntax error: "
"Duplicate option: '%s'\n", ptr);
exit(1);
 }
@@ -265,7 +265,7 @@ duplicate_option(const char *ptr)
 static void
 usage(void)
 {
-   printf(""
+   fprintf(stderr, ""
"usbconfig - configure the USB subsystem" "\n"
"usage: usbconfig -u  -a  -i  
[cmds...]" "\n"
"usage: usbconfig -d [ugen]. -i  
[cmds...]" "\n"
@@ -349,7 +349,7 @@ flush_command(struct libusb20_backend *p
if (opt->got_set_template) {
opt->got_any--;
if (libusb20_be_set_template(pbe, opt->template)) {
-   printf("Setting USB template %u failed, "
+   fprintf(stderr, "Setting USB template %u failed, "
"continuing.\n", opt->template);
}
}
___
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: r202027 - head/sys/mips/idt

2010-01-10 Thread Warner Losh
Author: imp
Date: Sun Jan 10 19:39:08 2010
New Revision: 202027
URL: http://svn.freebsd.org/changeset/base/202027

Log:
  Merge from projects/mips to head by hand:
  
  r201881 | imp | 2010-01-08 20:08:22 -0700 (Fri, 08 Jan 2010) | 3 lines
  Rename mips_pcpu_init to mips_pcpu0_init since it applies only to the
  BSP.  Provide a missing prototype.
  
  r201845 | imp | 2010-01-08 15:48:21 -0700 (Fri, 08 Jan 2010) | 2 lines
  Centralize initialization of pcpu, and set curthread early...
  
  r198669 | rrs | 2009-10-30 02:53:11 -0600 (Fri, 30 Oct 2009) | 5 lines
  With this commit our friend RMI will now compile. I have
  not tested it and the chances of it running yet are about
  ZERO.. but it will now compile. The hard part now begins,
   making it run ;-)
  
  r198154 | rrs | 2009-10-15 15:03:32 -0600 (Thu, 15 Oct 2009) | 10 lines
  Does 4 things:
  1) Adds future RMI directories
  2) Places intr_machdep.c in specfic files.arch pointing to the generic
 intr_machdep.c.  This allows us to have an architecture dependant
 intr_machdep.c (which we will need for RMI) in the machine specific
 directory
  3) removes intr_machdep.c from files.mips
  4) Adds some TARGET_XLR_XLS ifdef's for the machine specific intra_machdep.h. 
We
 may need to look at finding a better place to put this. But first I want to
 get this thing compiling.
  
  r194216 | gonzo | 2009-06-14 15:16:23 -0600 (Sun, 14 Jun 2009) | 2 lines
  - Fix prototypes to make compiler happy
  
  r194215 | gonzo | 2009-06-14 15:16:04 -0600 (Sun, 14 Jun 2009) | 2 lines
  - Get rid of mask_fn and fix pre_filter/post_filter functions' prototypes
  
  r191282 | gonzo | 2009-04-19 16:02:14 -0600 (Sun, 19 Apr 2009) | 3 lines
  - Make mips_bus_space_generic be of type bus_space_tag_t instead of
  struct bus_space and update all relevant places.
  
  r191084 | gonzo | 2009-04-14 20:28:26 -0600 (Tue, 14 Apr 2009) | 6 lines
  Use FreeBSD/arm approach for handling bus space access: space tag is a pointer
  to bus_space structure that defines access methods and hence every bus can
  define own accessors. Default space is mips_bus_space_generic. It's a simple
  interface to physical memory, values are read with regard to host system
  byte order.

Modified:
  head/sys/mips/idt/files.idt
  head/sys/mips/idt/idt_machdep.c
  head/sys/mips/idt/obio.c
  head/sys/mips/idt/uart_bus_rc32434.c
  head/sys/mips/idt/uart_cpu_rc32434.c

Modified: head/sys/mips/idt/files.idt
==
--- head/sys/mips/idt/files.idt Sun Jan 10 19:21:23 2010(r202026)
+++ head/sys/mips/idt/files.idt Sun Jan 10 19:39:08 2010(r202027)
@@ -6,3 +6,5 @@ mips/idt/if_kr.coptional kr
 mips/idt/obio.cstandard
 mips/idt/uart_cpu_rc32434.coptional uart
 mips/idt/uart_bus_rc32434.coptional uart
+mips/mips/intr_machdep.cstandard
+mips/mips/tick.c   standard

Modified: head/sys/mips/idt/idt_machdep.c
==
--- head/sys/mips/idt/idt_machdep.c Sun Jan 10 19:21:23 2010
(r202026)
+++ head/sys/mips/idt/idt_machdep.c Sun Jan 10 19:39:08 2010
(r202027)
@@ -76,6 +76,12 @@ extern int   *edata;
 extern int *end;
 
 void
+platform_cpu_init()
+{
+   /* Nothing special */
+}
+
+void
 platform_halt(void)
 {
 
@@ -131,6 +137,9 @@ platform_start(__register_t a0, __regist
kernend = round_page((vm_offset_t)&end);
memset(&edata, 0, kernend - (vm_offset_t)(&edata));
 
+   /* Initialize pcpu stuff */
+   mips_pcpu0_init();
+
/*
 * Looking for mem=XXM argument
 */

Modified: head/sys/mips/idt/obio.c
==
--- head/sys/mips/idt/obio.cSun Jan 10 19:21:23 2010(r202026)
+++ head/sys/mips/idt/obio.cSun Jan 10 19:39:08 2010(r202027)
@@ -76,8 +76,10 @@ static int   obio_setup_intr(device_t, dev
 static int obio_teardown_intr(device_t, device_t, struct resource *,
void *);
 
-static void obio_mask_irq(unsigned int irq)
+static void 
+obio_mask_irq(void *arg)
 {
+   unsigned int irq = (unsigned int)arg;
int ip_bit, mask, mask_register;
 
/* mask IRQ */
@@ -88,8 +90,10 @@ static void obio_mask_irq(unsigned int i
ICU_REG_WRITE(mask_register, mask | ip_bit);
 }
 
-static void obio_unmask_irq(unsigned int irq)
+static void 
+obio_unmask_irq(void *arg)
 {
+   unsigned int irq = (unsigned int)arg;
int ip_bit, mask, mask_register;
 
/* unmask IRQ */
@@ -274,7 +278,7 @@ obio_setup_intr(device_t dev, device_t c
event = sc->sc_eventstab[irq];
if (event == NULL) {
error = intr_event_create(&event, (void *)irq, 0, irq, 
-   (mask_fn)obio_mask_irq, (mask_fn)obio_unmask_irq,
+   obio_mask_irq, obio_unmask_irq

svn commit: r202028 - head/sys/mips/include

2010-01-10 Thread Warner Losh
Author: imp
Date: Sun Jan 10 19:42:19 2010
New Revision: 202028
URL: http://svn.freebsd.org/changeset/base/202028

Log:
  Remove files that were deleted in the projects/mips branch.

Deleted:
  head/sys/mips/include/bus_octeon.h
  head/sys/mips/include/intr.h
  head/sys/mips/include/pltfm.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: r202029 - head/sys/mips/include

2010-01-10 Thread Warner Losh
Author: imp
Date: Sun Jan 10 19:43:11 2010
New Revision: 202029
URL: http://svn.freebsd.org/changeset/base/202029

Log:
  Merge from projects/mips to head by hand:
  
  Copy over new cdefs.h..

Added:
 - copied unchanged from r202028, projects/mips/sys/mips/include/cdefs.h
Directory Properties:
  head/sys/mips/include/cdefs.h   (props changed)

Copied: head/sys/mips/include/cdefs.h (from r202028, 
projects/mips/sys/mips/include/cdefs.h)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/mips/include/cdefs.h   Sun Jan 10 19:43:11 2010
(r202029, copy of r202028, projects/mips/sys/mips/include/cdefs.h)
@@ -0,0 +1,54 @@
+/* $NetBSD: cdefs.h,v 1.12 2006/08/27 19:04:30 matt Exp $  */
+
+/*
+ * Copyright (c) 1995 Carnegie-Mellon University.
+ * All rights reserved.
+ *
+ * Author: Chris G. Demetriou
+ *
+ * Permission to use, copy, modify and distribute this software and
+ * its documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ *
+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
+ * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
+ * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ *
+ * Carnegie Mellon requests users of this software to return to
+ *
+ *  Software Distribution Coordinator  or  software.distribut...@cs.cmu.edu
+ *  School of Computer Science
+ *  Carnegie Mellon University
+ *  Pittsburgh PA 15213-3890
+ *
+ * any improvements or extensions that they make and grant Carnegie the
+ * rights to redistribute these changes.
+ */
+
+#ifndef _MIPS_CDEFS_H_
+#define_MIPS_CDEFS_H_
+
+/*  MIPS Subprogram Interface Model */
+#define _MIPS_SIM_ABIX32   4   /* 64 bit safe, ILP32 o32 model */
+#define _MIPS_SIM_ABI643
+#define _MIPS_SIM_NABI32   2   /* 64bit safe, ILP32 n32 model */
+#define _MIPS_SIM_ABI321
+
+#define _MIPS_BSD_API_LP32 _MIPS_SIM_ABI32
+#define_MIPS_BSD_API_LP32_64CLEAN  _MIPS_SIM_ABIX32
+#define_MIPS_BSD_API_N32   _MIPS_SIM_NABI32
+#define_MIPS_BSD_API_LP64  _MIPS_SIM_ABI64
+
+#if defined(__mips_n64)
+#define_MIPS_BSD_API   _MIPS_BSD_API_LP64
+#elif defined(__mips_n32)
+#define_MIPS_BSD_API   _MIPS_BSD_API_N32
+#elif defined(__mips_o64)
+#define_MIPS_BSD_API   _MIPS_BSD_API_LP32_64CLEAN
+#else
+#define_MIPS_BSD_API   _MIPS_BSD_API_LP32
+#endif
+
+#endif /* !_MIPS_CDEFS_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: r202030 - head/sys/mips/include

2010-01-10 Thread Warner Losh
Author: imp
Date: Sun Jan 10 19:44:08 2010
New Revision: 202030
URL: http://svn.freebsd.org/changeset/base/202030

Log:
  Merge from projects/mips to head by hand:
  
  Merge in rmi's fls64 code...

Added:
 - copied unchanged from r202029, projects/mips/sys/mips/include/fls64.h
Directory Properties:
  head/sys/mips/include/fls64.h   (props changed)

Copied: head/sys/mips/include/fls64.h (from r202029, 
projects/mips/sys/mips/include/fls64.h)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/mips/include/fls64.h   Sun Jan 10 19:44:08 2010
(r202030, copy of r202029, projects/mips/sys/mips/include/fls64.h)
@@ -0,0 +1,47 @@
+/*-
+ * Copyright (c) 2003-2009 RMI Corporation
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of RMI Corporation, nor the names of its contributors,
+ *may be used to endorse or promote products derived from this software
+ *without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * RMI_BSD */
+#ifndef _MIPS_FLS64_H_
+#define _MIPS_FLS64_H_
+
+/*
+ * Find Last Set bit (64 bit)
+ */
+static inline int
+fls64(__uint64_t mask)
+{
+   int bit;
+
+   if (mask == 0)
+   return (0);
+   for (bit = 1; ((mask & 0x1ULL) == 0); bit++)
+   mask = mask >> 1;
+   return (bit);
+}
+#endif
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r202031 - head/sys/mips/include

2010-01-10 Thread Warner Losh
Author: imp
Date: Sun Jan 10 19:50:24 2010
New Revision: 202031
URL: http://svn.freebsd.org/changeset/base/202031

Log:
  Merge from projects/mips to head by hand:
  
  r201881 | imp | 2010-01-08 20:08:22 -0700 (Fri, 08 Jan 2010) | 3 lines
  Rename mips_pcpu_init to mips_pcpu0_init since it applies only to the
  BSP.  Provide a missing prototype.
  
  r200343 | imp | 2009-12-09 18:44:11 -0700 (Wed, 09 Dec 2009) | 4 lines
  Get the sense of this right.  We use uintpr_t for bus_addr_t when
  we're building everything except octeon && 32-bit.  As note before, we
  need a clearner way, but at least now the hack is right.
  
  r199760 | imp | 2009-11-24 10:15:22 -0700 (Tue, 24 Nov 2009) | 2 lines
  Add in Cavium's CID.  Report what the unknown CID is.
  
  r199754 | imp | 2009-11-24 09:32:31 -0700 (Tue, 24 Nov 2009) | 6 lines
  Include opt_cputype.h for all .c and .S files referencing TARGET_OCTEON.
  Spell ld script name right.
  
  r199599 | imp | 2009-11-20 09:32:26 -0700 (Fri, 20 Nov 2009) | 2 lines
  Another kludge for 64-bit bus_addr_t with 32-bit pointers...
  
  r199496 | gonzo | 2009-11-18 15:52:05 -0700 (Wed, 18 Nov 2009) | 5 lines
  - Add cpu_init_interrupts function that is supposed to
  prepeare stuff required for spinning out interrupts later
  - Add API for managing intrcnt/intrnames arrays
  - Some minor style(9) fixes
  
  r198958 | rrs | 2009-11-05 11:15:47 -0700 (Thu, 05 Nov 2009) | 2 lines
  For XLR adds extern for its bus space routines
  
  r198669 | rrs | 2009-10-30 02:53:11 -0600 (Fri, 30 Oct 2009) | 5 lines
  With this commit our friend RMI will now compile. I have
  not tested it and the chances of it running yet are about
  ZERO.. but it will now compile. The hard part now begins,
   making it run ;-)
  
  r198666 | imp | 2009-10-29 18:37:50 -0600 (Thu, 29 Oct 2009) | 2 lines
  Add some newer MIPS CO cores.
  
  r198665 | imp | 2009-10-29 18:37:04 -0600 (Thu, 29 Oct 2009) | 4 lines
  db_expr_t is really closer to a register_t.
  Submitted by: bde@
  
  r198531 | gonzo | 2009-10-27 18:01:20 -0600 (Tue, 27 Oct 2009) | 3 lines
  - Remove bunch of declared but not defined cach-related variables
  - Add mips_picache_linesize and mips_pdcache_linesize variables
  
  r198354 | neel | 2009-10-21 20:51:31 -0600 (Wed, 21 Oct 2009) | 9 lines
  Get rid of the hardcoded constants to define cacheable memory:
  SDRAM_ADDR_START, SDRAM_ADDR_END and SDRAM_MEM_SIZE
  
  Instead we now keep a copy of the memory regions enumerated by
  platform-specific code and use that to determine whether an address
  is cacheable or not.
  
  r198310 | gonzo | 2009-10-20 17:13:08 -0600 (Tue, 20 Oct 2009) | 5 lines
  - Commit missing part of "bt" fix: store PC register in pcb_context struct
  in cpu_switch and use it in stack_trace function later. pcb_regs contains
  state of the process stored by exception handler and therefor is not
  valid for sleeping processes.
  
  r198207 | imp | 2009-10-18 08:57:04 -0600 (Sun, 18 Oct 2009) | 2 lines
  Undo spamage of last MFC.
  
  r198206 | imp | 2009-10-18 08:56:33 -0600 (Sun, 18 Oct 2009) | 3 lines
  _ALIGN has to return u_long, since pointers don't fit into u_int in
  64-bit mips.
  
  r198182 | gonzo | 2009-10-16 18:22:07 -0600 (Fri, 16 Oct 2009) | 11 lines
  - Use PC/RA/SP values as arguments for stacktrace_subr instead of trapframe.
  Context info could be obtained from other sources (see below) no only from
  td_pcb field
  - Do not show a0..a3 values unless they're obtained from the stack. These
  are only confirmed values.
  - Fix bt command in DDB. Previous implementation used thread's trapframe
  structure as a source info for trace unwinding, but this structure
  is filled only when exception occurs. Valid register values for sleeping
  processes are in pcb_context array. For curthread use pc/sp/ra for current
  frame
  
  r198181 | gonzo | 2009-10-16 16:52:18 -0600 (Fri, 16 Oct 2009) | 2 lines
  - Get rid of label_t. It came from NetBSD and was used only in one place
  
  r198154 | rrs | 2009-10-15 15:03:32 -0600 (Thu, 15 Oct 2009) | 10 lines
  
  Does 4 things:
  1) Adds future RMI directories
  2) Places intr_machdep.c in specfic files.arch pointing to the generic
 intr_machdep.c.  This allows us to have an architecture dependant
 intr_machdep.c (which we will need for RMI) in the machine specific
 directory
  3) removes intr_machdep.c from files.mips
  4) Adds some TARGET_XLR_XLS ifdef's for the machine specific intra_machdep.h. 
We
 may need to look at finding a better place to put this. But first I want to
 get this thing compiling.
  
  r198066 | gonzo | 2009-10-13 19:43:53 -0600 (Tue, 13 Oct 2009) | 5 lines
  - Move stack tracing function to db_trace.c
  - Axe unused extern MipsXXX declarations
  - Move all declarations for functions in exceptions.S/swtch.S
  from trap.c to respective headers
  
  r197685 | gonzo | 2009-10-01 14:05:36 -0600 (Thu, 01 Oct 2009) | 2 lines
  - Sync caches prop

svn commit: r202032 - head/sys/mips/alchemy

2010-01-10 Thread Warner Losh
Author: imp
Date: Sun Jan 10 19:53:37 2010
New Revision: 202032
URL: http://svn.freebsd.org/changeset/base/202032

Log:
  Merge from projects/mips to head by hand:
  
  Merge support for very early alchemy port.  I wouldn't merge this
  except I don't want it to get lost when we retire projects/mips.
  Should be consiered pre-alpha at this stage.  Also, alchemy is now
  owned by rmi, but started out life as a separate processor line, so
  I'm leaving it in its own directory rather than try to shoe-horn it
  into the unrelated rmi directory.  Its future location is an open
  question.

Added:
 - copied from r202031, projects/mips/sys/mips/alchemy/
Directory Properties:
  head/sys/mips/alchemy/   (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: r202033 - head/sys/mips/conf

2010-01-10 Thread Warner Losh
Author: imp
Date: Sun Jan 10 19:54:18 2010
New Revision: 202033
URL: http://svn.freebsd.org/changeset/base/202033

Log:
  Merge from projects/mips to head by hand:
  
  ALCHEMY config file.

Added:
 - copied unchanged from r202032, projects/mips/sys/mips/conf/ALCHEMY
Directory Properties:
  head/sys/mips/conf/ALCHEMY   (props changed)

Copied: head/sys/mips/conf/ALCHEMY (from r202032, 
projects/mips/sys/mips/conf/ALCHEMY)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/mips/conf/ALCHEMY  Sun Jan 10 19:54:18 2010(r202033, copy 
of r202032, projects/mips/sys/mips/conf/ALCHEMY)
@@ -0,0 +1,66 @@
+# ALCHEMY -- Generic kernel for Alchemy Au1xxx CPUs.
+#
+# For more information on this file, please read the handbook section on
+# Kernel Configuration Files:
+#
+#
http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html
+#
+# The handbook is also available locally in /usr/share/doc/handbook
+# if you've installed the doc distribution, otherwise always see the
+# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the
+# latest information.
+#
+# An exhaustive list of options and more detailed explanations of the
+# device lines is also present in the ../../conf/NOTES and NOTES files. 
+# If you are in doubt as to the purpose or necessity of a line, check first 
+# in NOTES.
+#
+# $FreeBSD$
+
+ident  ALCHEMY
+
+makeoptionsARCH_FLAGS=-march=mips32
+makeoptionsMIPS_LITTLE_ENDIAN=defined
+
+# Don't build any modules yet.
+makeoptionsMODULES_OVERRIDE=""
+
+include"../alchemy/std.alchemy"
+
+hints  "ALCHEMY.hints" #Default places to look for devices.
+
+makeoptionsDEBUG=-g#Build kernel with gdb(1) debug symbols
+
+optionsDDB
+optionsKDB
+
+optionsSCHED_4BSD  #4BSD scheduler
+optionsINET#InterNETworking
+optionsNFSCLIENT   #Network Filesystem Client
+optionsNFS_ROOT#NFS usable as /, requires 
NFSCLIENT
+optionsPSEUDOFS#Pseudo-filesystem framework
+# options  _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time 
extensions
+
+options BOOTP
+options BOOTP_NFSROOT
+options BOOTP_NFSV3
+options BOOTP_WIRED_TO=admsw0
+options BOOTP_COMPAT
+
+# options FFS #Berkeley Fast Filesystem
+# options SOFTUPDATES #Enable FFS soft updates support
+# options UFS_ACL #Support for access control lists
+# options UFS_DIRHASH #Improve performance on big 
directories
+optionsROOTDEVNAME=\"nfs:10.0.0.1:/mnt/bsd\"
+
+
+# Debugging for use in -current
+optionsINVARIANTS  #Enable calls of extra sanity 
checking
+optionsINVARIANT_SUPPORT   #Extra sanity checks of 
internal structures, required by INVARIANTS
+#options   WITNESS #Enable checks to detect 
deadlocks and cycles
+#options   WITNESS_SKIPSPIN#Don't run witness on spinlocks 
for speed
+
+device loop
+device ether
+device uart
+# device   md
___
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: r202034 - head/sys/mips/conf

2010-01-10 Thread Warner Losh
Author: imp
Date: Sun Jan 10 20:03:16 2010
New Revision: 202034
URL: http://svn.freebsd.org/changeset/base/202034

Log:
  Merge from projects/mips to head by hand:
  
  I think these are the relevant changes, but definitely are a superset
  of them.  Software archaeologists are invited to check the branch
  itself for the details.
  
  r199695 | imp | 2009-11-23 00:49:50 -0700 (Mon, 23 Nov 2009) | 2 lines
  Specify loader script and load address
  
  r198263 | neel | 2009-10-19 22:31:20 -0600 (Mon, 19 Oct 2009) | 7 lines
  The default KERNLOADADDR does not work on MALTA hardware. On my platform the
  "First free SDRAM address" reported by YAMON is 0x800b6e61.
  So use a conservative KERNLOADADDR of 0x8010.
  Approved by: imp (mentor)
  
  r194163 | imp | 2009-06-14 00:12:21 -0600 (Sun, 14 Jun 2009) | 2 lines
  Kludge: pretend to be ISA_MIPS32 for the moment.
  
  r192864 | gonzo | 2009-05-26 16:40:12 -0600 (Tue, 26 May 2009) | 4 lines
  - Replace CPU_NOFPU and SOFTFLOAT options with CPU_FPU. By default
 we assume that there is no FPU, because majority of SoC does
 not have it.
  
  r187461 | gonzo | 2009-01-19 21:24:03 -0700 (Mon, 19 Jan 2009) | 3 lines
  - KERNLOADADDR should be defined with makeoption.
  Redboot loads kernel now
  
  r187418 | gonzo | 2009-01-18 19:37:10 -0700 (Sun, 18 Jan 2009) | 4 lines
  - Add trampoline stuff for bootloaders that do not support ELF
  - Replace arm'ish KERNPHYSADDR/KERNVIRTADDR with
  KERNLOADADDR/TRAMPLOADADDR and clean configs

Modified:
  head/sys/mips/conf/MALTA
  head/sys/mips/conf/SENTRY5

Modified: head/sys/mips/conf/MALTA
==
--- head/sys/mips/conf/MALTASun Jan 10 19:54:18 2010(r202033)
+++ head/sys/mips/conf/MALTASun Jan 10 20:03:16 2010(r202034)
@@ -21,6 +21,7 @@ ident MALTA
 
 #makeoptions   ARCH_FLAGS=-march=mips32
 makeoptionsMIPS_LITTLE_ENDIAN=defined
+makeoptionsKERNLOADADDR=0x8010
 
 optionsYAMON
 
@@ -33,6 +34,8 @@ options   TICK_USE_YAMON_FREQ=defined
 
 include"../malta/std.malta"
 
+optionsISA_MIPS32
+
 hints  "MALTA.hints"   #Default places to look for devices.
 
 makeoptionsDEBUG=-g#Build kernel with gdb(1) debug symbols

Modified: head/sys/mips/conf/SENTRY5
==
--- head/sys/mips/conf/SENTRY5  Sun Jan 10 19:54:18 2010(r202033)
+++ head/sys/mips/conf/SENTRY5  Sun Jan 10 20:03:16 2010(r202034)
@@ -26,9 +26,8 @@
 
 ident  SENTRY5
 cpuCPU_MIPS4KC
-optionsCPU_NOFPU
 optionsISA_MIPS32
-optionsCPU_SENTRY5 # XXX should this be a
+optionsCPU_SENTRY5 # XXX should this be a
# sub-cpu option?
 
 # XXX only siba should be hardwired for now; we will use
@@ -37,50 +36,43 @@ files   "../sentry5/files.sentry5"
 hints  "SENTRY5.hints"
 
 # sentry5 normally ships with cfe firmware; use the console for now
-optionsCFE
-optionsCFE_CONSOLE
-optionsALT_BREAK_TO_DEBUGGER
-
-# cfe loader expects kernel at 0x80001000 for mips32 w/o backwards
-# offsets in the linked elf image (see ldscript hack)
-# XXX can we conditionalize the linker stuff on options CFE?
-optionsKERNVIRTADDR=0x80001000
-
-makeoptionsLDSCRIPT_NAME=  ldscript.mips.cfe
+optionsCFE
+optionsCFE_CONSOLE
+optionsALT_BREAK_TO_DEBUGGER
 
 #makeoptions   ARCH_FLAGS=-march=mips32
 makeoptionsMIPS_LITTLE_ENDIAN=defined
 makeoptionsDEBUG=-g#Build kernel with gdb(1) debug symbols
 makeoptionsMODULES_OVERRIDE=""
 
-optionsDDB
-optionsKDB
+optionsDDB
+optionsKDB
 
-optionsSCHED_4BSD  #4BSD scheduler
-optionsINET#InterNETworking
-optionsNFSCLIENT   #Network Filesystem Client
-optionsNFS_ROOT#NFS usable as /, requires NFSCLIENT
-optionsPSEUDOFS#Pseudo-filesystem framework
-options_KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions
+optionsSCHED_4BSD  #4BSD scheduler
+optionsINET#InterNETworking
+optionsNFSCLIENT   #Network Filesystem Client
+optionsNFS_ROOT#NFS usable as /, requires 
NFSCLIENT
+optionsPSEUDOFS#Pseudo-filesystem framework
+options_KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time 
extensions
 
 # Debugging for use in -current
-optionsINVARIANTS
-optionsINVARIANT_SUPPORT
+optionsINVARIANTS
+optionsINVARIANT_SUPPORT
 
-#options 

svn commit: r202035 - head/sys/mips/malta

2010-01-10 Thread Warner Losh
Author: imp
Date: Sun Jan 10 20:06:14 2010
New Revision: 202035
URL: http://svn.freebsd.org/changeset/base/202035

Log:
  Merge from projects/mips to head by hand:
  
  r201881 | imp | 2010-01-08 20:08:22 -0700 (Fri, 08 Jan 2010) | 3 lines
  Rename mips_pcpu_init to mips_pcpu0_init since it applies only to the
  BSP.  Provide a missing prototype.
  
  r198669 | rrs | 2009-10-30 02:53:11 -0600 (Fri, 30 Oct 2009) | 5 lines
  With this commit our friend RMI will now compile. I have
  not tested it and the chances of it running yet are about
  ZERO.. but it will now compile. The hard part now begins,
   making it run ;-)
  
  r198154 | rrs | 2009-10-15 15:03:32 -0600 (Thu, 15 Oct 2009) | 10 lines
  Does 4 things:
  1) Adds future RMI directories
  2) Places intr_machdep.c in specfic files.arch pointing to the generic
 intr_machdep.c.  This allows us to have an architecture dependant
 intr_machdep.c (which we will need for RMI) in the machine specific
 directory
  3) removes intr_machdep.c from files.mips
  4) Adds some TARGET_XLR_XLS ifdef's for the machine specific intra_machdep.h. 
We
 may need to look at finding a better place to put this. But first I want to
 get this thing compiling.
  
  r196836 | gonzo | 2009-09-04 13:02:11 -0600 (Fri, 04 Sep 2009) | 2 lines
  - Clean out some XXXMIPS comments that's not relevant now
  
  r196236 | imp | 2009-08-14 19:03:13 -0600 (Fri, 14 Aug 2009) | 3 lines
  Fix style error replicated multiple times.  Move to
  mips_bus_space_generic for octeon obio impl.
  
  r195496 | imp | 2009-07-09 09:04:52 -0600 (Thu, 09 Jul 2009) | 2 lines
  Don't force ISA_MIPS32.
  
  r195495 | imp | 2009-07-09 09:04:24 -0600 (Thu, 09 Jul 2009) | 4 lines
  Make the yamon function pointer stuff 64-bit safe.  Make the base
  unsigned long, and sign extend the address of the function we're
  calling through.
  
  r195494 | imp | 2009-07-09 08:54:09 -0600 (Thu, 09 Jul 2009) | 3 lines
  Addresses should be unsigned long.  Make the address constants
  unsigned long.
  
  r194929 | gonzo | 2009-06-24 16:42:52 -0600 (Wed, 24 Jun 2009) | 6 lines
  - Do not use hardcoded uart speed
  - Call mips_timer_early_init before initializing uart in order
  to make DELAY usable for ns8250 driver
  Submitted by: Neelkanth Natu
  
  r194212 | gonzo | 2009-06-14 14:54:46 -0600 (Sun, 14 Jun 2009) | 2 lines
  - Fix prototypes to make compiler happy
  
  r192864 | gonzo | 2009-05-26 16:40:12 -0600 (Tue, 26 May 2009) | 4 lines
  - Replace CPU_NOFPU and SOFTFLOAT options with CPU_FPU. By default
 we assume that there is no FPU, because majority of SoC does
 not have it.
  
  r192788 | gonzo | 2009-05-25 22:51:56 -0600 (Mon, 25 May 2009) | 3 lines
  - Provide proper pre_thread/post_ithread functions for GT PCI
  controller.
  
  r191282 | gonzo | 2009-04-19 16:02:14 -0600 (Sun, 19 Apr 2009) | 3 lines
  - Make mips_bus_space_generic be of type bus_space_tag_t instead of
  struct bus_space and update all relevant places.
  
  r191084 | gonzo | 2009-04-14 20:28:26 -0600 (Tue, 14 Apr 2009) | 6 lines
  Use FreeBSD/arm approach for handling bus space access: space tag is a pointer
  to bus_space structure that defines access methods and hence every bus can
  define own accessors. Default space is mips_bus_space_generic. It's a simple
  interface to physical memory, values are read with regard to host system
  byte order.

Modified:
  head/sys/mips/malta/files.malta
  head/sys/mips/malta/gt_pci.c
  head/sys/mips/malta/malta_machdep.c
  head/sys/mips/malta/maltareg.h
  head/sys/mips/malta/obio.c
  head/sys/mips/malta/std.malta
  head/sys/mips/malta/uart_bus_maltausart.c
  head/sys/mips/malta/uart_cpu_maltausart.c
  head/sys/mips/malta/yamon.h

Modified: head/sys/mips/malta/files.malta
==
--- head/sys/mips/malta/files.malta Sun Jan 10 20:03:16 2010
(r202034)
+++ head/sys/mips/malta/files.malta Sun Jan 10 20:06:14 2010
(r202035)
@@ -7,3 +7,5 @@ mips/malta/uart_bus_maltausart.coptiona
 dev/uart/uart_dev_ns8250.c optional uart
 mips/malta/malta_machdep.c standard
 mips/malta/yamon.c standard
+mips/mips/intr_machdep.c   standard
+mips/mips/tick.c   standard

Modified: head/sys/mips/malta/gt_pci.c
==
--- head/sys/mips/malta/gt_pci.cSun Jan 10 20:03:16 2010
(r202034)
+++ head/sys/mips/malta/gt_pci.cSun Jan 10 20:06:14 2010
(r202035)
@@ -91,11 +91,16 @@ __FBSDID("$FreeBSD$");
 #define OCW3_POLL_IRQ(x) ((x) & 0x7f)
 #define OCW3_POLL_PENDING (1U << 7)
 
+struct gt_pci_softc;
+
+struct gt_pci_intr_cookie {
+   int irq;
+   struct gt_pci_softc *sc;
+};
+
 struct gt_pci_softc {
device_tsc_dev;
bus_space_tag_t sc_st;
-   bus_space_tag_t sc_pciio;
-   bu

svn commit: r202036 - head/sys/mips/sentry5

2010-01-10 Thread Warner Losh
Author: imp
Date: Sun Jan 10 20:09:30 2010
New Revision: 202036
URL: http://svn.freebsd.org/changeset/base/202036

Log:
  Merge from projects/mips to head by hand:
  
  r201881 | imp | 2010-01-08 20:08:22 -0700 (Fri, 08 Jan 2010) | 3 lines
  Rename mips_pcpu_init to mips_pcpu0_init since it applies only to the
  BSP.  Provide a missing prototype.
  
  r201845 | imp | 2010-01-08 15:48:21 -0700 (Fri, 08 Jan 2010) | 2 lines
  Centralize initialization of pcpu, and set curthread early...
  
  r201631 | neel | 2010-01-05 23:42:08 -0700 (Tue, 05 Jan 2010) | 5 lines
  Remove all CFE-specific code from locore.S. The CFE entrypoint initialization
  is now done in platform-specific code.
  Approved by: imp (mentor)
  
  r198669 | rrs | 2009-10-30 02:53:11 -0600 (Fri, 30 Oct 2009) | 5 lines
  With this commit our friend RMI will now compile. I have
  not tested it and the chances of it running yet are about
  ZERO.. but it will now compile. The hard part now begins,
   making it run ;-)
  
  r198154 | rrs | 2009-10-15 15:03:32 -0600 (Thu, 15 Oct 2009) | 10 lines
  
  Does 4 things:
  1) Adds future RMI directories
  2) Places intr_machdep.c in specfic files.arch pointing to the generic
 intr_machdep.c.  This allows us to have an architecture dependant
 intr_machdep.c (which we will need for RMI) in the machine specific
 directory
  3) removes intr_machdep.c from files.mips
  4) Adds some TARGET_XLR_XLS ifdef's for the machine specific intra_machdep.h. 
We
 may need to look at finding a better place to put this. But first I want to
 get this thing compiling.
  
  r196236 | imp | 2009-08-14 19:03:13 -0600 (Fri, 14 Aug 2009) | 3 lines
  Fix style error replicated multiple times.  Move to
  mips_bus_space_generic for octeon obio impl.
  
  r191282 | gonzo | 2009-04-19 16:02:14 -0600 (Sun, 19 Apr 2009) | 3 lines
  - Make mips_bus_space_generic be of type bus_space_tag_t instead of
  struct bus_space and update all relevant places.
  
  r187415 | gonzo | 2009-01-18 16:49:02 -0700 (Sun, 18 Jan 2009) | 3 lines
  - Move Silicon Backplanes code out to system-wide level (dev/siba) as
  it's going to be used not only for siba5 devices.

Modified:
  head/sys/mips/sentry5/files.sentry5
  head/sys/mips/sentry5/obio.c
  head/sys/mips/sentry5/s5_machdep.c
  head/sys/mips/sentry5/uart_bus_sbusart.c
  head/sys/mips/sentry5/uart_cpu_sbusart.c

Modified: head/sys/mips/sentry5/files.sentry5
==
--- head/sys/mips/sentry5/files.sentry5 Sun Jan 10 20:06:14 2010
(r202035)
+++ head/sys/mips/sentry5/files.sentry5 Sun Jan 10 20:09:30 2010
(r202036)
@@ -4,11 +4,6 @@
 # for USB 1.1 OHCI, Ethernet and IPSEC cores
 # which are believed to be devices we have drivers for
 # which just need to be tweaked for attachment to an SSB system bus.
-
 mips/sentry5/s5_machdep.c  standard
-dev/siba/siba.coptional siba
-dev/siba/siba_pcib.c   optional siba pci
-mips/sentry5/siba_cc.c optional siba
-
-# notyet
-#mips/sentry5/siba_mips.c  optional siba
+mips/mips/intr_machdep.c   standard
+mips/mips/tick.c   standard

Modified: head/sys/mips/sentry5/obio.c
==
--- head/sys/mips/sentry5/obio.cSun Jan 10 20:06:14 2010
(r202035)
+++ head/sys/mips/sentry5/obio.cSun Jan 10 20:09:30 2010
(r202036)
@@ -72,13 +72,11 @@ static int have_one = 0;
 int
 obio_probe(device_t dev)
 {
-   if(!have_one)
-   {
+   if (!have_one) {
have_one = 1;
return 0;
}
-   else
-   return (ENXIO);
+   return (ENXIO);
 }
 
 int
@@ -119,7 +117,6 @@ obio_alloc_resource(device_t bus, device
 {
struct resource *rv;
struct rman *rm;
-   bus_space_tag_t bt = 0;
bus_space_handle_t bh = 0;
struct obio_softc *sc = device_get_softc(bus);
 
@@ -131,7 +128,6 @@ obio_alloc_resource(device_t bus, device
return (NULL);
case SYS_RES_IOPORT:
rm = &sc->oba_rman;
-   bt = sc->oba_st;
bh = sc->oba_addr;
start = bh;
break;
@@ -146,7 +142,7 @@ obio_alloc_resource(device_t bus, device
if (type == SYS_RES_IRQ)
return (rv);
rman_set_rid(rv, *rid);
-   rman_set_bustag(rv, bt);
+   rman_set_bustag(rv, mips_bus_space_generic);
rman_set_bushandle(rv, bh);

if (0) {

Modified: head/sys/mips/sentry5/s5_machdep.c
==
--- head/sys/mips/sentry5/s5_machdep.c  Sun Jan 10 20:06:14 2010
(r202035)
+++ head/sys/mips/sentry5/s5_machdep.c  Sun Jan 10 20:09:30 2010
(r202036)
@@ -79,14 +79,15 @@ __FBSDID("$FreeBSD$");
 #

svn commit: r202037 - head/sys/mips/adm5120

2010-01-10 Thread Warner Losh
Author: imp
Date: Sun Jan 10 20:11:10 2010
New Revision: 202037
URL: http://svn.freebsd.org/changeset/base/202037

Log:
  Merge from projects/mips to head by hand:
  
  r201881 | imp | 2010-01-08 20:08:22 -0700 (Fri, 08 Jan 2010) | 3 lines
  Rename mips_pcpu_init to mips_pcpu0_init since it applies only to the
  BSP.  Provide a missing prototype.
  
  r201845 | imp | 2010-01-08 15:48:21 -0700 (Fri, 08 Jan 2010) | 2 lines
  Centralize initialization of pcpu, and set curthread early...
  
  r198669 | rrs | 2009-10-30 02:53:11 -0600 (Fri, 30 Oct 2009) | 5 lines
  With this commit our friend RMI will now compile. I have
  not tested it and the chances of it running yet are about
  ZERO.. but it will now compile. The hard part now begins,
   making it run ;-)
  
  r198154 | rrs | 2009-10-15 15:03:32 -0600 (Thu, 15 Oct 2009) | 10 lines
  Does 4 things:
  1) Adds future RMI directories
  2) Places intr_machdep.c in specfic files.arch pointing to the generic
 intr_machdep.c.  This allows us to have an architecture dependant 
intr_machdep.c
 (which we will need for RMI) in the machine specific directory
  3) removes intr_machdep.c from files.mips
  4) Adds some TARGET_XLR_XLS ifdef's for the machine specific intra_machdep.h. 
We
 may need to look at finding a better place to put this. But first I want to
 get this thing compiling.
  
  r194213 | gonzo | 2009-06-14 15:04:54 -0600 (Sun, 14 Jun 2009) | 2 lines
  - Fix prototype and implementation of admsw_shutdown
  
  r192790 | gonzo | 2009-05-25 23:52:24 -0600 (Mon, 25 May 2009) | 2 lines
  - Provide proper pre_ithread/post_ithread functions
  
  r191282 | gonzo | 2009-04-19 16:02:14 -0600 (Sun, 19 Apr 2009) | 3 lines
  - Make mips_bus_space_generic be of type bus_space_tag_t instead of
  struct bus_space and update all relevant places.
  
  r191084 | gonzo | 2009-04-14 20:28:26 -0600 (Tue, 14 Apr 2009) | 6 lines
  Use FreeBSD/arm approach for handling bus space access: space tag is a pointer
  to bus_space structure that defines access methods and hence every bus can
  define own accessors. Default space is mips_bus_space_generic. It's a simple
  interface to physical memory, values are read with regard to host system
  byte order.

Modified:
  head/sys/mips/adm5120/adm5120_machdep.c
  head/sys/mips/adm5120/files.adm5120
  head/sys/mips/adm5120/if_admsw.c
  head/sys/mips/adm5120/obio.c
  head/sys/mips/adm5120/uart_cpu_adm5120.c

Modified: head/sys/mips/adm5120/adm5120_machdep.c
==
--- head/sys/mips/adm5120/adm5120_machdep.c Sun Jan 10 20:09:30 2010
(r202036)
+++ head/sys/mips/adm5120/adm5120_machdep.c Sun Jan 10 20:11:10 2010
(r202037)
@@ -73,6 +73,12 @@ __FBSDID("$FreeBSD$");
 extern int *edata;
 extern int *end;
 
+void
+platform_cpu_init()
+{
+   /* Nothing special */
+}
+
 static void
 mips_init(void)
 {
@@ -148,6 +154,9 @@ platform_start(__register_t a0 __unused,
kernend = round_page((vm_offset_t)&end);
memset(&edata, 0, kernend - (vm_offset_t)(&edata));
 
+   /* Initialize pcpu stuff */
+   mips_pcpu0_init();
+
cninit();
mips_init();
mips_timer_init_params(platform_counter_freq, 0);

Modified: head/sys/mips/adm5120/files.adm5120
==
--- head/sys/mips/adm5120/files.adm5120 Sun Jan 10 20:09:30 2010
(r202036)
+++ head/sys/mips/adm5120/files.adm5120 Sun Jan 10 20:11:10 2010
(r202037)
@@ -9,3 +9,5 @@ mips/adm5120/obio.c standard
 mips/adm5120/uart_bus_adm5120.coptional uart
 mips/adm5120/uart_cpu_adm5120.coptional uart
 mips/adm5120/uart_dev_adm5120.coptional uart
+mips/mips/intr_machdep.cstandard
+mips/mips/tick.c   standard

Modified: head/sys/mips/adm5120/if_admsw.c
==
--- head/sys/mips/adm5120/if_admsw.cSun Jan 10 20:09:30 2010
(r202036)
+++ head/sys/mips/adm5120/if_admsw.cSun Jan 10 20:11:10 2010
(r202037)
@@ -528,7 +528,7 @@ admsw_attach(device_t dev)
ifmedia_add(&sc->sc_ifmedia[i], IFM_ETHER|IFM_AUTO, 0, NULL);
ifmedia_set(&sc->sc_ifmedia[i], IFM_ETHER|IFM_AUTO);
 
-   ifp = sc->sc_ifnet[i] = if_alloc(IFT_ETHER);
+   ifp = sc->sc_ifnet[i] = if_alloc(IFT_ETHER);;
 
/* Setup interface parameters */
ifp->if_softc = sc;

Modified: head/sys/mips/adm5120/obio.c
==
--- head/sys/mips/adm5120/obio.cSun Jan 10 20:09:30 2010
(r202036)
+++ head/sys/mips/adm5120/obio.cSun Jan 10 20:11:10 2010
(r202037)
@@ -120,6 +120,39 @@ static int obio_setup_intr(device_t, dev
 static int obio_teardown_intr(device_t, device_t, struct resource *,
voi

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

2010-01-10 Thread Warner Losh
Author: imp
Date: Sun Jan 10 20:12:17 2010
New Revision: 202038
URL: http://svn.freebsd.org/changeset/base/202038

Log:
  Merge from projects/mips to head by hand:
  
  Copy over inckern.S for crunched kernel support.

Added:
 - copied unchanged from r202037, projects/mips/sys/mips/mips/inckern.S
Directory Properties:
  head/sys/mips/mips/inckern.S   (props changed)

Copied: head/sys/mips/mips/inckern.S (from r202037, 
projects/mips/sys/mips/mips/inckern.S)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/mips/mips/inckern.SSun Jan 10 20:12:17 2010
(r202038, copy of r202037, projects/mips/sys/mips/mips/inckern.S)
@@ -0,0 +1,34 @@
+/*-
+ * Copyright (c) 2005 Olivier Houchard.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "opt_kernname.h"
+
+#include 
+__FBSDID("$FreeBSD$")
+.section ".real_kernel","aw"
+.globl kernel_start;
+kernel_start:
+.incbin KERNNAME
+.globl kernel_end;
+kernel_end:
___
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: r202039 - head/sys/mips/mips

2010-01-10 Thread Warner Losh
Author: imp
Date: Sun Jan 10 20:13:05 2010
New Revision: 202039
URL: http://svn.freebsd.org/changeset/base/202039

Log:
  Merge from projects/mips to head by hand:
  
  Copy over sys_machdep.c

Added:
 - copied unchanged from r202038, projects/mips/sys/mips/mips/sys_machdep.c
Directory Properties:
  head/sys/mips/mips/sys_machdep.c   (props changed)

Copied: head/sys/mips/mips/sys_machdep.c (from r202038, 
projects/mips/sys/mips/mips/sys_machdep.c)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/mips/mips/sys_machdep.cSun Jan 10 20:13:05 2010
(r202039, copy of r202038, projects/mips/sys/mips/mips/sys_machdep.c)
@@ -0,0 +1,77 @@
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *may be used to endorse or promote products derived from this software
+ *without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * from: @(#)sys_machdep.c 5.5 (Berkeley) 1/19/91
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#ifndef _SYS_SYSPROTO_H_
+struct sysarch_args {
+   int op;
+   char *parms;
+};
+#endif
+
+int
+sysarch(td, uap)
+   struct thread *td;
+   register struct sysarch_args *uap;
+{
+   int error;
+   void *tlsbase;
+
+   switch (uap->op) {
+   case MIPS_SET_TLS : 
+   td->td_md.md_tls = (void*)uap->parms;
+   error = 0;
+   break;
+
+   case MIPS_GET_TLS : 
+   tlsbase = td->td_md.md_tls;
+   error = copyout(&tlsbase, uap->parms, sizeof(tlsbase));
+   break;
+   default:
+   error = EINVAL;
+   }
+   return (error);
+}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2010-01-10 Thread Warner Losh
Author: imp
Date: Sun Jan 10 20:13:58 2010
New Revision: 202040
URL: http://svn.freebsd.org/changeset/base/202040

Log:
  Merge from projects/mips to head by hand:
  
  Copy over elf_trampoline.c for crunched kernel support.

Added:
 - copied unchanged from r202039, 
projects/mips/sys/mips/mips/elf_trampoline.c
Directory Properties:
  head/sys/mips/mips/elf_trampoline.c   (props changed)

Copied: head/sys/mips/mips/elf_trampoline.c (from r202039, 
projects/mips/sys/mips/mips/elf_trampoline.c)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/mips/mips/elf_trampoline.c Sun Jan 10 20:13:58 2010
(r202040, copy of r202039, projects/mips/sys/mips/mips/elf_trampoline.c)
@@ -0,0 +1,147 @@
+/*-
+ * Copyright (c) 2005 Olivier Houchard.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+#include 
+#include 
+
+#ifdef __mips_n64
+#include 
+#else
+#include 
+#endif
+#include 
+#include 
+#include 
+#include 
+
+/*
+ * Since we are compiled outside of the normal kernel build process, we
+ * need to include opt_global.h manually.
+ */
+#include "opt_global.h"
+#include "opt_kernname.h"
+
+extern char kernel_start[];
+extern char kernel_end[];
+
+static __inline void *
+memcpy(void *dst, const void *src, size_t len)
+{
+   const char *s = src;
+   char *d = dst;
+
+   while (len) {
+   if (0 && len >= 4 && !((vm_offset_t)d & 3) &&
+   !((vm_offset_t)s & 3)) {
+   *(uint32_t *)d = *(uint32_t *)s;
+   s += 4;
+   d += 4;
+   len -= 4;
+   } else {
+   *d++ = *s++;
+   len--;
+   }
+   }
+   return (dst);
+}
+
+static __inline void
+bzero(void *addr, size_t count)
+{
+   char *tmp = (char *)addr;
+
+   while (count > 0) {
+   if (count >= 4 && !((vm_offset_t)tmp & 3)) {
+   *(uint32_t *)tmp = 0;
+   tmp += 4;
+   count -= 4;
+   } else {
+   *tmp = 0;
+   tmp++;
+   count--;
+   }
+   }
+}
+
+/*
+ * Relocate PT_LOAD segements of kernel ELF image to their respective
+ * virtual addresses and return entry point
+ */
+void *
+load_kernel(void * kstart)
+{
+#ifdef __mips_n64
+   Elf64_Ehdr *eh;
+   Elf64_Phdr phdr[64] /* XXX */;
+#else
+   Elf32_Ehdr *eh;
+   Elf32_Phdr phdr[64] /* XXX */;
+#endif
+   int i;
+   void *entry_point;
+   
+#ifdef __mips_n64
+   eh = (Elf64_Ehdr *)kstart;
+#else
+   eh = (Elf32_Ehdr *)kstart;
+#endif
+   entry_point = (void*)eh->e_entry;
+   memcpy(phdr, (void *)(kstart + eh->e_phoff ),
+   eh->e_phnum * sizeof(phdr[0]));
+
+   for (i = 0; i < eh->e_phnum; i++) {
+   volatile char c;
+
+   if (phdr[i].p_type != PT_LOAD)
+   continue;
+   
+   memcpy((void *)(phdr[i].p_vaddr),
+   (void*)(kstart + phdr[i].p_offset), phdr[i].p_filesz);
+   /* Clean space from oversized segments, eg: bss. */
+   if (phdr[i].p_filesz < phdr[i].p_memsz)
+   bzero((void *)(phdr[i].p_vaddr + phdr[i].p_filesz), 
+   phdr[i].p_memsz - phdr[i].p_filesz);
+   }
+
+   return entry_point;
+}
+
+void
+_startC(register_t a0, register_t a1, register_t a2, register_t a3)
+{
+   unsigned int * code;
+   int i;
+   void (*entry_point)(register_t, register_t, register_t, regist

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

2010-01-10 Thread Warner Losh
Author: imp
Date: Sun Jan 10 20:14:38 2010
New Revision: 202041
URL: http://svn.freebsd.org/changeset/base/202041

Log:
  Merge from projects/mips to head by hand:
  
  copy over the generic bus space implementation...

Added:
 - copied unchanged from r202040, 
projects/mips/sys/mips/mips/bus_space_generic.c
Directory Properties:
  head/sys/mips/mips/bus_space_generic.c   (props changed)

Copied: head/sys/mips/mips/bus_space_generic.c (from r202040, 
projects/mips/sys/mips/mips/bus_space_generic.c)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/mips/mips/bus_space_generic.c  Sun Jan 10 20:14:38 2010
(r202041, copy of r202040, projects/mips/sys/mips/mips/bus_space_generic.c)
@@ -0,0 +1,590 @@
+/*  $NetBSD: bus.h,v 1.12 1997/10/01 08:25:15 fvdl Exp $*/
+/*-
+ * $Id: bus.h,v 1.6 2007/08/09 11:23:32 katta Exp $
+ *
+ * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
+ * NASA Ames Research Center.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ *contributors may be used to endorse or promote products derived
+ *from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
+ */
+
+/*
+ * Copyright (c) 1996 Charles M. Hannum.  All rights reserved.
+ * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *must display the following acknowledgement:
+ *  This product includes software developed by Christopher G. Demetriou
+ * for the NetBSD Project.
+ * 4. The name of the author may not be used to endorse or promote products
+ *derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * from: src/sys/alpha/include/bus.h,v 1.5 1999/08/28 00:38:40 peter
+ * $FreeBSD$
+ */
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+

svn commit: r202044 - head/sys/mips/include

2010-01-10 Thread Warner Losh
Author: imp
Date: Sun Jan 10 20:22:05 2010
New Revision: 202044
URL: http://svn.freebsd.org/changeset/base/202044

Log:
  Fix mis-merge from projects/mips...  the diff didn't apply correctly
  and I didn't notice until after the commit.

Modified:
  head/sys/mips/include/bus.h

Modified: head/sys/mips/include/bus.h
==
--- head/sys/mips/include/bus.h Sun Jan 10 20:21:42 2010(r202043)
+++ head/sys/mips/include/bus.h Sun Jan 10 20:22:05 2010(r202044)
@@ -67,843 +67,662 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * from: src/sys/alpha/include/bus.h,v 1.5 1999/08/28 00:38:40 peter
  * $FreeBSD$
-*/
+ */
 
 #ifndef _MACHINE_BUS_H_
-#define_MACHINE_BUS_H_
+#define _MACHINE_BUS_H_
 
-#ifdef TARGET_OCTEON
-#include 
-#else
 #include 
-#include 
-
-/*
- * Values for the mips bus space tag, not to be used directly by MI code.
- */
-#defineMIPS_BUS_SPACE_IO   0   /* space is i/o space */
-#defineMIPS_BUS_SPACE_MEM  1   /* space is mem space */
-
-
-#defineBUS_SPACE_MAXSIZE_24BIT 0xFF
-#defineBUS_SPACE_MAXSIZE_32BIT 0x
-#defineBUS_SPACE_MAXSIZE   0x /* Maximum supported size */
-#defineBUS_SPACE_MAXADDR_24BIT 0xFF
-#defineBUS_SPACE_MAXADDR_32BIT 0x
-#defineBUS_SPACE_MAXADDR   0x
-
-#defineBUS_SPACE_UNRESTRICTED  (~0)
-
-/*
- * Map a region of device bus space into CPU virtual address space.
- */
 
-static __inline int bus_space_map(bus_space_tag_t t, bus_addr_t addr,
- bus_size_t size, int flags,
- bus_space_handle_t *bshp);
-
-static __inline int
-bus_space_map(bus_space_tag_t t __unused, bus_addr_t addr,
- bus_size_t size __unused, int flags __unused,
- bus_space_handle_t *bshp)
-{
-
-   *bshp = addr;
-   return (0);
-}
-
-/*
- * Unmap a region of device bus space.
- */
-
-void   bus_space_unmap(bus_space_tag_t t, bus_space_handle_t bsh,
-   bus_size_t size);
-
-/*
- * Get a new handle for a subregion of an already-mapped area of bus space.
- */
-
-intbus_space_subregion(bus_space_tag_t t, bus_space_handle_t bsh,
-   bus_size_t offset, bus_size_t size, bus_space_handle_t *nbshp);
-
-/*
- * Allocate a region of memory that is accessible to devices in bus space.
- */
-
-intbus_space_alloc(bus_space_tag_t t, bus_addr_t rstart,
-   bus_addr_t rend, bus_size_t size, bus_size_t align,
-   bus_size_t boundary, int flags, bus_addr_t *addrp,
-   bus_space_handle_t *bshp);
-
-/*
- * Free a region of bus space accessible memory.
- */
-
-void   bus_space_free(bus_space_tag_t t, bus_space_handle_t bsh,
-   bus_size_t size);
-
-
-/*
- * Read a 1, 2, 4, or 8 byte quantity from bus space
- * described by tag/handle/offset.
- */
-static __inline u_int8_t bus_space_read_1(bus_space_tag_t tag,
- bus_space_handle_t handle,
- bus_size_t offset);
-
-static __inline u_int16_t bus_space_read_2(bus_space_tag_t tag,
-  bus_space_handle_t handle,
-  bus_size_t offset);
-
-static __inline u_int32_t bus_space_read_4(bus_space_tag_t tag,
-  bus_space_handle_t handle,
-  bus_size_t offset);
-
-static __inline u_int8_t
-bus_space_read_1(bus_space_tag_t tag, bus_space_handle_t handle,
-bus_size_t offset)
-{
-
-   if (tag == MIPS_BUS_SPACE_IO)
-   return (inb(handle + offset));
-   return (readb(handle + offset));
-}
-
-static __inline u_int16_t
-bus_space_read_2(bus_space_tag_t tag, bus_space_handle_t handle,
-bus_size_t offset)
-{
-
-   if (tag == MIPS_BUS_SPACE_IO)
-   return (inw(handle + offset));
-   return (readw(handle + offset));
-}
-
-static __inline u_int32_t
-bus_space_read_4(bus_space_tag_t tag, bus_space_handle_t handle,
-bus_size_t offset)
-{
-
-   if (tag == MIPS_BUS_SPACE_IO)
-   return (inl(handle + offset));
-   return (readl(handle + offset));
-}
-
-#if 0  /* Cause a link error for bus_space_read_8 */
-#definebus_space_read_8(t, h, o)   !!! bus_space_read_8 
unimplemented !!!
-#endif
-
-/*
- * Read `count' 1, 2, 4, or 8 byte quantities from bus space
- * described by tag/handle/offset and copy into buffer provided.
- */
-static __inline void bus_space_read_multi_1(bus_space_tag_t tag,
-   bus_space_handle_t bsh,
-   bus_size_t offset, u_int8_t *addr,
-   size_t count);
-
-static __inline void bus_spac

svn commit: r202045 - head/usr.bin/make

2010-01-10 Thread Hartmut Brandt
Author: harti
Date: Sun Jan 10 20:26:03 2010
New Revision: 202045
URL: http://svn.freebsd.org/changeset/base/202045

Log:
  Make make respect the TMPDIR environment variable.
  
  PR:   bin/115447
  Submitted by: Eugene Grosbein

Modified:
  head/usr.bin/make/job.c

Modified: head/usr.bin/make/job.c
==
--- head/usr.bin/make/job.c Sun Jan 10 20:22:05 2010(r202044)
+++ head/usr.bin/make/job.c Sun Jan 10 20:26:03 2010(r202045)
@@ -114,6 +114,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -137,7 +138,8 @@ __FBSDID("$FreeBSD$");
 #include "util.h"
 #include "var.h"
 
-#defineTMPPAT  "/tmp/makeXX"
+#defineTMPPAT  "makeXX"
+#defineTMPDIR  "/tmp"
 
 #ifndef USE_KQUEUE
 /*
@@ -236,7 +238,7 @@ typedef struct Job {
 */
struct {
/* Name of file to which shell output was rerouted */
-   charof_outFile[sizeof(TMPPAT)];
+   charof_outFile[PATH_MAX];
 
/*
 * Stream open to the output file. Used to funnel all
@@ -1566,7 +1568,8 @@ JobStart(GNode *gn, int flags, Job *prev
Boolean noExec; /* Set true if we decide not to run the job */
int tfd;/* File descriptor for temp file */
LstNode *ln;
-   chartfile[sizeof(TMPPAT)];
+   chartfile[PATH_MAX];
+   const char *tdir;
 
if (interrupted) {
JobPassSig(interrupted);
@@ -1607,6 +1610,9 @@ JobStart(GNode *gn, int flags, Job *prev
cmdsOK = TRUE;
}
 
+   if ((tdir = getenv("TMPDIR")) == NULL)
+   tdir = TMPDIR;
+
/*
 * If the -n flag wasn't given, we open up OUR (not the child's)
 * temporary file to stuff commands in it. The thing is rd/wr so we
@@ -1622,7 +1628,7 @@ JobStart(GNode *gn, int flags, Job *prev
DieHorribly();
}
 
-   strcpy(tfile, TMPPAT);
+   snprintf(tfile, sizeof(tfile), "%s/%s", tdir, TMPPAT);
if ((tfd = mkstemp(tfile)) == -1)
Punt("Cannot create temp file: %s", strerror(errno));
job->cmdFILE = fdopen(tfd, "w+");
@@ -1801,7 +1807,10 @@ JobStart(GNode *gn, int flags, Job *prev
} else {
fprintf(stdout, "Remaking `%s'\n", gn->name);
fflush(stdout);
-   strcpy(job->outFile, TMPPAT);
+   if ((tdir = getenv("TMPDIR")) == NULL)
+   tdir = TMPDIR;
+   snprintf(job->outFile, sizeof(job->outFile), "%s/%s",
+   tdir, TMPPAT);
if ((job->outFd = mkstemp(job->outFile)) == -1)
Punt("cannot create temp file: %s",
strerror(errno));
___
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: r202046 - head/sys/mips/mips

2010-01-10 Thread Warner Losh
Author: imp
Date: Sun Jan 10 20:29:20 2010
New Revision: 202046
URL: http://svn.freebsd.org/changeset/base/202046

Log:
  Merge from projects/mips to head by hand:
  
  sorry for the huge firehose on this commit, it would be too tedious
  to do file by file
  
  r201881 | imp | 2010-01-08 20:08:22 -0700 (Fri, 08 Jan 2010) | 3 lines
  Rename mips_pcpu_init to mips_pcpu0_init since it applies only to the
  BSP.  Provide a missing prototype.
  
  r201880 | neel | 2010-01-08 19:17:14 -0700 (Fri, 08 Jan 2010) | 7 lines
  Compute the target of the jump in the 'J' and 'JAL' instructions
  correctly. The 256MB segment is formed by taking the top 4 bits
  of the address of the instruction in the "branch delay" slot
  as opposed to the 'J' or 'JAL' instruction itself.
  
  r201845 | imp | 2010-01-08 15:48:21 -0700 (Fri, 08 Jan 2010) | 2 lines
  Centralize initialization of pcpu, and set curthread early...
  
  r201770 | neel | 2010-01-07 22:53:11 -0700 (Thu, 07 Jan 2010) | 4 lines
  Add a DDB command "show pcb" to dump out the contents of a thread's PCB.
  
  r201631 | neel | 2010-01-05 23:42:08 -0700 (Tue, 05 Jan 2010) | 5 lines
  Remove all CFE-specific code from locore.S. The CFE entrypoint initialization
  is now done in platform-specific code.
  
  r201563 | neel | 2010-01-04 23:58:54 -0700 (Mon, 04 Jan 2010) | 6 lines
  This change increases the size of the kernel stack for thread0 from
  PAGE_SIZE to (2 * PAGE_SIZE). It depends on the memory allocated by
  pmap_steal_memory() being aligned to a PAGE_SIZE boundary.
  
  r200656 | imp | 2009-12-17 16:55:49 -0700 (Thu, 17 Dec 2009) | 7 lines
  Place holder ptrace mips module.  Not entirely sure what's required
  here yet, so I've not connected it to the build.  I think that we'll
  need to move something into the processor specific part of the mips
  port by requiring mips_cpu_ptrace or platform_cpu_ptrace be provided
  by the ports to get/set processor specific registers, ala SSE
  registers on x86.
  
  r200342 | imp | 2009-12-09 18:42:44 -0700 (Wed, 09 Dec 2009) | 4 lines
  app_descriptor_addr is unused (I know it is referened still).  And
  unnecessary since we pass in a3 unmodified to platform_start.
  Eliminate it from here and kill one more TARGET_OCTEON in the process.
  
  r199760 | imp | 2009-11-24 10:15:22 -0700 (Tue, 24 Nov 2009) | 2 lines
  Add in Cavium's CID.  Report what the unknown CID is.
  
  r199755 | imp | 2009-11-24 09:53:58 -0700 (Tue, 24 Nov 2009) | 5 lines
  looks like there's more to this patch than just this one file.  I'll
  leave it to neel@ to get all the relevant pieces into the tree.
  
  r199754 | imp | 2009-11-24 09:32:31 -0700 (Tue, 24 Nov 2009) | 6 lines
  Include opt_cputype.h for all .c and .S files referencing TARGET_OCTEON.
  Spell ld script name right.
  # for the most part, we need to enhance infrastructure to obviate the need
  # for such an intrusive option.
  
  r199753 | imp | 2009-11-24 09:30:29 -0700 (Tue, 24 Nov 2009) | 3 lines
  Remove a comment that's bogus.
  Include opt_cputype.h since TARGET_OCTEON moved there.
  
  r199752 | imp | 2009-11-24 09:29:23 -0700 (Tue, 24 Nov 2009) | 4 lines
  Make sure kstack0 is page aligned.
  # this may have been from neel@ for the sibyte stuff
  
  r199742 | imp | 2009-11-24 01:35:11 -0700 (Tue, 24 Nov 2009) | 8 lines
  Move the hard-wiring of the dcache on octeon outside of the if
  statement.  When no caches support was added, it looks like
  TARGET_OCTEON was bogusly moved inside the if.  Also, include
  opt_cputype.h to make TARGET_OCTEON actually active.
  
  # now we die in pmap init somewhere...  Most likely because 32MB of RAM is
  # too tight given the load address we're using.
  
  r199741 | imp | 2009-11-24 01:21:48 -0700 (Tue, 24 Nov 2009) | 2 lines
  TARGET_OCTEON reqiures opt_cputype.h.
  
  r199736 | imp | 2009-11-24 00:40:38 -0700 (Tue, 24 Nov 2009) | 2 lines
  Prefer ANSI spellings of uintXX_t, etc.
  
  r199598 | imp | 2009-11-20 09:30:35 -0700 (Fri, 20 Nov 2009) | 3 lines
  Horrible kludge to make octeon32 work.  I think a better way is to
  move the generic code into the config files
  
  r199597 | imp | 2009-11-20 09:27:50 -0700 (Fri, 20 Nov 2009) | 4 lines
  cast vaddr to uintptr_t before casting it to a bus_space_handle_t.
  # I'm sure this indicates a problem, but I'm not sure what...
  
  r199496 | gonzo | 2009-11-18 15:52:05 -0700 (Wed, 18 Nov 2009) | 5 lines
  - Add cpu_init_interrupts function that is supposed to
  prepeare stuff required for spinning out interrupts later
  - Add API for managing intrcnt/intrnames arrays
  - Some minor style(9) fixes
  
  r199246 | neel | 2009-11-13 02:24:09 -0700 (Fri, 13 Nov 2009) | 10 lines
  Make pmap_copy_page() L2-cache friendly by doing the copy through the
  cacheable window on physical memory (KSEG0). On the Sibyte processor
  going through the uncacheable window (KSEG1) bypasses both L1 and L2
  caches so we may end up with stale contents in the L2 cache.
  
  This also makes it consistent with the

svn commit: r202047 - in head/sys: amd64/amd64 i386/xen

2010-01-10 Thread Alan Cox
Author: alc
Date: Sun Jan 10 21:00:52 2010
New Revision: 202047
URL: http://svn.freebsd.org/changeset/base/202047

Log:
  Eliminate unused declarations.

Modified:
  head/sys/amd64/amd64/mp_machdep.c
  head/sys/i386/xen/xen_machdep.c

Modified: head/sys/amd64/amd64/mp_machdep.c
==
--- head/sys/amd64/amd64/mp_machdep.c   Sun Jan 10 20:29:20 2010
(r202046)
+++ head/sys/amd64/amd64/mp_machdep.c   Sun Jan 10 21:00:52 2010
(r202047)
@@ -98,12 +98,6 @@ char *doublefault_stack;
 char *nmi_stack;
 void *dpcpu;
 
-/* Hotwire a 0->4MB V==P mapping */
-extern pt_entry_t *KPTphys;
-
-/* SMP page table page */
-extern pt_entry_t *SMPpt;
-
 struct pcb stoppcbs[MAXCPU];
 struct xpcb **stopxpcbs = NULL;
 

Modified: head/sys/i386/xen/xen_machdep.c
==
--- head/sys/i386/xen/xen_machdep.c Sun Jan 10 20:29:20 2010
(r202046)
+++ head/sys/i386/xen/xen_machdep.c Sun Jan 10 21:00:52 2010
(r202047)
@@ -715,9 +715,6 @@ xen_destroy_contiguous_region(void *addr
balloon_unlock(flags);
 }
 
-extern unsigned long cpu0prvpage;
-extern unsigned long *SMPpt;
-extern  struct user*proc0uarea;
 extern  vm_offset_tproc0kstack;
 extern int vm86paddr, vm86phystk;
 char *bootmem_start, *bootmem_current, *bootmem_end;
___
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: r201999 - head/lib/libc/stdio

2010-01-10 Thread Andrey Chernov
On Sun, Jan 10, 2010 at 02:30:30PM +, Colin Percival wrote:
> +  * Check for integer overflow.  As an optimization, first check that
> +  * at least one of {count, size} is at least 2^16, since if both
> +  * values are less than that, their product can't possible overflow
> +  * (size_t is always at least 32 bits on FreeBSD).
> +  */
> + if (((count | size) > 0x) &&
> + (count > SIZE_MAX / size)) {
> + errno = EINVAL;
> + fp->_flags |= __SERR;
> + return (0);
> + }

1) I don't think that this is good place of exact constants like 0x, 
usually we don't use such things in overflow checks (see all other ones).
fread/fwrite are already slow as designed, so optimizing one time argument 
check looks strange.

2) fp->_flags |= __SERR;
This flag is for errors in the file stream, not for errors in 
the arguments. Please back that line out.

3) errno should be EOVERFLOW, see other owerflow checks in the stdio.

-- 
http://ache.pp.ru/
___
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: r202048 - in head: etc share/termcap

2010-01-10 Thread Ed Schouten
Author: ed
Date: Sun Jan 10 21:41:37 2010
New Revision: 202048
URL: http://svn.freebsd.org/changeset/base/202048

Log:
  Properly make the end key work again for TERM=xterm.
  
  I've been so busy hacking on utmpx the last couple of days, out of
  reflex, I committed it to the wrong source tree. Note to myself: don't
  hack on FreeBSD while watching TV at the same time.
  
  PR:   conf/142578
  Submitted by: Yuri Pankov 
  Reminded by:  stefanf

Modified:
  head/etc/termcap.small
  head/share/termcap/termcap.src

Modified: head/etc/termcap.small
==
--- head/etc/termcap.small  Sun Jan 10 21:00:52 2010(r202047)
+++ head/etc/termcap.small  Sun Jan 10 21:41:37 2010(r202048)
@@ -294,9 +294,9 @@ pc3|ibmpc3|IBM PC 386BSD Console:\
 # $XTermId: termcap,v 1.78 2009/11/09 00:24:26 tom Exp $
 #
 xterm-new|modern xterm:\
-   :*6=\EOF:@7=\EOF:F1=\E[23~:F2=\E[24~:K2=\EOE:Km=\E[M:\
+   :@7=\EOF:@8=\EOM:F1=\E[23~:F2=\E[24~:K2=\EOE:Km=\E[M:\
:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\E[15~:k6=\E[17~:\
-   :k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:kH=\EOF:kI=\E[2~:\
+   :k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:kI=\E[2~:\
:kN=\E[6~:kP=\E[5~:kd=\EOB:kh=\EOH:kl=\EOD:kr=\EOC:ku=\EOA:\
:tc=xterm-basic:
 #

Modified: head/share/termcap/termcap.src
==
--- head/share/termcap/termcap.src  Sun Jan 10 21:00:52 2010
(r202047)
+++ head/share/termcap/termcap.src  Sun Jan 10 21:41:37 2010
(r202048)
@@ -2807,9 +2807,9 @@ xterm-clear:\
:te=\E[?1049l:ti=\E[?1049h:\
:tc=xterm-new:
 xterm-new|modern xterm:\
-   :*6=\EOF:@7=\EOF:F1=\E[23~:F2=\E[24~:K2=\EOE:Km=\E[M:\
+   :@7=\EOF:@8=\EOM:F1=\E[23~:F2=\E[24~:K2=\EOE:Km=\E[M:\
:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\E[15~:k6=\E[17~:\
-   :k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:kH=\EOF:kI=\E[2~:\
+   :k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:kI=\E[2~:\
:kN=\E[6~:kP=\E[5~:kd=\EOB:kh=\EOH:kl=\EOD:kr=\EOC:ku=\EOA:\
:tc=xterm-basic:
 #
___
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: r202049 - head/usr.bin/lastcomm

2010-01-10 Thread Ed Schouten
Author: ed
Date: Sun Jan 10 21:59:06 2010
New Revision: 202049
URL: http://svn.freebsd.org/changeset/base/202049

Log:
  Let lastcomm(1) build without .
  
  Use MAXLOGNAME - 1 instead of UTNAMESIZE. There is no definition for TTY
  name sizes, at least not as low as 8, so hardcode it for now.

Modified:
  head/usr.bin/lastcomm/lastcomm.c

Modified: head/usr.bin/lastcomm/lastcomm.c
==
--- head/usr.bin/lastcomm/lastcomm.cSun Jan 10 21:41:37 2010
(r202048)
+++ head/usr.bin/lastcomm/lastcomm.cSun Jan 10 21:59:06 2010
(r202049)
@@ -59,7 +59,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include "pathnames.h"
 
 /*XXX*/#include 
@@ -154,11 +153,11 @@ main(int argc, char *argv[])
if (*argv && !requested(argv, &ab))
continue;
 
-   (void)printf("%-*.*s %-7s %-*s %-*s",
+   (void)printf("%-*.*s %-7s %-*s %-8s",
 AC_COMM_LEN, AC_COMM_LEN, ab.ac_comm,
 flagbits(ab.ac_flagx),
-UT_NAMESIZE, user_from_uid(ab.ac_uid, 0),
-UT_LINESIZE, getdev(ab.ac_tty));
+MAXLOGNAME - 1, user_from_uid(ab.ac_uid, 0),
+getdev(ab.ac_tty));


/* user + system time */
___
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: r201999 - head/lib/libc/stdio

2010-01-10 Thread Colin Percival
Andrey Chernov wrote:
> On Sun, Jan 10, 2010 at 02:30:30PM +, Colin Percival wrote:
>> +if (((count | size) > 0x) &&
>> +(count > SIZE_MAX / size)) {
>> +errno = EINVAL;
>> +fp->_flags |= __SERR;
>> +return (0);
>> +}
> 
> 1) I don't think that this is good place of exact constants like 0x, 
> usually we don't use such things in overflow checks (see all other ones).
> fread/fwrite are already slow as designed, so optimizing one time argument 
> check looks strange.

On my laptop, this optimization speeds up 1-byte fwrite calls by 27% compared
to always doing the division.  You can argue that people who care about code
performance shouldn't be making millions of 1-byte fwrite calls, but I think
it's a simple enough optimization and has enough of an impact to be worthwhile.

> 2) fp->_flags |= __SERR;
> This flag is for errors in the file stream, not for errors in 
> the arguments. Please back that line out.

Quoting fread(3):
 The function fread() does not distinguish between end-of-file and error,
 and callers must use feof(3) and ferror(3) to determine which occurred.
This would seem to imply that for any failed request, either feof or ferror
should return a non-zero value.  Removing this line would break the common
while (fread(ptr, reclen, 1, f) == 1) {
/* Do stuff here. */
}
if (ferror(f)) {
/* Die due to read error */
}
/* No error?  Ok, we must have hit EOF */
idiom.

> 3) errno should be EOVERFLOW, see other owerflow checks in the stdio.

I picked EINVAL because this is the code used by read(2) and write(2) if they
are passed nbytes > INT_MAX.  It would seem odd to use one error code for a
number of bytes between INT_MAX and SIZE_MAX and then switch to a different
error code for > SIZE_MAX bytes.

-- 
Colin Percival
Security Officer, FreeBSD | freebsd.org | The power to serve
Founder / author, Tarsnap | tarsnap.com | Online backups for the truly paranoid
___
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: r202050 - in head/sys: kern sys

2010-01-10 Thread Warner Losh
Author: imp
Date: Sun Jan 10 22:34:18 2010
New Revision: 202050
URL: http://svn.freebsd.org/changeset/base/202050

Log:
  Merge change r198561 from projects/mips to head:
  
  r198561 | thompsa | 2009-10-28 15:25:22 -0600 (Wed, 28 Oct 2009) | 4 lines
  Allow a scratch buffer to be set in order to be able to use setenv() while
  booting, before dynamic kenv is running. A few platforms implement their own
  scratch+sprintf handling to save data from the boot environment.

Modified:
  head/sys/kern/kern_environment.c
  head/sys/sys/systm.h

Modified: head/sys/kern/kern_environment.c
==
--- head/sys/kern/kern_environment.cSun Jan 10 21:59:06 2010
(r202049)
+++ head/sys/kern/kern_environment.cSun Jan 10 22:34:18 2010
(r202050)
@@ -60,6 +60,8 @@ static MALLOC_DEFINE(M_KENV, "kenv", "ke
 
 /* pointer to the static environment */
 char   *kern_envp;
+static int env_len;
+static int env_pos;
 static char*kernenv_next(char *);
 
 /* dynamic environment variables */
@@ -208,6 +210,14 @@ done:
return (error);
 }
 
+void
+init_static_kenv(char *buf, size_t len)
+{
+   kern_envp = buf;
+   env_len = len;
+   env_pos = 0;
+}
+
 /*
  * Setup the dynamic kernel environment.
  */
@@ -336,6 +346,26 @@ testenv(const char *name)
return (0);
 }
 
+static int
+setenv_static(const char *name, const char *value)
+{
+   int len;
+
+   if (env_pos >= env_len)
+   return (-1);
+
+   /* Check space for x=y and two nuls */
+   len = strlen(name) + strlen(value);
+   if (len + 3 < env_len - env_pos) {
+   len = sprintf(&kern_envp[env_pos], "%s=%s", name, value);
+   env_pos += len+1;
+   kern_envp[env_pos] = '\0';
+   return (0);
+   } else
+   return (-1);
+
+}
+
 /*
  * Set an environment variable by name.
  */
@@ -345,6 +375,9 @@ setenv(const char *name, const char *val
char *buf, *cp, *oldenv;
int namelen, vallen, i;
 
+   if (dynamic_kenv == 0 && env_len > 0)
+   return (setenv_static(name, value));
+
KENV_CHECK;
 
namelen = strlen(name) + 1;

Modified: head/sys/sys/systm.h
==
--- head/sys/sys/systm.hSun Jan 10 21:59:06 2010(r202049)
+++ head/sys/sys/systm.hSun Jan 10 22:34:18 2010(r202050)
@@ -164,6 +164,7 @@ voidcritical_exit(void);
 void   init_param1(void);
 void   init_param2(long physpages);
 void   init_param3(long kmempages);
+void   init_static_kenv(char *, size_t);
 void   tablefull(const char *);
 intkvprintf(char const *, void (*)(int, void*), void *, int,
__va_list) __printflike(1, 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: r201999 - head/lib/libc/stdio

2010-01-10 Thread Jilles Tjoelker
On Sun, Jan 10, 2010 at 02:18:58PM -0800, Colin Percival wrote:
> Andrey Chernov wrote:
> > On Sun, Jan 10, 2010 at 02:30:30PM +, Colin Percival wrote:
> >> +  if (((count | size) > 0x) &&
> >> +  (count > SIZE_MAX / size)) {
> >> +  errno = EINVAL;
> >> +  fp->_flags |= __SERR;
> >> +  return (0);
> >> +  }

> > 2) fp->_flags |= __SERR;
> > This flag is for errors in the file stream, not for errors in 
> > the arguments. Please back that line out.

> Quoting fread(3):
>  The function fread() does not distinguish between end-of-file and error,
>  and callers must use feof(3) and ferror(3) to determine which occurred.
> This would seem to imply that for any failed request, either feof or ferror
> should return a non-zero value.  Removing this line would break the common
>   while (fread(ptr, reclen, 1, f) == 1) {
>   /* Do stuff here. */
>   }
>   if (ferror(f)) {
>   /* Die due to read error */
>   }
>   /* No error?  Ok, we must have hit EOF */
> idiom.

Agreed, this error should set the error indicator.

> > 3) errno should be EOVERFLOW, see other owerflow checks in the stdio.

> I picked EINVAL because this is the code used by read(2) and write(2) if they
> are passed nbytes > INT_MAX.  It would seem odd to use one error code for a
> number of bytes between INT_MAX and SIZE_MAX and then switch to a different
> error code for > SIZE_MAX bytes.

I think the fact that you can only read(2)/write(2) INT_MAX at a time is
a bug, so basing additional code on it seems inappropriate.

Even then, fread()/fwrite() will not generate such large
read(2)/write(2) requests as they always go through the buffer which is
filled using smaller requests.

Also, EOVERFLOW will give a more understandable error message for users.

-- 
Jilles Tjoelker
___
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: r201999 - head/lib/libc/stdio

2010-01-10 Thread Andrey Chernov
On Mon, Jan 11, 2010 at 12:06:18AM +0100, Jilles Tjoelker wrote:
> > I picked EINVAL because this is the code used by read(2) and write(2) if 
> > they
> > are passed nbytes > INT_MAX.  It would seem odd to use one error code for a
> > number of bytes between INT_MAX and SIZE_MAX and then switch to a different
> > error code for > SIZE_MAX bytes.
> 
> I think the fact that you can only read(2)/write(2) INT_MAX at a time is
> a bug, so basing additional code on it seems inappropriate.
> 
> Even then, fread()/fwrite() will not generate such large
> read(2)/write(2) requests as they always go through the buffer which is
> filled using smaller requests.
> 
> Also, EOVERFLOW will give a more understandable error message for users.

Agreed. 
F.e. POSIX limit for write(2) is {SSIZE_MAX}, not INT_MAX.

-- 
http://ache.pp.ru/
___
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: r202052 - in stable/8/sys: conf ia64/ia64 ia64/include

2010-01-10 Thread Marcel Moolenaar
Author: marcel
Date: Sun Jan 10 23:51:02 2010
New Revision: 202052
URL: http://svn.freebsd.org/changeset/base/202052

Log:
  MFC rev 201269, 201373:
  o   Revamp bus_space access functions (201269).
  o   Change BUS_SPACE_MAXADDR from 2^32-1 to 2^64-1 (201373).

Added:
  stable/8/sys/ia64/ia64/bus_machdep.c
 - copied unchanged from r201269, head/sys/ia64/ia64/bus_machdep.c
Modified:
  stable/8/sys/conf/files.ia64
  stable/8/sys/ia64/ia64/machdep.c
  stable/8/sys/ia64/ia64/mp_machdep.c
  stable/8/sys/ia64/ia64/nexus.c
  stable/8/sys/ia64/ia64/sys_machdep.c
  stable/8/sys/ia64/include/bus.h
  stable/8/sys/ia64/include/cpufunc.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/conf/files.ia64
==
--- stable/8/sys/conf/files.ia64Sun Jan 10 23:37:04 2010
(r202051)
+++ stable/8/sys/conf/files.ia64Sun Jan 10 23:51:02 2010
(r202052)
@@ -75,6 +75,7 @@ ia64/ia32/ia32_reg.c  optionalcompat_ia
 ia64/ia32/ia32_signal.coptionalcompat_ia32
 ia64/ia32/ia32_trap.c  optionalcompat_ia32
 ia64/ia64/autoconf.c   standard
+ia64/ia64/bus_machdep.cstandard
 ia64/ia64/busdma_machdep.c standard
 ia64/ia64/clock.c  standard
 ia64/ia64/context.Sstandard

Copied: stable/8/sys/ia64/ia64/bus_machdep.c (from r201269, 
head/sys/ia64/ia64/bus_machdep.c)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/8/sys/ia64/ia64/bus_machdep.cSun Jan 10 23:51:02 2010
(r202052, copy of r201269, head/sys/ia64/ia64/bus_machdep.c)
@@ -0,0 +1,356 @@
+/*-
+ * Copyright (c) 2009 Marcel Moolenaar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+
+extern u_long ia64_port_base;
+
+#define __PIO_ADDR(port)\
+(void *)(ia64_port_base | (((port) & 0xfffc) << 10) | ((port) & 0xFFF))
+
+uint8_t
+bus_space_read_io_1(u_long port)
+{
+   uint8_t v;
+
+   ia64_mf();
+   v = ia64_ld1(__PIO_ADDR(port));
+   ia64_mf_a();
+   ia64_mf();
+   return (v);
+}
+
+uint16_t
+bus_space_read_io_2(u_long port)
+{
+   uint16_t v;
+
+   ia64_mf();
+   v = ia64_ld2(__PIO_ADDR(port));
+   ia64_mf_a();
+   ia64_mf();
+   return (v);
+}
+
+uint32_t
+bus_space_read_io_4(u_long port)
+{
+   uint32_t v;
+
+   ia64_mf();
+   v = ia64_ld4(__PIO_ADDR(port));
+   ia64_mf_a();
+   ia64_mf();
+   return (v);
+}
+
+#if 0
+uint64_t
+bus_space_read_io_8(u_long port)
+{
+}
+#endif
+
+void
+bus_space_write_io_1(u_long port, uint8_t val)
+{
+
+   ia64_mf();
+   ia64_st1(__PIO_ADDR(port), val);
+   ia64_mf_a();
+   ia64_mf();
+}
+
+void
+bus_space_write_io_2(u_long port, uint16_t val)
+{
+
+   ia64_mf();
+   ia64_st2(__PIO_ADDR(port), val);
+   ia64_mf_a();
+   ia64_mf();
+}
+
+void
+bus_space_write_io_4(u_long port, uint32_t val)
+{
+
+   ia64_mf();
+   ia64_st4(__PIO_ADDR(port), val);
+   ia64_mf_a();
+   ia64_mf();
+}
+
+#if 0
+void
+bus_space_write_io_8(u_long port, uint64_t val)
+{
+}
+#endif
+
+void
+bus_space_read_multi_io_1(u_long port, uint8_t *ptr, size_t count)
+{
+
+   while (count-- > 0)
+   *ptr++ 

svn commit: r202054 - in head/sys/dev/usb: . serial

2010-01-10 Thread Andrew Thompson
Author: thompsa
Date: Mon Jan 11 00:18:40 2010
New Revision: 202054
URL: http://svn.freebsd.org/changeset/base/202054

Log:
  Add the Globetrotter GE40x.
  
  Submitted by: Mike Tancsa

Modified:
  head/sys/dev/usb/serial/u3g.c
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/serial/u3g.c
==
--- head/sys/dev/usb/serial/u3g.c   Mon Jan 11 00:11:16 2010
(r202053)
+++ head/sys/dev/usb/serial/u3g.c   Mon Jan 11 00:18:40 2010
(r202054)
@@ -316,6 +316,7 @@ static const struct usb_device_id u3g_de
U3G_DEV(OPTION, E7041, 0),
U3G_DEV(OPTION, E7061, 0),
U3G_DEV(OPTION, E7100, 0),
+   U3G_DEV(OPTION, GE40X, 0),
U3G_DEV(OPTION, GT3G, 0),
U3G_DEV(OPTION, GT3GPLUS, 0),
U3G_DEV(OPTION, GT3GQUAD, 0),

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsMon Jan 11 00:11:16 2010(r202053)
+++ head/sys/dev/usb/usbdevsMon Jan 11 00:18:40 2010(r202054)
@@ -2099,6 +2099,7 @@ product OPTION E7041  0x7041  3G modem
 product OPTION E7061   0x7061  3G modem
 product OPTION E7100   0x7100  3G modem
 product OPTION GTM380  0x7201  3G modem
+product OPTION GE40X   0x7601  Globetrotter HSUPA
 
 /* OQO */
 product OQO WIFI01 0x0002  model 01 WiFi interface
___
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: r202056 - in head/sys/dev/siba: . siba

2010-01-10 Thread Warner Losh
Author: imp
Date: Mon Jan 11 00:40:19 2010
New Revision: 202056
URL: http://svn.freebsd.org/changeset/base/202056

Log:
  Move this to the right location.  Grump.

Added:
 - copied unchanged from r202055, head/sys/dev/siba/siba/siba_cc.c
Directory Properties:
  head/sys/dev/siba/siba_cc.c   (props changed)
Deleted:
  head/sys/dev/siba/siba/siba_cc.c

Copied: head/sys/dev/siba/siba_cc.c (from r202055, 
head/sys/dev/siba/siba/siba_cc.c)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/siba/siba_cc.c Mon Jan 11 00:40:19 2010(r202056, copy 
of r202055, head/sys/dev/siba/siba/siba_cc.c)
@@ -0,0 +1,154 @@
+/*-
+ * Copyright (c) 2007 Bruce M. Simpson.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * Child driver for ChipCommon core.
+ * This is not MI code at the moment.
+ * Two 16C550 compatible UARTs live here. On the WGT634U, uart1 is the
+ * system console, and uart0 is not pinned out.
+ *  Because their presence is conditional, they should probably
+ *  be attached from here.
+ * GPIO lives here.
+ * The hardware watchdog lives here.
+ * Clock control registers live here.
+ *  You don't need to read them to determine the clock speed on the 5365,
+ *  which is always 200MHz and thus may be hardcoded (for now).
+ * Flash config registers live here. There may or may not be system flash.
+ * The external interface bus lives here (conditionally).
+ * There is a JTAG interface here which may be used to attach probes to
+ * the SoC for debugging.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+
+static int siba_cc_attach(device_t);
+static int siba_cc_probe(device_t);
+static voidsiba_cc_intr(void *v);
+
+static int
+siba_cc_probe(device_t dev)
+{
+
+   if (siba_get_vendor(dev) == SIBA_VID_BROADCOM &&
+   siba_get_device(dev) == SIBA_DEVID_CHIPCOMMON) {
+   device_set_desc(dev, "ChipCommon core");
+   return (BUS_PROBE_DEFAULT);
+   }
+
+   return (ENXIO);
+}
+
+struct siba_cc_softc {
+   void *notused;
+};
+
+static int
+siba_cc_attach(device_t dev)
+{
+   //struct siba_cc_softc *sc = device_get_softc(dev);
+   struct resource *mem;
+   struct resource *irq;
+   int rid;
+
+   /*
+* Allocate the resources which the parent bus has already
+* determined for us.
+* TODO: interrupt routing
+*/
+#define MIPS_MEM_RID 0x20
+   rid = MIPS_MEM_RID;
+   mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE);
+   if (mem == NULL) {
+   device_printf(dev, "unable to allocate memory\n");
+   return (ENXIO);
+   }
+
+   rid = 0;
+   irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, 0);
+   if (irq == NULL) {
+   device_printf(dev, "unable to allocate irq\n");
+   return (ENXIO);
+   }
+
+   /* now setup the interrupt */
+   /* may be fast, exclusive or mpsafe at a later date */
+
+   /*
+* XXX is this interrupt line in ChipCommon used for anything
+* other than the uart? in that case we shouldn't hog it ourselves
+* and let uart claim it to avoid polled mode.
+*/
+   int err;
+   void *cookie;
+   err = bus_setup_intr(dev, irq, INTR_TYPE_TTY, NULL, siba_cc_intr, NULL,
+   &cookie);
+   if (err != 0) {
+   device_printf(dev, "unable to setup intr\n");
+   return (ENXIO);
+   }
+
+   /* TODO: attach uart child

svn commit: r202057 - head/sys/dev/siba/siba

2010-01-10 Thread Warner Losh
Author: imp
Date: Mon Jan 11 00:41:14 2010
New Revision: 202057
URL: http://svn.freebsd.org/changeset/base/202057

Log:
  This was somehow copied to the wrong place :(.  Remove the spare copy.

Deleted:
  head/sys/dev/siba/siba/
___
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: r197752 - head/lib/libc/stdio

2010-01-10 Thread Max Laier
On Sunday 04 October 2009 21:43:36 David Schultz wrote:
> Author: das
> Date: Sun Oct  4 19:43:36 2009
> New Revision: 197752
> URL: http://svn.freebsd.org/changeset/base/197752
> 
> Log:
>   Better glibc compatibility for getline/getdelim:
> 
>   - Tolerate applications that pass a NULL pointer for the buffer and
> claim that the capacity of the buffer is nonzero.
> 
>   - If an application passes in a non-NULL buffer pointer and claims the
> buffer has zero capacity, we should free (well, realloc) it
> anyway. It could have been obtained from malloc(0), so failing to
> free it would be a small memory leak.
> 
>   MFC After:  2 weeks
>   Reported by:naddy
>   PR: ports/138320
> 
> Modified:
>   head/lib/libc/stdio/getdelim.c
> 
> Modified: head/lib/libc/stdio/getdelim.c
> ===
> === --- head/lib/libc/stdio/getdelim.cSun Oct  4 19:03:32 2009
> (r197751)
>  +++ head/lib/libc/stdio/getdelim.c   Sun Oct  4 19:43:36 2009
> (r197752) @@
>  -120,8 +120,8 @@ getdelim(char ** __restrict linep, size_
>   goto error;
>   }
> 
> - if (*linecapp == 0)
> - *linep = NULL;
> + if (*linep == NULL)
> + *linecapp = 0;
> 
>   if (fp->_r <= 0 && __srefill(fp)) {
>   /* If fp is at EOF already, we just need space for the NUL. */

I think we should have kept the original if case here, as well.  Otherwise 
something like this might fail:

char *line; /* note uninitialized */
size_t len = 0;
getline(&line, &len, fd);

and I think it is a reasonable thing to pass in an uninitialized pointer if 
you tell that there is no space associated with it, yet.

I don't know if there are many (ab)uses of getline like this, but I was just 
bitten by it.

--
  Max
___
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: r202059 - in stable/8: cddl/contrib/opensolaris/cmd/zpool sys/cddl/boot/zfs sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opens...

2010-01-10 Thread Xin LI
Author: delphij
Date: Mon Jan 11 02:31:00 2010
New Revision: 202059
URL: http://svn.freebsd.org/changeset/base/202059

Log:
  MFC r201143:
  
  Apply OpenSolaris revision 8021:b8fe9660eb2d which brings our zpool
  to version 14, making it possible for zpools created on OpenSolaris
  2009.06 be used on FreeBSD.
  
  PR:   kern/141800
  Submitted by: mm
  Reviewed by:  pjd, trasz
  Obtained from:OpenSolaris onnv-gate

Modified:
  stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
  stable/8/sys/cddl/boot/zfs/zfsimpl.h
  stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
  stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h
Directory Properties:
  stable/8/cddl/contrib/opensolaris/   (props changed)
  stable/8/cddl/contrib/opensolaris/cmd/zdb/   (props changed)
  stable/8/cddl/contrib/opensolaris/cmd/zfs/   (props changed)
  stable/8/cddl/contrib/opensolaris/lib/libzfs/   (props changed)
  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/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
==
--- stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.cMon Jan 11 
00:51:25 2010(r202058)
+++ stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.cMon Jan 11 
02:31:00 2010(r202059)
@@ -3488,6 +3488,8 @@ zpool_do_upgrade(int argc, char **argv)
(void) printf(gettext(" 11  Improved scrub performance\n"));
(void) printf(gettext(" 12  Snapshot properties\n"));
(void) printf(gettext(" 13  snapused property\n"));
+   (void) printf(gettext(" 14  passthrough-x aclinherit "
+   "support\n"));
(void) printf(gettext("For more information on a particular "
"version, including supported releases, see:\n\n"));
(void) printf("http://www.opensolaris.org/os/community/zfs/";

Modified: stable/8/sys/cddl/boot/zfs/zfsimpl.h
==
--- stable/8/sys/cddl/boot/zfs/zfsimpl.hMon Jan 11 00:51:25 2010
(r202058)
+++ stable/8/sys/cddl/boot/zfs/zfsimpl.hMon Jan 11 02:31:00 2010
(r202059)
@@ -479,13 +479,14 @@ typedef enum {
 #defineSPA_VERSION_11  11ULL
 #defineSPA_VERSION_12  12ULL
 #defineSPA_VERSION_13  13ULL
+#defineSPA_VERSION_14  14ULL
 /*
  * When bumping up SPA_VERSION, make sure GRUB ZFS understand the on-disk
  * format change. Go to usr/src/grub/grub-0.95/stage2/{zfs-include/, 
fsys_zfs*},
  * and do the appropriate changes.
  */
-#defineSPA_VERSION SPA_VERSION_13
-#defineSPA_VERSION_STRING  "13"
+#defineSPA_VERSION SPA_VERSION_14
+#defineSPA_VERSION_STRING  "14"
 
 /*
  * Symbolic names for the changes that caused a SPA_VERSION switch.
@@ -520,6 +521,7 @@ typedef enum {
 #defineSPA_VERSION_DSL_SCRUB   SPA_VERSION_11
 #defineSPA_VERSION_SNAP_PROPS  SPA_VERSION_12
 #defineSPA_VERSION_USED_BREAKDOWN  SPA_VERSION_13
+#defineSPA_VERSION_PASSTHROUGH_X   SPA_VERSION_14
 
 /*
  * The following are configuration names used in the nvlist describing a pool's

Modified: stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c
==
--- stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Mon Jan 11 
00:51:25 2010(r202058)
+++ stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Mon Jan 11 
02:31:00 2010(r202059)
@@ -97,6 +97,7 @@ zfs_prop_init(void)
{ "restricted", ZFS_ACL_RESTRICTED },
{ "passthrough", ZFS_ACL_PASSTHROUGH },
{ "secure", ZFS_ACL_RESTRICTED }, /* bkwrd compatability */
+   { "passthrough-x", ZFS_ACL_PASSTHROUGH_X },
{ NULL }
};
 
@@ -173,7 +174,7 @@ zfs_prop_init(void)
"discard | groupmask | passthrough", "ACLMODE", acl_mode_table);
register_index(ZFS_PROP_ACLINHERIT, "aclinherit", ZFS_ACL_RESTRICTED,
PROP_INHERIT, ZFS_TYPE_FILESYSTEM,
-   "discard | noallow | restricted | passthrough",
+   "discard | noallow | restricted | passthrough | passthrough-x",
"ACLINHERIT", acl_inherit_table);
register_index(ZF

svn commit: r202060 - head/usr.bin/netstat

2010-01-10 Thread Xin LI
Author: delphij
Date: Mon Jan 11 03:00:17 2010
New Revision: 202060
URL: http://svn.freebsd.org/changeset/base/202060

Log:
  Add a new option, -q howmany, which when used in conjuction with -w,
  exits netstat after _howmany_ outputs.
  
  Requested by: thomasa
  Reviewed by:  freebsd-net (bms, old version in early 2007)
  MFC after:1 month

Modified:
  head/usr.bin/netstat/if.c
  head/usr.bin/netstat/main.c
  head/usr.bin/netstat/netstat.1
  head/usr.bin/netstat/netstat.h

Modified: head/usr.bin/netstat/if.c
==
--- head/usr.bin/netstat/if.c   Mon Jan 11 02:31:00 2010(r202059)
+++ head/usr.bin/netstat/if.c   Mon Jan 11 03:00:17 2010(r202060)
@@ -679,6 +679,8 @@ loop:
if (!first)
putchar('\n');
fflush(stdout);
+   if ((noutputs != 0) && (--noutputs == 0))
+   exit(0);
oldmask = sigblock(sigmask(SIGALRM));
while (!signalled)
sigpause(0);

Modified: head/usr.bin/netstat/main.c
==
--- head/usr.bin/netstat/main.c Mon Jan 11 02:31:00 2010(r202059)
+++ head/usr.bin/netstat/main.c Mon Jan 11 03:00:17 2010(r202060)
@@ -334,6 +334,7 @@ int hflag;  /* show counters in human re
 intiflag;  /* show interfaces */
 intLflag;  /* show size of listen queues */
 intmflag;  /* show memory stats */
+intnoutputs = 0;   /* how much outputs before we exit */
 intnumeric_addr;   /* show addresses numerically */
 intnumeric_port;   /* show ports numerically */
 static int pflag;  /* show given protocol */
@@ -359,7 +360,7 @@ main(int argc, char *argv[])
 
af = AF_UNSPEC;
 
-   while ((ch = getopt(argc, argv, "AaBbdf:ghI:iLlM:mN:np:rSsuWw:xz")) != 
-1)
+   while ((ch = getopt(argc, argv, "AaBbdf:ghI:iLlM:mN:np:q:rSsuWw:xz")) 
!= -1)
switch(ch) {
case 'A':
Aflag = 1;
@@ -445,6 +446,11 @@ main(int argc, char *argv[])
}
pflag = 1;
break;
+   case 'q':
+   noutputs = atoi(optarg);
+   if (noutputs != 0)
+   noutputs++;
+   break;
case 'r':
rflag = 1;
break;
@@ -779,7 +785,7 @@ usage(void)
 "   [-M core] [-N system]",
 "   netstat -i | -I interface [-abdhnW] [-f address_family]\n"
 "   [-M core] [-N system]",
-"   netstat -w wait [-I interface] [-d] [-M core] [-N system]",
+"   netstat -w wait [-I interface] [-d] [-M core] [-N system] [-q 
howmany]",
 "   netstat -s [-s] [-z] [-f protocol_family | -p protocol]\n"
 "   [-M core] [-N system]",
 "   netstat -i | -I interface -s [-f protocol_family | -p protocol]\n"

Modified: head/usr.bin/netstat/netstat.1
==
--- head/usr.bin/netstat/netstat.1  Mon Jan 11 02:31:00 2010
(r202059)
+++ head/usr.bin/netstat/netstat.1  Mon Jan 11 03:00:17 2010
(r202060)
@@ -32,7 +32,7 @@
 .\"@(#)netstat.1   8.8 (Berkeley) 4/18/94
 .\" $FreeBSD$
 .\"
-.Dd July 9, 2009
+.Dd January 10, 2010
 .Dt NETSTAT 1
 .Os
 .Sh NAME
@@ -133,6 +133,7 @@ is also present, print interface names u
 .Op Fl d
 .Op Fl M Ar core
 .Op Fl N Ar system
+.Op Fl q Ar howmany
 .Ek
 .Xc
 At intervals of
@@ -143,6 +144,11 @@ traffic on all configured network interf
 or a single
 .Ar interface .
 If
+.Fl q
+is also present, exit after
+.Ar howmany
+outputs.
+If
 .Fl d
 is also present, show the number of dropped packets.
 .It Xo

Modified: head/usr.bin/netstat/netstat.h
==
--- head/usr.bin/netstat/netstat.h  Mon Jan 11 02:31:00 2010
(r202059)
+++ head/usr.bin/netstat/netstat.h  Mon Jan 11 03:00:17 2010
(r202060)
@@ -45,6 +45,7 @@ extern inthflag;  /* show counters in hu
 extern int iflag;  /* show interfaces */
 extern int Lflag;  /* show size of listen queues */
 extern int mflag;  /* show memory stats */
+extern int noutputs;   /* how much outputs before we exit */
 extern int numeric_addr;   /* show addresses numerically */
 extern int numeric_port;   /* show ports numerically */
 extern int rflag;  /* show routing tables (or routing stats) */
___
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: r202059 - in stable/8: cddl/contrib/opensolaris/cmd/zpool sys/cddl/boot/zfs sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/open

2010-01-10 Thread Xin LI
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 2010/01/10 18:31, Xin LI wrote:
> Author: delphij
> Date: Mon Jan 11 02:31:00 2010
> New Revision: 202059
> URL: http://svn.freebsd.org/changeset/base/202059
> 
> Log:
>   MFC r201143:
>   
>   Apply OpenSolaris revision 8021:b8fe9660eb2d which brings our zpool
>   to version 14, making it possible for zpools created on OpenSolaris
>   2009.06 be used on FreeBSD.

Oh my...  This should be 8053:271f44d3de11.

Cheers,
- -- 
Xin LI http://www.delphij.net/
FreeBSD - The Power to Serve!  Live free or die
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.14 (FreeBSD)

iQEcBAEBAgAGBQJLSpT/AAoJEATO+BI/yjfBUEYH/0RbeYvoAaJJCWj9tDQjGsFf
BNnZVkYTF9D2FjdUvSMF5xTGjVP1P9Tu9jfHjZUAw0LlVv03u7FtPEhuS1lPTQzz
y82MpsqfJnzgGlqivP5BHOOcVMSzRR2vRxq3Ay4dHl5XGxq7pNK9w+49roTTjGeB
fA6Gyhp6QGpDl/lnpydb+0oXL0ojEQcCfUgHQEAwGW3iW72igB3yhVw3PTzdRur4
11ifeu4C89WPVvSQhqw1AdQEmnZSuQ0LdF+5qBi7piKMmkU2I9szTqFgyUpBoT54
do8LkIvvHwSfclLaUusa8QdnHSFqB2lLzT4uzbMQQ4EKvXbanflR28XPeOw+TRg=
=p+ve
-END PGP SIGNATURE-
___
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: r201999 - head/lib/libc/stdio

2010-01-10 Thread Bruce Evans

On Sun, 10 Jan 2010, Colin Percival wrote:


Andrey Chernov wrote:

On Sun, Jan 10, 2010 at 02:30:30PM +, Colin Percival wrote:

...

2) fp->_flags |= __SERR;
This flag is for errors in the file stream, not for errors in
the arguments. Please back that line out.


I agree.


Quoting fread(3):
The function fread() does not distinguish between end-of-file and error,
and callers must use feof(3) and ferror(3) to determine which occurred.
This would seem to imply that for any failed request, either feof or ferror
should return a non-zero value.  Removing this line would break the common


It would seem to mean a physical i/o error.


while (fread(ptr, reclen, 1, f) == 1) {
/* Do stuff here. */
}
if (ferror(f)) {
/* Die due to read error */
}
/* No error?  Ok, we must have hit EOF */
idiom.


Hmm.  This case doesn't overflow (reclen * 1 == reclen :-).  fread()
could be finessed by returning a short read (of 1 with no error) for
the silly case.  Then only buggy code that doesn't understand short
reads would fail.

fwrite() hopefully knows that any write of 0 records is an error.

But how about the folling from C99 (old draft n869.txt):

%%%
   [#3] The fwrite function  returns  the  number  of  elements
   successfully  written, which will be less than nmemb only if
   a write error is encountered.
%%%

This doesn't allow any error if there was no write error, and again a
write error would seem to mean a physical one (if it meant any error
it would have said "a fwrite error").  This is unimplementable (except
by not returning when nmemb is more than possible).


3) errno should be EOVERFLOW, see other owerflow checks in the stdio.


There are none.  I (we?) intentionally didn't set errno when the correct
infinite-precision result would overflow in the printf family.  C99
applications wouldn't know to check errno, and buggy ones might be
surprised by unexpected (though permitted) clobbering of errno.  POSIX
didn't have EOVERFLOW when printf was fixed in FreeBSD, and no one has
changed printf to set it, and this change risks breaking C99 applications.


I picked EINVAL because this is the code used by read(2) and write(2) if they
are passed nbytes > INT_MAX.  It would seem odd to use one error code for a
number of bytes between INT_MAX and SIZE_MAX and then switch to a different
error code for > SIZE_MAX bytes.


A bug in FreeBSD read and write (the result is implementation defined,
but this misbehaviour isn't a result, so it probably isn't allowed when
SSIZE_T == INT_MAX, and it certainly isn't defined when SSIZE_T > INT_MAX
(64-bit arches).

calloc() has the same overflow bug, if any.  Standards seem to require
fread and calloc to work even if the multiplication would occur, though
they cannot work in most cases where the multiplication would occur,
even if the overflow is avoided.  Hmm, fread and fwrite can work, though
calloc cannot:
- fread: when the multiplication would overflow, reduce nmemb to the
 maximum that prevents overflow.  Any more would give an invalid
 object size.  Let the read proceed.  If the file is smaller
 than the actual object size, then the fread will work, the same
 as if nmemb was reasonable to begin with.  Otherwise, undefined
 behaviour occurs when the buffer overruns, the same as if
 nmemb is just 1 too large to begin with.  There is no reason
 to guard against overrun for the silly case when it is impossible
 to guard against overrun for a common off-by-1 case.
- fwrite: when the multiplication would overflow, the result of an
 infinitely precise multiplication is an invalid object size.
 Writing that many is sure to overrun the buffer.  The behaviour
 is undefined.  Reasonable behaviour is an i/o error with EFAULT,
 just like would happen for attempting to write beyond the end
 of the buffer, if you are lucky enough for the overrun to reach
 a page boundary and the next page is unmapped.  You might also
 get SIGSEGV if the buffer is accessed in userland.
- calloc: like fwrite.  The object size is invalid so the behaviour is
 undefined.  Could EFAULT/SIGSEGV or just return NULL.

I sent private mail about parts of this and more.

Bruce
___
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: r202061 - head/sys/dev/cfe

2010-01-10 Thread Warner Losh
Author: imp
Date: Mon Jan 11 03:43:18 2010
New Revision: 202061
URL: http://svn.freebsd.org/changeset/base/202061

Log:
  Merge from projects/mips to head by hand:
  
  copy over cfe_env.c...

Added:
 - copied unchanged from r202060, projects/mips/sys/dev/cfe/cfe_env.c
Directory Properties:
  head/sys/dev/cfe/cfe_env.c   (props changed)

Copied: head/sys/dev/cfe/cfe_env.c (from r202060, 
projects/mips/sys/dev/cfe/cfe_env.c)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/cfe/cfe_env.c  Mon Jan 11 03:43:18 2010(r202061, copy 
of r202060, projects/mips/sys/dev/cfe/cfe_env.c)
@@ -0,0 +1,74 @@
+/*-
+ * Copyright (c) 2009 Neelkanth Natu
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+#include 
+#include 
+
+#include 
+
+__FBSDID("$FreeBSD$");
+
+#ifndefCFE_ENV_SIZE
+#defineCFE_ENV_SIZEPAGE_SIZE   /* default is one page */
+#endif
+
+extern void cfe_env_init(void);
+
+static char cfe_env_buf[CFE_ENV_SIZE];
+
+void
+cfe_env_init(void)
+{
+   int idx, len;
+   char name[64], val[128], *cp, *cplim;
+
+   cp = cfe_env_buf;
+   cplim = cp + CFE_ENV_SIZE;
+
+   idx = 0;
+   while (1) {
+   if (cfe_enumenv(idx, name, sizeof(name), val, sizeof(val)) != 0)
+   break;
+
+   if (bootverbose)
+   printf("Importing CFE env: \"%s=%s\"\n", name, val);
+
+   /*
+* name=val\0\0
+*/
+   len = strlen(name) + 1 + strlen(val) + 1 + 1;
+   if (cplim - cp < len)
+   printf("No space to store CFE env: \"%s=%s\"\n",
+   name, val);
+   else
+   cp += sprintf(cp, "%s=%s", name, val) + 1;
+   ++idx;
+   }
+   *cp++ = '\0';
+
+   kern_envp = cfe_env_buf;
+}
___
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: r202019 - in head/sys: amd64/conf i386/conf ia64/conf pc98/conf powerpc/conf sparc64/conf sun4v/conf

2010-01-10 Thread Doug Barton

On Sun, 10 Jan 2010, Warner Losh wrote:


Author: imp
Date: Sun Jan 10 17:44:22 2010
New Revision: 202019
URL: http://svn.freebsd.org/changeset/base/202019

Log:
 Add INCLUDE_CONFIG_FILE in GENERIC on all non-embedded platforms.


Thanks for doing this, however the comment about how to include the whole 
file (including the comments) were not included. Do I need to do this part 
of it myself? No problem if so, I just want to be sure to get it done in 
time to MFC it before the freeze for 7.3-release.



Doug
___
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: r202019 - in head/sys: amd64/conf i386/conf ia64/conf pc98/conf powerpc/conf sparc64/conf sun4v/conf

2010-01-10 Thread M. Warner Losh
In message: 
Doug Barton  writes:
: On Sun, 10 Jan 2010, Warner Losh wrote:
: 
: > Author: imp
: > Date: Sun Jan 10 17:44:22 2010
: > New Revision: 202019
: > URL: http://svn.freebsd.org/changeset/base/202019
: >
: > Log:
: >  Add INCLUDE_CONFIG_FILE in GENERIC on all non-embedded platforms.
: 
: Thanks for doing this, however the comment about how to include the
: whole file (including the comments) were not included. Do I need to do
: this part of it myself? No problem if so, I just want to be sure to
: get it done in time to MFC it before the freeze for 7.3-release.

In general, we don't put big comments like that in the config files,
preferring to leave them to NOTES.  I was just following that
convention...

Warner
___
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: r202062 - head/sys/dev/ic

2010-01-10 Thread Warner Losh
Author: imp
Date: Mon Jan 11 04:13:06 2010
New Revision: 202062
URL: http://svn.freebsd.org/changeset/base/202062

Log:
  Merge from projects/mips to head by hand:
  
  Defintions for cavium uart (do they belong here?)

Modified:
  head/sys/dev/ic/ns16550.h

Modified: head/sys/dev/ic/ns16550.h
==
--- head/sys/dev/ic/ns16550.h   Mon Jan 11 03:43:18 2010(r202061)
+++ head/sys/dev/ic/ns16550.h   Mon Jan 11 04:13:06 2010(r202062)
@@ -52,6 +52,7 @@
 #defineREG_IIR com_iir
 #defineIIR_IMASK   0xf
 #defineIIR_RXTOUT  0xc
+#defineIIR_BUSY0x7
 #defineIIR_RLS 0x6
 #defineIIR_RXRDY   0x4
 #defineIIR_TXRDY   0x2
@@ -181,6 +182,10 @@
 #definecom_xoff1   6   /* XOFF 1 character (R/W) */
 #definecom_xoff2   7   /* XOFF 2 character (R/W) */
 
+#define com_usr39  /* Octeon 16750/16550 Uart Status Reg */
+#define REG_USRcom_usr
+#define USR_TXFIFO_NOTFULL 2/* Uart TX FIFO Not full */
+
 /* 16950 register #1.  Access enabled by ACR[7].  Also requires !LCR[7]. */
 #definecom_asr 1   /* additional status register 
(R[0-7]/W[0-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: r202063 - in head/sys/mips/cavium: . dev/rgmii

2010-01-10 Thread Warner Losh
Author: imp
Date: Mon Jan 11 04:29:26 2010
New Revision: 202063
URL: http://svn.freebsd.org/changeset/base/202063

Log:
  Cope with the move and if_timer going way.

Modified:
  head/sys/mips/cavium/dev/rgmii/octeon_fau.c
  head/sys/mips/cavium/dev/rgmii/octeon_fpa.c
  head/sys/mips/cavium/dev/rgmii/octeon_ipd.c
  head/sys/mips/cavium/dev/rgmii/octeon_pko.c
  head/sys/mips/cavium/dev/rgmii/octeon_rgmx.c
  head/sys/mips/cavium/files.octeon1   (contents, props changed)
  head/sys/mips/cavium/obio.c
  head/sys/mips/cavium/octeon_ebt3000_cf.c
  head/sys/mips/cavium/octeon_machdep.c
  head/sys/mips/cavium/std.octeon1   (contents, props changed)
  head/sys/mips/cavium/uart_bus_octeonusart.c
  head/sys/mips/cavium/uart_cpu_octeonusart.c
  head/sys/mips/cavium/uart_dev_oct16550.c

Modified: head/sys/mips/cavium/dev/rgmii/octeon_fau.c
==
--- head/sys/mips/cavium/dev/rgmii/octeon_fau.c Mon Jan 11 04:13:06 2010
(r202062)
+++ head/sys/mips/cavium/dev/rgmii/octeon_fau.c Mon Jan 11 04:29:26 2010
(r202063)
@@ -4,10 +4,13 @@
  *--
  */
 
+#include 
+__FBSDID("$FreeBSD$");
+
 #include 
 #include 
 
-#include 
+#include 
 #include "octeon_fau.h"
 
 /*

Modified: head/sys/mips/cavium/dev/rgmii/octeon_fpa.c
==
--- head/sys/mips/cavium/dev/rgmii/octeon_fpa.c Mon Jan 11 04:13:06 2010
(r202062)
+++ head/sys/mips/cavium/dev/rgmii/octeon_fpa.c Mon Jan 11 04:29:26 2010
(r202063)
@@ -4,6 +4,9 @@
  *--
  */
 
+#include 
+__FBSDID("$FreeBSD$");
+
 #include 
 #include 
 #include 
@@ -11,7 +14,7 @@
 #include 
 
 
-#include 
+#include 
 #include "octeon_fpa.h"
 
 

Modified: head/sys/mips/cavium/dev/rgmii/octeon_ipd.c
==
--- head/sys/mips/cavium/dev/rgmii/octeon_ipd.c Mon Jan 11 04:13:06 2010
(r202062)
+++ head/sys/mips/cavium/dev/rgmii/octeon_ipd.c Mon Jan 11 04:29:26 2010
(r202063)
@@ -4,10 +4,13 @@
  *--
  */
 
+#include 
+__FBSDID("$FreeBSD$");
+
 #include 
 #include 
 
-#include 
+#include 
 #include "octeon_ipd.h"
 
 /*

Modified: head/sys/mips/cavium/dev/rgmii/octeon_pko.c
==
--- head/sys/mips/cavium/dev/rgmii/octeon_pko.c Mon Jan 11 04:13:06 2010
(r202062)
+++ head/sys/mips/cavium/dev/rgmii/octeon_pko.c Mon Jan 11 04:29:26 2010
(r202063)
@@ -4,12 +4,15 @@
  *--
  */
 
+#include 
+__FBSDID("$FreeBSD$");
+
 #include 
 #include 
 #include 
 #include 
 
-#include 
+#include 
 #include "octeon_fau.h"
 #include "octeon_fpa.h"
 #include "octeon_pko.h"

Modified: head/sys/mips/cavium/dev/rgmii/octeon_rgmx.c
==
--- head/sys/mips/cavium/dev/rgmii/octeon_rgmx.cMon Jan 11 04:13:06 
2010(r202062)
+++ head/sys/mips/cavium/dev/rgmii/octeon_rgmx.cMon Jan 11 04:29:26 
2010(r202063)
@@ -48,7 +48,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 
+#include 
 
 #include "octeon_fau.h"
 #include "octeon_fpa.h"
@@ -1058,7 +1058,6 @@ static void octeon_rgmx_xmit_mark_buffer
  * Reset output active flag and watchdog timer.
  */
 sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
-sc->ifp->if_timer = 0;
 }
 
 
@@ -1574,7 +1573,6 @@ static void octeon_rgmx_stop (struct rgm
 
 /* Reset transmitter variables and interface flags.  */
 sc->ifp->if_drv_flags &= ~(IFF_DRV_OACTIVE | IFF_DRV_RUNNING);
-sc->ifp->if_timer = 0;
 sc->txb_count = 0;
 sc->txb_sched = 0;
 }

Modified: head/sys/mips/cavium/files.octeon1
==
--- head/sys/mips/cavium/files.octeon1  Mon Jan 11 04:13:06 2010
(r202062)
+++ head/sys/mips/cavium/files.octeon1  Mon Jan 11 04:29:26 2010
(r202063)
@@ -2,16 +2,16 @@
 # Octeon Support Files
 #
 mips/mips/mp_machdep.c optional smp
-mips/octeon1/dev/rgmii/octeon_fau.coptional rgmii
-mips/octeon1/dev/rgmii/octeon_fpa.coptional rgmii
-mips/octeon1/dev/rgmii/octeon_ipd.coptional rgmii
-mips/octeon1/dev/rgmii/octeon_pko.coptional rgmii
-mips/octeon1/dev/rgmii/octeon_rgmx.c   optional rgmii
-mips/octeon1/obio.coptional uart
-mips/octeon1/octeon_ebt3000_cf.c   optional cf
-mips/octeon1/octeon_machdep.c  standard
-mips/octeon1/uart_bus_octeonusart.coptional uart
-mips/octeon1/uart_cpu_octeonusart.coptional uart
-mips/oc

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

2010-01-10 Thread Warner Losh
Author: imp
Date: Mon Jan 11 04:38:37 2010
New Revision: 202064
URL: http://svn.freebsd.org/changeset/base/202064

Log:
  Cope with the octeon1->cavium move.  Note: none of this junk belongs here.

Modified:
  head/sys/mips/mips/bus_space_generic.c   (contents, props changed)

Modified: head/sys/mips/mips/bus_space_generic.c
==
--- head/sys/mips/mips/bus_space_generic.c  Mon Jan 11 04:29:26 2010
(r202063)
+++ head/sys/mips/mips/bus_space_generic.c  Mon Jan 11 04:38:37 2010
(r202064)
@@ -199,7 +199,7 @@ static struct bus_space generic_space = 
 /* Ultra-gross kludge */
 #include "opt_cputype.h"
 #if defined(TARGET_OCTEON) && defined(ISA_MIPS32)
-#include 
+#include 
 #define rd8(a) oct_read8(a)
 #define rd16(a) oct_read16(a)
 #define rd32(a) oct_read32(a)
___
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: r202065 - head/sys/mips/conf

2010-01-10 Thread Warner Losh
Author: imp
Date: Mon Jan 11 04:40:38 2010
New Revision: 202065
URL: http://svn.freebsd.org/changeset/base/202065

Log:
  Cope with the octeon1->cavium move.

Modified:
  head/sys/mips/conf/OCTEON1   (contents, props changed)
  head/sys/mips/conf/OCTEON1-32   (contents, props changed)
Directory Properties:
  head/sys/mips/conf/OCTEON1.hints   (props changed)

Modified: head/sys/mips/conf/OCTEON1
==
--- head/sys/mips/conf/OCTEON1  Mon Jan 11 04:38:37 2010(r202064)
+++ head/sys/mips/conf/OCTEON1  Mon Jan 11 04:40:38 2010(r202065)
@@ -31,7 +31,7 @@ makeoptions TARGET_64BIT=defined
 makeoptionsKERNLOADADDR=0x8010
 
 optionsKERNVIRTADDR=0x8010
-include"../octeon1/std.octeon1"
+include"../cavium/std.octeon1"
 
 hints  "OCTEON1.hints" #Default places to look for devices.
 

Modified: head/sys/mips/conf/OCTEON1-32
==
--- head/sys/mips/conf/OCTEON1-32   Mon Jan 11 04:38:37 2010
(r202064)
+++ head/sys/mips/conf/OCTEON1-32   Mon Jan 11 04:40:38 2010
(r202065)
@@ -32,7 +32,7 @@ makeoptions LDSCRIPT_NAME=ldscript.m
 
 optionsKERNVIRTADDR=0x8010
 makeoptionsKERNLOADADDR=0x8010
-include"../octeon1/std.octeon1"
+include"../cavium/std.octeon1"
 
 hints  "OCTEON1.hints" #Default places to look for devices.
 
___
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: r202066 - in head/sys/mips/rmi: . dev/sec dev/xlr

2010-01-10 Thread Warner Losh
Author: imp
Date: Mon Jan 11 04:49:44 2010
New Revision: 202066
URL: http://svn.freebsd.org/changeset/base/202066

Log:
  Attempt to cope with the dev/rmi -> mips/rmi/dev move.

Modified:
  head/sys/mips/rmi/dev/sec/rmilib.c   (contents, props changed)
  head/sys/mips/rmi/dev/sec/rmilib.h   (contents, props changed)
  head/sys/mips/rmi/dev/sec/rmisec.c   (contents, props changed)
  head/sys/mips/rmi/dev/xlr/rge.c   (contents, props changed)
  head/sys/mips/rmi/files.xlr   (contents, props changed)
  head/sys/mips/rmi/iodi.c   (contents, props changed)
Directory Properties:
  head/sys/mips/rmi/Makefile.msgring   (props changed)
  head/sys/mips/rmi/board.c   (props changed)
  head/sys/mips/rmi/board.h   (props changed)
  head/sys/mips/rmi/bus_space_rmi.c   (props changed)
  head/sys/mips/rmi/clock.c   (props changed)
  head/sys/mips/rmi/clock.h   (props changed)
  head/sys/mips/rmi/debug.h   (props changed)
  head/sys/mips/rmi/dev/sec/desc.h   (props changed)
  head/sys/mips/rmi/dev/sec/stats.h   (props changed)
  head/sys/mips/rmi/dev/xlr/atx_cpld.h   (props changed)
  head/sys/mips/rmi/dev/xlr/rge.h   (props changed)
  head/sys/mips/rmi/dev/xlr/xgmac_mdio.h   (props changed)

Modified: head/sys/mips/rmi/dev/sec/rmilib.c
==
--- head/sys/mips/rmi/dev/sec/rmilib.c  Mon Jan 11 04:40:38 2010
(r202065)
+++ head/sys/mips/rmi/dev/sec/rmilib.c  Mon Jan 11 04:49:44 2010
(r202066)
@@ -26,9 +26,11 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * RMI_BSD */
+ * RMI_BSD
+ */
 
 #include 
+__FBSDID("$FreeBSD$");
 
 #include 
 #include 
@@ -54,8 +56,8 @@
 #include 
 #include 
 #include 
-#include 
-#include 
+#include 
+#include 
 
 
 // static int msgrng_stnid_pk0 = MSGRNG_STNID_PK0;

Modified: head/sys/mips/rmi/dev/sec/rmilib.h
==
--- head/sys/mips/rmi/dev/sec/rmilib.h  Mon Jan 11 04:40:38 2010
(r202065)
+++ head/sys/mips/rmi/dev/sec/rmilib.h  Mon Jan 11 04:49:44 2010
(r202066)
@@ -26,12 +26,16 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * RMI_BSD */
+ * RMI_BSD
+ */
 
 #ifndef _RMILIB_H_
 #define _RMILIB_H_
 
-#include 
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
 #include 
 
 /*#define XLR_SEC_CMD_DEBUG*/

Modified: head/sys/mips/rmi/dev/sec/rmisec.c
==
--- head/sys/mips/rmi/dev/sec/rmisec.c  Mon Jan 11 04:40:38 2010
(r202065)
+++ head/sys/mips/rmi/dev/sec/rmisec.c  Mon Jan 11 04:49:44 2010
(r202066)
@@ -26,8 +26,11 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * RMI_BSD */
+ * RMI_BSD
+ */
 
+#include 
+__FBSDID("$FreeBSD$");
 
 #include 
 #include 
@@ -52,7 +55,7 @@
 #include 
 #include 
 
-#include 
+#include 
 
 /*#define RMI_SEC_DEBUG */
 

Modified: head/sys/mips/rmi/dev/xlr/rge.c
==
--- head/sys/mips/rmi/dev/xlr/rge.c Mon Jan 11 04:40:38 2010
(r202065)
+++ head/sys/mips/rmi/dev/xlr/rge.c Mon Jan 11 04:49:44 2010
(r202066)
@@ -26,7 +26,11 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * RMI_BSD */
+ * RMI_BSD
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
 
 #ifdef HAVE_KERNEL_OPTION_HEADERS
 #include "opt_device_polling.h"
@@ -90,10 +94,8 @@
 #include 
 #include 
 
-#include 
-#include 
-
-
+#include 
+#include 
 
 #include 
 #include 

Modified: head/sys/mips/rmi/files.xlr
==
--- head/sys/mips/rmi/files.xlr Mon Jan 11 04:40:38 2010(r202065)
+++ head/sys/mips/rmi/files.xlr Mon Jan 11 04:49:44 2010(r202066)
@@ -17,10 +17,10 @@ mips/rmi/perfmon_percpu.c   optional xlr
 #mips/rmi/pcibus.c optional pci
 #mips/rmi/xlr_pci.coptional pci
 #mips/rmi/xls_ehci.c   optional usb ehci
-dev/rmi/xlr/rge.c  optional rge
 mips/rmi/bus_space_rmi.c   standard
+mips/rmi/dev/sec/rmisec.c  optional rmisec
+mips/rmi/dev/sec/rmilib.c  optional rmisec
+mips/rmi/dev/xlr/rge.c optional rge
 dev/iicbus/xlr_rtc.c   optional xlr_rtc
 dev/iicbus/xlr_temperature.c   optional xlr_temperature
 dev/iicbus/xlr_eeprom.coptional xlr_eeprom
-dev/rmi/sec/rmisec.c   optional rmisec
-dev/rmi/sec/rmilib.c   optional rmisec

Modified: head/sys/mips/rmi/iodi.c
==
--- head/sys/mips/rmi/

svn commit: r202068 - in stable/8/share/man: man7 man9

2010-01-10 Thread Christian Brueffer
Author: brueffer
Date: Mon Jan 11 05:19:51 2010
New Revision: 202068
URL: http://svn.freebsd.org/changeset/base/202068

Log:
  MFC: r201538, r201539
  
  Catch up with the VFS_VPTOFH(9) -> VOP_VPTOFH(9) repocopy that happened
  almost three years ago in r166794.
  
  Add a missing word.

Modified:
  stable/8/share/man/man7/security.7
  stable/8/share/man/man9/VFS.9
  stable/8/share/man/man9/VFS_CHECKEXP.9
  stable/8/share/man/man9/VFS_FHTOVP.9
Directory Properties:
  stable/8/share/man/man7/   (props changed)
  stable/8/share/man/man9/   (props changed)

Modified: stable/8/share/man/man7/security.7
==
--- stable/8/share/man/man7/security.7  Mon Jan 11 05:05:28 2010
(r202067)
+++ stable/8/share/man/man7/security.7  Mon Jan 11 05:19:51 2010
(r202068)
@@ -88,7 +88,7 @@ incur on the system under adverse condit
 Brute-force network attacks are harder to deal with.
 A spoofed-packet attack, for example, is
 nearly impossible to stop short of cutting your system off from the Internet.
-It may not be able to take your machine down, but it can fill up Internet
+It may not be able to take your machine down, but it can fill up your Internet
 pipe.
 .Pp
 A user account compromise is even more common than a DoS attack.

Modified: stable/8/share/man/man9/VFS.9
==
--- stable/8/share/man/man9/VFS.9   Mon Jan 11 05:05:28 2010
(r202067)
+++ stable/8/share/man/man9/VFS.9   Mon Jan 11 05:19:51 2010
(r202068)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 24, 1996
+.Dd January 4, 2010
 .Os
 .Dt VFS 9
 .Sh NAME
@@ -53,7 +53,7 @@ rather than implementing empty functions
 .Xr VFS_SYNC 9 ,
 .Xr VFS_UNMOUNT 9 ,
 .Xr VFS_VGET 9 ,
-.Xr VFS_VPTOFH 9 ,
+.Xr VOP_VPTOFH 9 ,
 .Xr vnode 9
 .Sh AUTHORS
 This manual page was written by

Modified: stable/8/share/man/man9/VFS_CHECKEXP.9
==
--- stable/8/share/man/man9/VFS_CHECKEXP.9  Mon Jan 11 05:05:28 2010
(r202067)
+++ stable/8/share/man/man9/VFS_CHECKEXP.9  Mon Jan 11 05:19:51 2010
(r202068)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 7, 2005
+.Dd January 4, 2010
 .Os
 .Dt VFS_CHECKEXP 9
 .Sh NAME
@@ -81,7 +81,7 @@ and
 .Sh SEE ALSO
 .Xr VFS 9 ,
 .Xr VFS_FHTOVP 9 ,
-.Xr VFS_VPTOFH 9 ,
+.Xr VOP_VPTOFH 9 ,
 .Xr vnode 9
 .Sh AUTHORS
 This manual page was written by

Modified: stable/8/share/man/man9/VFS_FHTOVP.9
==
--- stable/8/share/man/man9/VFS_FHTOVP.9Mon Jan 11 05:05:28 2010
(r202067)
+++ stable/8/share/man/man9/VFS_FHTOVP.9Mon Jan 11 05:19:51 2010
(r202068)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 7, 2005
+.Dd January 4, 2010
 .Os
 .Dt VFS_FHTOVP 9
 .Sh NAME
@@ -76,7 +76,7 @@ The locked vnode for the file will be re
 .Sh SEE ALSO
 .Xr VFS 9 ,
 .Xr VFS_CHECKEXP 9 ,
-.Xr VFS_VPTOFH 9 ,
+.Xr VOP_VPTOFH 9 ,
 .Xr vnode 9
 .Sh AUTHORS
 This manual page was written by
___
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: r202069 - in stable/7/share/man: man7 man9

2010-01-10 Thread Christian Brueffer
Author: brueffer
Date: Mon Jan 11 05:26:18 2010
New Revision: 202069
URL: http://svn.freebsd.org/changeset/base/202069

Log:
  MFC: r201538, r201539
  
  Catch up with the VFS_VPTOFH(9) -> VOP_VPTOFH(9) repocopy that happened
  almost three years ago in r166794.
  
  Add a missing word.

Modified:
  stable/7/share/man/man7/security.7
  stable/7/share/man/man9/VFS.9
  stable/7/share/man/man9/VFS_CHECKEXP.9
  stable/7/share/man/man9/VFS_FHTOVP.9
Directory Properties:
  stable/7/share/man/man7/   (props changed)
  stable/7/share/man/man9/   (props changed)

Modified: stable/7/share/man/man7/security.7
==
--- stable/7/share/man/man7/security.7  Mon Jan 11 05:19:51 2010
(r202068)
+++ stable/7/share/man/man7/security.7  Mon Jan 11 05:26:18 2010
(r202069)
@@ -88,7 +88,7 @@ incur on the system under adverse condit
 Brute-force network attacks are harder to deal with.
 A spoofed-packet attack, for example, is
 nearly impossible to stop short of cutting your system off from the Internet.
-It may not be able to take your machine down, but it can fill up Internet
+It may not be able to take your machine down, but it can fill up your Internet
 pipe.
 .Pp
 A user account compromise is even more common than a DoS attack.

Modified: stable/7/share/man/man9/VFS.9
==
--- stable/7/share/man/man9/VFS.9   Mon Jan 11 05:19:51 2010
(r202068)
+++ stable/7/share/man/man9/VFS.9   Mon Jan 11 05:26:18 2010
(r202069)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 24, 1996
+.Dd January 4, 2010
 .Os
 .Dt VFS 9
 .Sh NAME
@@ -53,7 +53,7 @@ rather than implementing empty functions
 .Xr VFS_SYNC 9 ,
 .Xr VFS_UNMOUNT 9 ,
 .Xr VFS_VGET 9 ,
-.Xr VFS_VPTOFH 9 ,
+.Xr VOP_VPTOFH 9 ,
 .Xr vnode 9
 .Sh AUTHORS
 This manual page was written by

Modified: stable/7/share/man/man9/VFS_CHECKEXP.9
==
--- stable/7/share/man/man9/VFS_CHECKEXP.9  Mon Jan 11 05:19:51 2010
(r202068)
+++ stable/7/share/man/man9/VFS_CHECKEXP.9  Mon Jan 11 05:26:18 2010
(r202069)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 7, 2005
+.Dd January 4, 2010
 .Os
 .Dt VFS_CHECKEXP 9
 .Sh NAME
@@ -81,7 +81,7 @@ and
 .Sh SEE ALSO
 .Xr VFS 9 ,
 .Xr VFS_FHTOVP 9 ,
-.Xr VFS_VPTOFH 9 ,
+.Xr VOP_VPTOFH 9 ,
 .Xr vnode 9
 .Sh AUTHORS
 This manual page was written by

Modified: stable/7/share/man/man9/VFS_FHTOVP.9
==
--- stable/7/share/man/man9/VFS_FHTOVP.9Mon Jan 11 05:19:51 2010
(r202068)
+++ stable/7/share/man/man9/VFS_FHTOVP.9Mon Jan 11 05:26:18 2010
(r202069)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 7, 2005
+.Dd January 4, 2010
 .Os
 .Dt VFS_FHTOVP 9
 .Sh NAME
@@ -76,7 +76,7 @@ The locked vnode for the file will be re
 .Sh SEE ALSO
 .Xr VFS 9 ,
 .Xr VFS_CHECKEXP 9 ,
-.Xr VFS_VPTOFH 9 ,
+.Xr VOP_VPTOFH 9 ,
 .Xr vnode 9
 .Sh AUTHORS
 This manual page was written by
___
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"