svn commit: r254512 - head/sys/dev/sdhci

2013-08-18 Thread Rui Paulo
Author: rpaulo
Date: Mon Aug 19 05:48:42 2013
New Revision: 254512
URL: http://svnweb.freebsd.org/changeset/base/254512

Log:
  Style changes and typos fixed.

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

Modified: head/sys/dev/sdhci/sdhci.c
==
--- head/sys/dev/sdhci/sdhci.c  Mon Aug 19 05:37:49 2013(r254511)
+++ head/sys/dev/sdhci/sdhci.c  Mon Aug 19 05:48:42 2013(r254512)
@@ -350,7 +350,7 @@ sdhci_read_block_pio(struct sdhci_slot *
/* If we are too fast, broken controllers return zeroes. */
if (slot->quirks & SDHCI_QUIRK_BROKEN_TIMINGS)
DELAY(10);
-   /* Handle unalligned and alligned buffer cases. */
+   /* Handle unaligned and aligned buffer cases. */
if ((intptr_t)buffer & 3) {
while (left > 3) {
data = RD4(slot, SDHCI_BUFFER);
@@ -390,7 +390,7 @@ sdhci_write_block_pio(struct sdhci_slot 
left = min(512, slot->curcmd->data->len - slot->offset);
slot->offset += left;
 
-   /* Handle unalligned and alligned buffer cases. */
+   /* Handle unaligned and aligned buffer cases. */
if ((intptr_t)buffer & 3) {
while (left > 3) {
data = buffer[0] +
@@ -911,11 +911,14 @@ sdhci_start_data(struct sdhci_slot *slot
/* Load DMA buffer. */
if (slot->flags & SDHCI_USE_DMA) {
if (data->flags & MMC_DATA_READ)
-   bus_dmamap_sync(slot->dmatag, slot->dmamap, 
BUS_DMASYNC_PREREAD);
+   bus_dmamap_sync(slot->dmatag, slot->dmamap, 
+   BUS_DMASYNC_PREREAD);
else {
memcpy(slot->dmamem, data->data,
-   (data->len < 
DMA_BLOCK_SIZE)?data->len:DMA_BLOCK_SIZE);
-   bus_dmamap_sync(slot->dmatag, slot->dmamap, 
BUS_DMASYNC_PREWRITE);
+   (data->len < DMA_BLOCK_SIZE) ? 
+   data->len : DMA_BLOCK_SIZE);
+   bus_dmamap_sync(slot->dmatag, slot->dmamap, 
+   BUS_DMASYNC_PREWRITE);
}
WR4(slot, SDHCI_DMA_ADDRESS, slot->paddr);
/* Interrupt aggregation: Mask border interrupt
@@ -942,7 +945,7 @@ sdhci_finish_data(struct sdhci_slot *slo
 
slot->data_done = 1;
/* Interrupt aggregation: Restore command interrupt.
-* Auxillary restore point for the case when data interrupt
+* Auxiliary restore point for the case when data interrupt
 * happened first. */
if (!slot->cmd_done) {
WR4(slot, SDHCI_SIGNAL_ENABLE,
@@ -952,11 +955,13 @@ sdhci_finish_data(struct sdhci_slot *slo
if (slot->flags & SDHCI_USE_DMA) {
if (data->flags & MMC_DATA_READ) {
size_t left = data->len - slot->offset;
-   bus_dmamap_sync(slot->dmatag, slot->dmamap, 
BUS_DMASYNC_POSTREAD);
+   bus_dmamap_sync(slot->dmatag, slot->dmamap, 
+   BUS_DMASYNC_POSTREAD);
memcpy((u_char*)data->data + slot->offset, slot->dmamem,
(left < DMA_BLOCK_SIZE)?left:DMA_BLOCK_SIZE);
} else
-   bus_dmamap_sync(slot->dmatag, slot->dmamap, 
BUS_DMASYNC_POSTWRITE);
+   bus_dmamap_sync(slot->dmatag, slot->dmamap, 
+   BUS_DMASYNC_POSTWRITE);
}
/* If there was error - reset the host. */
if (slot->curcmd->error) {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254511 - head/etc/rc.d

2013-08-18 Thread Peter Wemm
Author: peter
Date: Mon Aug 19 05:37:49 2013
New Revision: 254511
URL: http://svnweb.freebsd.org/changeset/base/254511

Log:
  Pass pidfile to bsnmpd if it's been changed (parts cut/pasted from
  rc.d/rarpd and rc.d/wpa_supplicant)

Modified:
  head/etc/rc.d/bsnmpd

Modified: head/etc/rc.d/bsnmpd
==
--- head/etc/rc.d/bsnmpdMon Aug 19 05:12:38 2013(r254510)
+++ head/etc/rc.d/bsnmpdMon Aug 19 05:37:49 2013(r254511)
@@ -12,7 +12,8 @@
 name="bsnmpd"
 rcvar="bsnmpd_enable"
 command="/usr/sbin/${name}"
-pidfile="/var/run/snmpd.pid"
 
 load_rc_config $name
+pidfile="${bsnmpd_pidfile:-/var/run/snmpd.pid}"
+command_args="-p ${pidfile}"
 run_rc_command "$1"
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254510 - head/etc/rc.d

2013-08-18 Thread Peter Wemm
Author: peter
Date: Mon Aug 19 05:12:38 2013
New Revision: 254510
URL: http://svnweb.freebsd.org/changeset/base/254510

Log:
  Revert r254508.

Modified:
  head/etc/rc.d/bsnmpd

Modified: head/etc/rc.d/bsnmpd
==
--- head/etc/rc.d/bsnmpdMon Aug 19 05:10:46 2013(r254509)
+++ head/etc/rc.d/bsnmpdMon Aug 19 05:12:38 2013(r254510)
@@ -12,17 +12,7 @@
 name="bsnmpd"
 rcvar="bsnmpd_enable"
 command="/usr/sbin/${name}"
-start_cmd="bsnmpd_start"
-
-bsnmpd_start()
-{
-   rc_flags="-p ${pidfile} ${bsnmpd_flags}"
-   echo -n "Starting bsnmpd"
-   su -m $user -c "$command ${rc_flags}"
-   echo "."
-}
+pidfile="/var/run/snmpd.pid"
 
 load_rc_config $name
-user="${bsnmpd_username:-root}"
-pidfile="${bsnmpd_pidfile:-/var/run/snmpd.pid}"
 run_rc_command "$1"
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254509 - in head/sys: cddl/dev/dtrace/powerpc modules/dtrace

2013-08-18 Thread Justin Hibbits
Author: jhibbits
Date: Mon Aug 19 05:10:46 2013
New Revision: 254509
URL: http://svnweb.freebsd.org/changeset/base/254509

Log:
  Fix some ppc64 dtrace bugs, and enable systrace_freebsd32 for ppc64.

Modified:
  head/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S
  head/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c
  head/sys/modules/dtrace/Makefile

Modified: head/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S
==
--- head/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S   Mon Aug 19 04:56:03 
2013(r254508)
+++ head/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S   Mon Aug 19 05:10:46 
2013(r254509)
@@ -50,6 +50,7 @@
 void dtrace_membar_producer(void)
 */
 ASENTRY_NOPROF(dtrace_membar_producer)
+   sync
blr
 END(dtrace_membar_producer)
 
@@ -57,6 +58,7 @@ END(dtrace_membar_producer)
 void dtrace_membar_consumer(void)
 */
 ASENTRY_NOPROF(dtrace_membar_consumer)
+   isync
blr
 END(dtrace_membar_consumer)
 
@@ -97,12 +99,21 @@ void *
 dtrace_casptr(void *target, void *cmp, void *new)
 */
 ASENTRY_NOPROF(dtrace_casptr)
+#ifdef __powerpc64__
+1:
+   ldarx   %r0,0,%r3
+   cmpd%r4,%r0
+   bne 2f
+   stdcx.  %r5,0,%r3
+   bne 1b
+#else
 1:
lwarx   %r0,0,%r3
cmpw%r4,%r0
bne 2f
stwcx.  %r5,0,%r3
bne 1b
+#endif
 2: mr  %r3,%r0
blr
 END(dtrace_casptr)

Modified: head/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c
==
--- head/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c   Mon Aug 19 04:56:03 
2013(r254508)
+++ head/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c   Mon Aug 19 05:10:46 
2013(r254509)
@@ -80,7 +80,11 @@ dtrace_getpcstack(pc_t *pcstack, int pcs
if (!INKERNEL((long) sp))
break;
 
+#ifdef __powerpc64__
+   callpc = *(uintptr_t *)(sp + RETURN_OFFSET64);
+#else
callpc = *(uintptr_t *)(sp + RETURN_OFFSET);
+#endif
 
if (!INKERNEL(callpc))
break;

Modified: head/sys/modules/dtrace/Makefile
==
--- head/sys/modules/dtrace/MakefileMon Aug 19 04:56:03 2013
(r254508)
+++ head/sys/modules/dtrace/MakefileMon Aug 19 05:10:46 2013
(r254509)
@@ -22,7 +22,7 @@ SUBDIR+=  fasttrap fbt systrace_linux32
 .if ${MACHINE_CPUARCH} == "powerpc"
 SUBDIR+=   fbt
 .endif
-.if ${MACHINE_CPUARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64"
 SUBDIR+=   systrace_freebsd32
 .endif
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254508 - head/etc/rc.d

2013-08-18 Thread Peter Wemm
Author: peter
Date: Mon Aug 19 04:56:03 2013
New Revision: 254508
URL: http://svnweb.freebsd.org/changeset/base/254508

Log:
  Add the optional ability to run as a different user.
  
  Obtained from:Antique freebsd.org cluster archive images

Modified:
  head/etc/rc.d/bsnmpd

Modified: head/etc/rc.d/bsnmpd
==
--- head/etc/rc.d/bsnmpdMon Aug 19 01:29:13 2013(r254507)
+++ head/etc/rc.d/bsnmpdMon Aug 19 04:56:03 2013(r254508)
@@ -12,7 +12,17 @@
 name="bsnmpd"
 rcvar="bsnmpd_enable"
 command="/usr/sbin/${name}"
-pidfile="/var/run/snmpd.pid"
+start_cmd="bsnmpd_start"
+
+bsnmpd_start()
+{
+   rc_flags="-p ${pidfile} ${bsnmpd_flags}"
+   echo -n "Starting bsnmpd"
+   su -m $user -c "$command ${rc_flags}"
+   echo "."
+}
 
 load_rc_config $name
+user="${bsnmpd_username:-root}"
+pidfile="${bsnmpd_pidfile:-/var/run/snmpd.pid}"
 run_rc_command "$1"
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254507 - head/sys/dev/sdhci

2013-08-18 Thread Ian Lepore
Author: ian
Date: Mon Aug 19 01:29:13 2013
New Revision: 254507
URL: http://svnweb.freebsd.org/changeset/base/254507

Log:
  Allow a hardware driver to pass clock frequencies into the sdhci driver.
  
  The sdhci spec says that if the base or timeout clock frequency in the
  capabilities register is zero, the driver must obtain the frequency "from
  another source."  This change defines that other source to be the low-level
  hardware driver, which can pre-set the frequencies in slot.max_clk and
  slot.timeout_clk before calling sdhci_init_slot().
  
  This helps with a growing number of SoCs that have sdhci base clock
  frequencies that either won't fit into the range allowed by the number of
  bits available in the capabilities register, or the frequency is runtime-
  configurable.

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

Modified: head/sys/dev/sdhci/sdhci.c
==
--- head/sys/dev/sdhci/sdhci.c  Sun Aug 18 23:40:30 2013(r254506)
+++ head/sys/dev/sdhci/sdhci.c  Mon Aug 19 01:29:13 2013(r254507)
@@ -477,7 +477,7 @@ sdhci_card_task(void *arg, int pending)
 int
 sdhci_init_slot(device_t dev, struct sdhci_slot *slot, int num)
 {
-   uint32_t caps;
+   uint32_t caps, freq;
int err;
 
SDHCI_LOCK_INIT(slot);
@@ -527,17 +527,23 @@ sdhci_init_slot(device_t dev, struct sdh
caps = RD4(slot, SDHCI_CAPABILITIES);
/* Calculate base clock frequency. */
if (slot->version >= SDHCI_SPEC_300)
-   slot->max_clk = (caps & SDHCI_CLOCK_V3_BASE_MASK) 
-   >> SDHCI_CLOCK_BASE_SHIFT;
+   freq = (caps & SDHCI_CLOCK_V3_BASE_MASK) >>
+   SDHCI_CLOCK_BASE_SHIFT;
else
-   slot->max_clk = (caps & SDHCI_CLOCK_BASE_MASK) 
-   >> SDHCI_CLOCK_BASE_SHIFT;
+   freq = (caps & SDHCI_CLOCK_BASE_MASK) >>
+   SDHCI_CLOCK_BASE_SHIFT;
+   if (freq != 0)
+   slot->max_clk = freq * 100;
+   /*
+* If the frequency wasn't in the capabilities and the hardware driver
+* hasn't already set max_clk we're probably not going to work right
+* with an assumption, so complain about it.
+*/
if (slot->max_clk == 0) {
-   slot->max_clk = SDHCI_DEFAULT_MAX_FREQ;
+   slot->max_clk = SDHCI_DEFAULT_MAX_FREQ * 100;
device_printf(dev, "Hardware doesn't specify base clock "
"frequency, using %dMHz as default.\n", 
SDHCI_DEFAULT_MAX_FREQ);
}
-   slot->max_clk *= 100;
/* Calculate timeout clock frequency. */
if (slot->quirks & SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK) {
slot->timeout_clk = slot->max_clk / 1000;
@@ -547,7 +553,11 @@ sdhci_init_slot(device_t dev, struct sdh
if (caps & SDHCI_TIMEOUT_CLK_UNIT)
slot->timeout_clk *= 1000;
}
-
+   /*
+* If the frequency wasn't in the capabilities and the hardware driver
+* hasn't already set timeout_clk we'll probably work okay using the
+* max timeout, but still mention it.
+*/
if (slot->timeout_clk == 0) {
device_printf(dev, "Hardware doesn't specify timeout clock "
"frequency, setting BROKEN_TIMEOUT quirk.\n");
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254506 - head/sys/net80211

2013-08-18 Thread Adrian Chadd
Author: adrian
Date: Sun Aug 18 23:40:30 2013
New Revision: 254506
URL: http://svnweb.freebsd.org/changeset/base/254506

Log:
  Don't return ENOTSUPP here - the net80211 pluggable ioctl API will treat
  this as the final item in the linker set and not try others.
  
  This stopped the fast frames IOCTLs from being called.

Modified:
  head/sys/net80211/ieee80211_tdma.c

Modified: head/sys/net80211/ieee80211_tdma.c
==
--- head/sys/net80211/ieee80211_tdma.c  Sun Aug 18 23:15:29 2013
(r254505)
+++ head/sys/net80211/ieee80211_tdma.c  Sun Aug 18 23:40:30 2013
(r254506)
@@ -744,7 +744,7 @@ tdma_ioctl_get80211(struct ieee80211vap 
struct ieee80211_tdma_state *ts = vap->iv_tdma;
 
if ((vap->iv_caps & IEEE80211_C_TDMA) == 0)
-   return EOPNOTSUPP;
+   return ENOSYS;
 
switch (ireq->i_type) {
case IEEE80211_IOC_TDMA_SLOT:
@@ -772,7 +772,7 @@ tdma_ioctl_set80211(struct ieee80211vap 
struct ieee80211_tdma_state *ts = vap->iv_tdma;
 
if ((vap->iv_caps & IEEE80211_C_TDMA) == 0)
-   return EOPNOTSUPP;
+   return ENOSYS;
 
switch (ireq->i_type) {
case IEEE80211_IOC_TDMA_SLOT:
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r254273 - in head: . include lib lib/libc/iconv lib/libiconv_compat lib/libkiconv share/mk sys/sys tools/build/mk

2013-08-18 Thread Peter Wemm
On 8/18/13 3:42 PM, Jilles Tjoelker wrote:
> On Sun, Aug 18, 2013 at 09:53:04PM +0200, Joel Dahl wrote:
>> On Sun, Aug 18, 2013 at 12:34:30AM +0200, Dimitry Andric wrote:
>>> On Aug 13, 2013, at 09:15, Peter Wemm  wrote:
 Author: peter
 Date: Tue Aug 13 07:15:01 2013
 New Revision: 254273
 URL: http://svnweb.freebsd.org/changeset/base/254273
> 
 Log:
  The iconv in libc did two things - implement the standard APIs, the GNU
  extensions and also tried to be link time compatible with ports libiconv.
  This splits that functionality and enables the parts that shouldn't
  interfere with the port by default.
> 
  WITH_ICONV (now on by default) - adds iconv.h, iconv_open(3) etc.
  WITH_LIBICONV_COMPAT (off by default) adds the libiconv_open etc API, 
 linker
  symbols and even a stub libiconv.so.3 that are good enough to be able
  to 'pkg delete -f libiconv' on a running system and reasonably expect it
  to work.
> 
  I have tortured many machines over the last few days to try and reduce
  the possibilities of foot-shooting as much as I can.  I've successfully
  recompiled to enable and disable the libiconv_compat modes, ports that use
  libiconv alongside system iconv etc.  If you don't enable the
  WITH_LIBICONV_COMPAT switch, they don't share symbol space.
> 
  This is an extension of behavior on other system.  iconv(3) is a standard
  libc interface and libiconv port expects to be able to run alongside it on
  systems that have it.
> 
>>> Unfortunately I expect this will break many ports, when the libiconv
>>> port is installed.  A simple example is the following:
>> 
> 
>> It also breaks installworld when /usr/src and /usr/obj are NFS exported
>> read-only.
> 
> I think it has to do with share/i18n/csmapper and share/i18n/esdb using
> directories as make targets. This apparently causes these files to be
> rebuilt at 'make installworld' time, which is always bad but is only
> detected when /usr/obj is read-only.
> 
> A hack that works is to enclose the four targets depending on ${SUBDIR}
> in  .if !make(install)  .
> 
> Unfortunately, the Makefiles were written to depend on the directories
> as make targets fairly deeply, so a real fix is harder.

I was looking at this yesterday, but was tied up with other things.  I'll
take a look at it today after getting a few other things done.  It should be
easy enough to replicate by changing /usr/obj to readonly on test systems.

-- 
Peter Wemm - pe...@wemm.org; pe...@freebsd.org; pe...@yahoo-inc.com; KI6FJV
UTF-8: for when a ' just won\342\200\231t do.
 ZFS must be the bacon of file systems.
 "everything's better with ZFS"



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r254273 - in head: . include lib lib/libc/iconv lib/libiconv_compat lib/libkiconv share/mk sys/sys tools/build/mk

2013-08-18 Thread Peter Wemm
On 8/17/13 3:34 PM, Dimitry Andric wrote:
> On Aug 13, 2013, at 09:15, Peter Wemm  wrote:
>> Author: peter
>> Date: Tue Aug 13 07:15:01 2013
>> New Revision: 254273
>> URL: http://svnweb.freebsd.org/changeset/base/254273
>>
>> Log:
>>  The iconv in libc did two things - implement the standard APIs, the GNU
>>  extensions and also tried to be link time compatible with ports libiconv.
>>  This splits that functionality and enables the parts that shouldn't
>>  interfere with the port by default.
>>
>>  WITH_ICONV (now on by default) - adds iconv.h, iconv_open(3) etc.
>>  WITH_LIBICONV_COMPAT (off by default) adds the libiconv_open etc API, linker
>>  symbols and even a stub libiconv.so.3 that are good enough to be able
>>  to 'pkg delete -f libiconv' on a running system and reasonably expect it
>>  to work.
>>
>>  I have tortured many machines over the last few days to try and reduce
>>  the possibilities of foot-shooting as much as I can.  I've successfully
>>  recompiled to enable and disable the libiconv_compat modes, ports that use
>>  libiconv alongside system iconv etc.  If you don't enable the
>>  WITH_LIBICONV_COMPAT switch, they don't share symbol space.
>>
>>  This is an extension of behavior on other system.  iconv(3) is a standard
>>  libc interface and libiconv port expects to be able to run alongside it on
>>  systems that have it.
> 
> Unfortunately I expect this will break many ports, when the libiconv
> port is installed.  A simple example is the following:
> 
>   #include 
> 
>   int main(void)
>   {
> iconv_t ic = iconv_open("UTF-8", "ISO-8859-1");
> iconv_close(ic);
> return 0;
>   }
> 
> If you compile this on a system after r254273 with -I/usr/local/include,
> and the libiconv port installed, it will result in:
> 
>   $ cc -I/usr/local/include iconv-test.c -o iconv-test
>   /tmp/iconv-test-I1ltw1.o: In function `main':
>   iconv-test.c:(.text+0x21): undefined reference to `libiconv_open'
>   iconv-test.c:(.text+0x2f): undefined reference to `libiconv_close'
>   cc: error: linker command failed with exit code 1 (use -v to see invocation)
> 
> This is because libiconv's iconv.h does:
> 
>   #define iconv_open libiconv_open
>   ...
>   #define iconv_close libiconv_close
> 
> and so on for most of its functions.

Yep, but since  is a standard include file, even on Linux systems.
 Autoconf/libtool/etc know this, that's why it typically compiles and links
like this:

cc -I/usr/local/include -L/usr/local/lib iconv-test.c -liconv

I'm sure there are exceptions though.

Random linux box (ubuntu fwiw):

peter@bit1:~$ readelf -a  /lib/x86_64-linux-gnu/libc-2.15.so  |grep iconv
  1554: 00220c045 FUNCGLOBAL DEFAULT   12 iconv_close@@GLIBC_2.2.5
  1745: 0021f10   418 FUNCGLOBAL DEFAULT   12 iconv@@GLIBC_2.2.5
  1764: 0021d00   523 FUNCGLOBAL DEFAULT   12 iconv_open@@GLIBC_2.2.5
peter@bit1:~$ grep '^extern' /usr/include/iconv.h
extern iconv_t iconv_open (__const char *, __const char *);
extern size_t iconv (iconv_t, char **__restrict,
extern int iconv_close (iconv_t);

If you mix includes and libraries like in your example, it would fail on
linux too.  However, linux tends to not add libiconv to the mix.

peter@bit1:~$ find / -mount -name 'libiconv*'
peter@bit1:~$ uname -a
Linux bit1 3.2.0-37-generic #58-Ubuntu SMP Thu Jan 24 15:28:10 UTC 2013
x86_64 x86_64 x86_64 GNU/Linux

The WITH_LIBICONV_COMPAT switch can be turned on - that adds the
libiconv_open etc aliases.  It was intended as a transition aid though - it
was intended to make 'pkg delete -f libiconv' on a running system keep working.

I compile my personal systems like this:

Index: Mk/Uses/iconv.mk
===
--- Mk/Uses/iconv.mk(revision 324679)
+++ Mk/Uses/iconv.mk(working copy)
@@ -16,6 +16,8 @@
 IGNORE=USES=iconv does not require args
 .endif

+.if !exists(/usr/include/iconv.h)
 LIB_DEPENDS+=  libiconv.so.3:${PORTSDIR}/converters/libiconv
+.endif

 .endif

.. and keep libiconv completely off them.  There's a couple of other ports
with it hard coded in, but this covers most of them.  eg: glib20, epic5,
unzip, php-iconv.

-- 
Peter Wemm - pe...@wemm.org; pe...@freebsd.org; pe...@yahoo-inc.com; KI6FJV
UTF-8: for when a ' just won\342\200\231t do.
 ZFS must be the bacon of file systems.
 "everything's better with ZFS"



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r254273 - in head: . include lib lib/libc/iconv lib/libiconv_compat lib/libkiconv share/mk sys/sys tools/build/mk

2013-08-18 Thread Jilles Tjoelker
On Sun, Aug 18, 2013 at 09:53:04PM +0200, Joel Dahl wrote:
> On Sun, Aug 18, 2013 at 12:34:30AM +0200, Dimitry Andric wrote:
> > On Aug 13, 2013, at 09:15, Peter Wemm  wrote:
> > > Author: peter
> > > Date: Tue Aug 13 07:15:01 2013
> > > New Revision: 254273
> > > URL: http://svnweb.freebsd.org/changeset/base/254273

> > > Log:
> > >  The iconv in libc did two things - implement the standard APIs, the GNU
> > >  extensions and also tried to be link time compatible with ports libiconv.
> > >  This splits that functionality and enables the parts that shouldn't
> > >  interfere with the port by default.

> > >  WITH_ICONV (now on by default) - adds iconv.h, iconv_open(3) etc.
> > >  WITH_LIBICONV_COMPAT (off by default) adds the libiconv_open etc API, 
> > > linker
> > >  symbols and even a stub libiconv.so.3 that are good enough to be able
> > >  to 'pkg delete -f libiconv' on a running system and reasonably expect it
> > >  to work.

> > >  I have tortured many machines over the last few days to try and reduce
> > >  the possibilities of foot-shooting as much as I can.  I've successfully
> > >  recompiled to enable and disable the libiconv_compat modes, ports that 
> > > use
> > >  libiconv alongside system iconv etc.  If you don't enable the
> > >  WITH_LIBICONV_COMPAT switch, they don't share symbol space.

> > >  This is an extension of behavior on other system.  iconv(3) is a standard
> > >  libc interface and libiconv port expects to be able to run alongside it 
> > > on
> > >  systems that have it.

> > Unfortunately I expect this will break many ports, when the libiconv
> > port is installed.  A simple example is the following:
> 

> It also breaks installworld when /usr/src and /usr/obj are NFS exported
> read-only.

I think it has to do with share/i18n/csmapper and share/i18n/esdb using
directories as make targets. This apparently causes these files to be
rebuilt at 'make installworld' time, which is always bad but is only
detected when /usr/obj is read-only.

A hack that works is to enclose the four targets depending on ${SUBDIR}
in  .if !make(install)  .

Unfortunately, the Makefiles were written to depend on the directories
as make targets fairly deeply, so a real fix is harder.

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


Re: svn commit: r254025 - in head/sys: amd64/amd64 arm/arm arm/at91 arm/mv/armadaxp arm/s3c2xx0 arm/xscale/i80321 arm/xscale/i8134x arm/xscale/ixp425 cddl/compat/opensolaris/kern cddl/compat/opensolar

2013-08-18 Thread Adrian Chadd
Hi Jeff,

This has broken booting on the MIPS Octeon platform. Apparently things just
plain hang during boot.

Would you please work with Joe to sort out what's going on? I'd like to try
and get this fixed up before 10.0-RELEASE is cut as the Octeon SMP platform
seems to be somewhat popular.

Thanks,



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


svn commit: r254501 - head/sys/amd64/amd64

2013-08-18 Thread Konstantin Belousov
Author: kib
Date: Sun Aug 18 21:36:22 2013
New Revision: 254501
URL: http://svnweb.freebsd.org/changeset/base/254501

Log:
  When code from r254064 in pmap_ts_referenced() drops pv lock and
  blocks on a pmap lock, pmap_release() might proceed in parallel and
  destroy the pmap mutex, since unlocked pv lock allows to remove pv
  entry owned by the pmap.
  
  For now, gate the pmap_release() on write-locked pvh_global_lock.
  Since pmap_ts_release() does not unlock the global lock,
  pmap_release() would not destroy pmap mutex until the
  pmap_ts_referenced() finished.  We cannot enter pmap_ts_referenced()
  and encounter a pv entry for the destroyed pmap if pmap_release()
  passed the global lock gate, since pmap_remove_pages() would finish
  earlier.
  
  Reported by:  jeff, pho
  Reviewed by:  alc
  Tested by:pho
  Sponsored by: The FreeBSD Foundation

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

Modified: head/sys/amd64/amd64/pmap.c
==
--- head/sys/amd64/amd64/pmap.c Sun Aug 18 20:40:13 2013(r254500)
+++ head/sys/amd64/amd64/pmap.c Sun Aug 18 21:36:22 2013(r254501)
@@ -1959,6 +1959,9 @@ pmap_release(pmap_t pmap)
KASSERT(vm_radix_is_empty(&pmap->pm_root),
("pmap_release: pmap has reserved page table page(s)"));
 
+   rw_wlock(&pvh_global_lock);
+   rw_wunlock(&pvh_global_lock);
+
m = PHYS_TO_VM_PAGE(pmap->pm_pml4[PML4PML4I] & PG_FRAME);
 
for (i = 0; i < NKPML4E; i++)   /* KVA */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254500 - head/sys/net80211

2013-08-18 Thread Adrian Chadd
Author: adrian
Date: Sun Aug 18 20:40:13 2013
New Revision: 254500
URL: http://svnweb.freebsd.org/changeset/base/254500

Log:
  Return the correct status if ieee80211_ff_check() consumes the mbuf.
  
  I broke this when converting the net80211 TX path to use if_transmit.

Modified:
  head/sys/net80211/ieee80211_output.c

Modified: head/sys/net80211/ieee80211_output.c
==
--- head/sys/net80211/ieee80211_output.cSun Aug 18 20:11:34 2013
(r254499)
+++ head/sys/net80211/ieee80211_output.cSun Aug 18 20:40:13 2013
(r254500)
@@ -210,8 +210,7 @@ ieee80211_vap_pkt_send_dest(struct ieee8
m = ieee80211_ff_check(ni, m);
if (m == NULL) {
/* NB: any ni ref held on stageq */
-   /* XXX better status? */
-   return (ENOBUFS);
+   return (0);
}
}
 #endif /* IEEE80211_SUPPORT_SUPERG */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254499 - in head: include lib/libc/gen

2013-08-18 Thread Pawel Jakub Dawidek
Author: pjd
Date: Sun Aug 18 20:11:34 2013
New Revision: 254499
URL: http://svnweb.freebsd.org/changeset/base/254499

Log:
  Implement fdclosedir(3) function, which is equivalent to the closedir(3)
  function, but returns directory file descriptor instead of closing it.
  
  Submitted by: Mariusz Zaborski 
  Sponsored by: Google Summer of Code 2013

Modified:
  head/include/dirent.h
  head/lib/libc/gen/Symbol.map
  head/lib/libc/gen/closedir.c
  head/lib/libc/gen/directory.3

Modified: head/include/dirent.h
==
--- head/include/dirent.h   Sun Aug 18 20:06:35 2013(r254498)
+++ head/include/dirent.h   Sun Aug 18 20:11:34 2013(r254499)
@@ -79,6 +79,7 @@ intdirfd(DIR *);
 #endif
 #if __BSD_VISIBLE
 DIR*__opendir2(const char *, int);
+int fdclosedir(DIR *);
 int getdents(int, char *, int);
 int getdirentries(int, char *, int, long *);
 #endif

Modified: head/lib/libc/gen/Symbol.map
==
--- head/lib/libc/gen/Symbol.mapSun Aug 18 20:06:35 2013
(r254498)
+++ head/lib/libc/gen/Symbol.mapSun Aug 18 20:11:34 2013
(r254499)
@@ -384,6 +384,7 @@ FBSD_1.3 {
clock_getcpuclockid;
dirfd;
dup3;
+   fdclosedir;
fdlopen;
__FreeBSD_libc_enter_restricted_mode;
getcontextx;

Modified: head/lib/libc/gen/closedir.c
==
--- head/lib/libc/gen/closedir.cSun Aug 18 20:06:35 2013
(r254498)
+++ head/lib/libc/gen/closedir.cSun Aug 18 20:11:34 2013
(r254499)
@@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$");
  * close a directory.
  */
 int
-closedir(DIR *dirp)
+fdclosedir(DIR *dirp)
 {
int fd;
 
@@ -65,5 +65,12 @@ closedir(DIR *dirp)
_pthread_mutex_destroy(&dirp->dd_lock);
}
free((void *)dirp);
-   return(_close(fd));
+   return (fd);
+}
+
+int
+closedir(DIR *dirp)
+{
+
+   return (_close(fdclosedir(dirp)));
 }

Modified: head/lib/libc/gen/directory.3
==
--- head/lib/libc/gen/directory.3   Sun Aug 18 20:06:35 2013
(r254498)
+++ head/lib/libc/gen/directory.3   Sun Aug 18 20:11:34 2013
(r254499)
@@ -28,7 +28,7 @@
 .\" @(#)directory.38.1 (Berkeley) 6/4/93
 .\" $FreeBSD$
 .\"
-.Dd July 5, 2012
+.Dd August 18, 2013
 .Dt DIRECTORY 3
 .Os
 .Sh NAME
@@ -40,6 +40,7 @@
 .Nm seekdir ,
 .Nm rewinddir ,
 .Nm closedir ,
+.Nm fdclosedir ,
 .Nm dirfd
 .Nd directory operations
 .Sh LIBRARY
@@ -64,6 +65,8 @@
 .Ft int
 .Fn closedir "DIR *dirp"
 .Ft int
+.Fn fdclosedir "DIR *dirp"
+.Ft int
 .Fn dirfd "DIR *dirp"
 .Sh DESCRIPTION
 The
@@ -208,6 +211,13 @@ On failure, \-1 is returned and the glob
 is set to indicate the error.
 .Pp
 The
+.Fn fdclosedir
+function is equivalent to the
+.Fn closedir
+function except that this function returns directory file descriptor instead of
+closing it.
+.Pp
+The
 .Fn dirfd
 function
 returns the integer file descriptor associated with the named
@@ -252,6 +262,9 @@ The
 .Fn fdopendir
 function appeared in
 .Fx 8.0 .
+.Fn fdclosedir
+function appeared in
+.Fx 10.0 .
 .Sh BUGS
 The invalidation of
 .Fn telldir
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254498 - head/lib/libc/gen

2013-08-18 Thread Pawel Jakub Dawidek
Author: pjd
Date: Sun Aug 18 20:06:35 2013
New Revision: 254498
URL: http://svnweb.freebsd.org/changeset/base/254498

Log:
  Remove redundant space.

Modified:
  head/lib/libc/gen/Symbol.map

Modified: head/lib/libc/gen/Symbol.map
==
--- head/lib/libc/gen/Symbol.mapSun Aug 18 19:37:35 2013
(r254497)
+++ head/lib/libc/gen/Symbol.mapSun Aug 18 20:06:35 2013
(r254498)
@@ -384,7 +384,7 @@ FBSD_1.3 {
clock_getcpuclockid;
dirfd;
dup3;
-fdlopen;
+   fdlopen;
__FreeBSD_libc_enter_restricted_mode;
getcontextx;
gid_from_group;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r254273 - in head: . include lib lib/libc/iconv lib/libiconv_compat lib/libkiconv share/mk sys/sys tools/build/mk

2013-08-18 Thread Joel Dahl
On Sun, Aug 18, 2013 at 12:34:30AM +0200, Dimitry Andric wrote:
> On Aug 13, 2013, at 09:15, Peter Wemm  wrote:
> > Author: peter
> > Date: Tue Aug 13 07:15:01 2013
> > New Revision: 254273
> > URL: http://svnweb.freebsd.org/changeset/base/254273
> > 
> > Log:
> >  The iconv in libc did two things - implement the standard APIs, the GNU
> >  extensions and also tried to be link time compatible with ports libiconv.
> >  This splits that functionality and enables the parts that shouldn't
> >  interfere with the port by default.
> > 
> >  WITH_ICONV (now on by default) - adds iconv.h, iconv_open(3) etc.
> >  WITH_LIBICONV_COMPAT (off by default) adds the libiconv_open etc API, 
> > linker
> >  symbols and even a stub libiconv.so.3 that are good enough to be able
> >  to 'pkg delete -f libiconv' on a running system and reasonably expect it
> >  to work.
> > 
> >  I have tortured many machines over the last few days to try and reduce
> >  the possibilities of foot-shooting as much as I can.  I've successfully
> >  recompiled to enable and disable the libiconv_compat modes, ports that use
> >  libiconv alongside system iconv etc.  If you don't enable the
> >  WITH_LIBICONV_COMPAT switch, they don't share symbol space.
> > 
> >  This is an extension of behavior on other system.  iconv(3) is a standard
> >  libc interface and libiconv port expects to be able to run alongside it on
> >  systems that have it.
> 
> Unfortunately I expect this will break many ports, when the libiconv
> port is installed.  A simple example is the following:


It also breaks installworld when /usr/src and /usr/obj are NFS exported
read-only.

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


svn commit: r254497 - head/sys/sys

2013-08-18 Thread Tijl Coosemans
Author: tijl
Date: Sun Aug 18 19:37:35 2013
New Revision: 254497
URL: http://svnweb.freebsd.org/changeset/base/254497

Log:
  Change the return type of the fallback implementation of the
  atomic_compare_exchange_* macros in stdatomic.h to _Bool.

Modified:
  head/sys/sys/stdatomic.h

Modified: head/sys/sys/stdatomic.h
==
--- head/sys/sys/stdatomic.hSun Aug 18 19:08:53 2013(r254496)
+++ head/sys/sys/stdatomic.hSun Aug 18 19:37:35 2013(r254497)
@@ -288,8 +288,8 @@ typedef _Atomic(__uintmax_t)atomic_uin
__typeof__(expected) __ep = (expected); \
__typeof__(*__ep) __e = *__ep;  \
(void)(success); (void)(failure);   \
-   (*__ep = __sync_val_compare_and_swap(&(object)->__val,  \
-   __e, desired)) == __e;  \
+   (_Bool)((*__ep = __sync_val_compare_and_swap(&(object)->__val,  \
+   __e, desired)) == __e); \
 })
 #defineatomic_compare_exchange_weak_explicit(object, expected, 
\
 desired, success, failure) \
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254496 - head/sys/dev/sdhci

2013-08-18 Thread Ian Lepore
Author: ian
Date: Sun Aug 18 19:08:53 2013
New Revision: 254496
URL: http://svnweb.freebsd.org/changeset/base/254496

Log:
  Add a new SDHCI_QUIRK_DONT_SHIFT_RESPONSE for hardware that pre-shifts
  the response bits the way we do in software.  While the hardware is just
  doing the sensible thing rather than leaving it to the software, it's in
  violation of the spec by doing so.  G.

Modified:
  head/sys/dev/sdhci/sdhci.c
  head/sys/dev/sdhci/sdhci.h

Modified: head/sys/dev/sdhci/sdhci.c
==
--- head/sys/dev/sdhci/sdhci.c  Sun Aug 18 18:08:12 2013(r254495)
+++ head/sys/dev/sdhci/sdhci.c  Sun Aug 18 19:08:53 2013(r254496)
@@ -835,8 +835,13 @@ sdhci_finish_command(struct sdhci_slot *
uint8_t extra = 0;
for (i = 0; i < 4; i++) {
uint32_t val = RD4(slot, SDHCI_RESPONSE + i * 
4);
-   slot->curcmd->resp[3 - i] = (val << 8) + extra;
-   extra = val >> 24;
+   if (slot->quirks & 
SDHCI_QUIRK_DONT_SHIFT_RESPONSE)
+   slot->curcmd->resp[3 - i] = val;
+   else {
+   slot->curcmd->resp[3 - i] = 
+   (val << 8) | extra;
+   extra = val >> 24;
+   }
}
} else
slot->curcmd->resp[0] = RD4(slot, SDHCI_RESPONSE);

Modified: head/sys/dev/sdhci/sdhci.h
==
--- head/sys/dev/sdhci/sdhci.h  Sun Aug 18 18:08:12 2013(r254495)
+++ head/sys/dev/sdhci/sdhci.h  Sun Aug 18 19:08:53 2013(r254496)
@@ -57,6 +57,8 @@
 #defineSDHCI_QUIRK_BROKEN_TIMEOUT_VAL  (1<<11)
 /* SDHCI_CAPABILITIES is invalid */
 #defineSDHCI_QUIRK_MISSING_CAPS(1<<12)
+/* Hardware shifts the 136-bit response, don't do it in software. */
+#defineSDHCI_QUIRK_DONT_SHIFT_RESPONSE (1<<13)
 
 /*
  * Controller registers
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254495 - head/sys/arm/samsung/exynos

2013-08-18 Thread Olivier Houchard
Author: cognet
Date: Sun Aug 18 18:08:12 2013
New Revision: 254495
URL: http://svnweb.freebsd.org/changeset/base/254495

Log:
  Increase the max KVA available for general consumption on the Exynos 5.
  
  Submitted by: Ruslan Bukin 

Modified:
  head/sys/arm/samsung/exynos/exynos5_machdep.c

Modified: head/sys/arm/samsung/exynos/exynos5_machdep.c
==
--- head/sys/arm/samsung/exynos/exynos5_machdep.c   Sun Aug 18 17:18:52 
2013(r254494)
+++ head/sys/arm/samsung/exynos/exynos5_machdep.c   Sun Aug 18 18:08:12 
2013(r254495)
@@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-#defineDEVMAP_BOOTSTRAP_MAP_START 0xE000
+#defineDEVMAP_BOOTSTRAP_MAP_START 0xF000
 
 extern int unmapped_buf_allowed;
 
@@ -83,7 +83,7 @@ platform_devmap_init(void)
int i;
 
i = 0;
-   fdt_devmap[i].pd_va = 0xe2C0;
+   fdt_devmap[i].pd_va = 0xf2C0;
fdt_devmap[i].pd_pa = 0x12C0;
fdt_devmap[i].pd_size = 0x10;
fdt_devmap[i].pd_prot = VM_PROT_READ | VM_PROT_WRITE;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254494 - head/sys/arm/conf

2013-08-18 Thread Andrew Turner
Author: andrew
Date: Sun Aug 18 17:18:52 2013
New Revision: 254494
URL: http://svnweb.freebsd.org/changeset/base/254494

Log:
  Enable VFP in the Versatile PB (QEMU) kernel. Tested on QEMU 1.6.0.

Modified:
  head/sys/arm/conf/VERSATILEPB

Modified: head/sys/arm/conf/VERSATILEPB
==
--- head/sys/arm/conf/VERSATILEPB   Sun Aug 18 16:16:36 2013
(r254493)
+++ head/sys/arm/conf/VERSATILEPB   Sun Aug 18 17:18:52 2013
(r254494)
@@ -54,6 +54,7 @@ options   SYSVSEM #SYSV-style semaphore
 options_KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions
 optionsKBD_INSTALL_CDEV# install a CDEV entry in /dev
 options ROOTDEVNAME=\"ufs:da0s2a\"
+optionsVFP # vfp/neon
 
 optionsPREEMPTION
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254493 - head/sys/arm/conf

2013-08-18 Thread Andrew Turner
Author: andrew
Date: Sun Aug 18 16:16:36 2013
New Revision: 254493
URL: http://svnweb.freebsd.org/changeset/base/254493

Log:
  Enable VFP on the CubieBoard and CubieBoard 2.

Modified:
  head/sys/arm/conf/CUBIEBOARD
  head/sys/arm/conf/CUBIEBOARD2

Modified: head/sys/arm/conf/CUBIEBOARD
==
--- head/sys/arm/conf/CUBIEBOARDSun Aug 18 13:38:39 2013
(r254492)
+++ head/sys/arm/conf/CUBIEBOARDSun Aug 18 16:16:36 2013
(r254493)
@@ -47,6 +47,7 @@ options   _KPOSIX_PRIORITY_SCHEDULING #Po
 optionsKBD_INSTALL_CDEV# install a CDEV entry in /dev
 optionsPREEMPTION
 optionsFREEBSD_BOOT_LOADER
+optionsVFP # vfp/neon
 
 # Debugging
 makeoptionsDEBUG=-g#Build kernel with gdb(1) debug symbols

Modified: head/sys/arm/conf/CUBIEBOARD2
==
--- head/sys/arm/conf/CUBIEBOARD2   Sun Aug 18 13:38:39 2013
(r254492)
+++ head/sys/arm/conf/CUBIEBOARD2   Sun Aug 18 16:16:36 2013
(r254493)
@@ -47,6 +47,7 @@ options   _KPOSIX_PRIORITY_SCHEDULING #Po
 optionsKBD_INSTALL_CDEV# install a CDEV entry in /dev
 optionsPREEMPTION
 optionsFREEBSD_BOOT_LOADER
+optionsVFP # vfp/neon
 
 # Debugging
 makeoptionsDEBUG=-g#Build kernel with gdb(1) debug symbols
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254492 - head/sys/compat/freebsd32

2013-08-18 Thread Pawel Jakub Dawidek
Author: pjd
Date: Sun Aug 18 13:38:39 2013
New Revision: 254492
URL: http://svnweb.freebsd.org/changeset/base/254492

Log:
  Regenerate after r254491.

Modified:
  head/sys/compat/freebsd32/freebsd32_proto.h
  head/sys/compat/freebsd32/freebsd32_syscall.h
  head/sys/compat/freebsd32/freebsd32_syscalls.c
  head/sys/compat/freebsd32/freebsd32_sysent.c
  head/sys/compat/freebsd32/freebsd32_systrace_args.c

Modified: head/sys/compat/freebsd32/freebsd32_proto.h
==
--- head/sys/compat/freebsd32/freebsd32_proto.h Sun Aug 18 13:37:54 2013
(r254491)
+++ head/sys/compat/freebsd32/freebsd32_proto.h Sun Aug 18 13:38:39 2013
(r254492)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 254481 
2013-08-18 10:30:41Z pjd 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 254491 
2013-08-18 13:37:54Z pjd 
  */
 
 #ifndef _FREEBSD32_SYSPROTO_H_
@@ -627,6 +627,12 @@ struct freebsd32_wait6_args {
char wrusage_l_[PADL_(struct wrusage32 *)]; struct wrusage32 * wrusage; 
char wrusage_r_[PADR_(struct wrusage32 *)];
char info_l_[PADL_(siginfo_t *)]; siginfo_t * info; char 
info_r_[PADR_(siginfo_t *)];
 };
+struct freebsd32_cap_rights_limit_args {
+   char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
+   char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)];
+   char rights1_l_[PADL_(uint32_t)]; uint32_t rights1; char 
rights1_r_[PADR_(uint32_t)];
+   char rights2_l_[PADL_(uint32_t)]; uint32_t rights2; char 
rights2_r_[PADR_(uint32_t)];
+};
 #else
 struct freebsd32_posix_fallocate_args {
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
@@ -652,6 +658,11 @@ struct freebsd32_wait6_args {
char wrusage_l_[PADL_(struct wrusage32 *)]; struct wrusage32 * wrusage; 
char wrusage_r_[PADR_(struct wrusage32 *)];
char info_l_[PADL_(siginfo_t *)]; siginfo_t * info; char 
info_r_[PADR_(siginfo_t *)];
 };
+struct freebsd32_cap_rights_limit_args {
+   char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
+   char rights1_l_[PADL_(uint32_t)]; uint32_t rights1; char 
rights1_r_[PADR_(uint32_t)];
+   char rights2_l_[PADL_(uint32_t)]; uint32_t rights2; char 
rights2_r_[PADR_(uint32_t)];
+};
 #endif
 struct freebsd32_cap_ioctls_limit_args {
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
@@ -784,10 +795,12 @@ int   freebsd32_pselect(struct thread *, s
 intfreebsd32_posix_fallocate(struct thread *, struct 
freebsd32_posix_fallocate_args *);
 intfreebsd32_posix_fadvise(struct thread *, struct 
freebsd32_posix_fadvise_args *);
 intfreebsd32_wait6(struct thread *, struct freebsd32_wait6_args *);
+intfreebsd32_cap_rights_limit(struct thread *, struct 
freebsd32_cap_rights_limit_args *);
 #else
 intfreebsd32_posix_fallocate(struct thread *, struct 
freebsd32_posix_fallocate_args *);
 intfreebsd32_posix_fadvise(struct thread *, struct 
freebsd32_posix_fadvise_args *);
 intfreebsd32_wait6(struct thread *, struct freebsd32_wait6_args *);
+intfreebsd32_cap_rights_limit(struct thread *, struct 
freebsd32_cap_rights_limit_args *);
 #endif
 intfreebsd32_cap_ioctls_limit(struct thread *, struct 
freebsd32_cap_ioctls_limit_args *);
 intfreebsd32_cap_ioctls_get(struct thread *, struct 
freebsd32_cap_ioctls_get_args *);
@@ -1186,9 +1199,11 @@ int  freebsd7_freebsd32_shmctl(struct thr
 #defineFREEBSD32_SYS_AUE_freebsd32_posix_fallocate AUE_NULL
 #defineFREEBSD32_SYS_AUE_freebsd32_posix_fadvise   AUE_NULL
 #defineFREEBSD32_SYS_AUE_freebsd32_wait6   AUE_WAIT6
+#defineFREEBSD32_SYS_AUE_freebsd32_cap_rights_limit
AUE_CAP_RIGHTS_LIMIT
 #defineFREEBSD32_SYS_AUE_freebsd32_posix_fallocate AUE_NULL
 #defineFREEBSD32_SYS_AUE_freebsd32_posix_fadvise   AUE_NULL
 #defineFREEBSD32_SYS_AUE_freebsd32_wait6   AUE_WAIT6
+#defineFREEBSD32_SYS_AUE_freebsd32_cap_rights_limit
AUE_CAP_RIGHTS_LIMIT
 #defineFREEBSD32_SYS_AUE_freebsd32_cap_ioctls_limit
AUE_CAP_IOCTLS_LIMIT
 #defineFREEBSD32_SYS_AUE_freebsd32_cap_ioctls_get  
AUE_CAP_IOCTLS_GET
 #defineFREEBSD32_SYS_AUE_freebsd32_aio_mlock   AUE_NULL

Modified: head/sys/compat/freebsd32/freebsd32_syscall.h
==
--- head/sys/compat/freebsd32/freebsd32_syscall.h   Sun Aug 18 13:37:54 
2013(r254491)
+++ head/sys/compat/freebsd32/freebsd32_syscall.h   Sun Aug 18 13:38:39 
2013(r254492)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 254481 
2013-08-18 10:30:41Z pjd 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 254491 
2013-08-18 13:37:54Z 

svn commit: r254491 - head/sys/compat/freebsd32

2013-08-18 Thread Pawel Jakub Dawidek
Author: pjd
Date: Sun Aug 18 13:37:54 2013
New Revision: 254491
URL: http://svnweb.freebsd.org/changeset/base/254491

Log:
  The cap_rights_limit(2) system calls needs a wrapper for 32bit binaries
  running under 64bit kernels as the 'rights' argument has to be split
  into two registers or the half of the rights will disappear.
  
  Reported by:  jilles
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/compat/freebsd32/freebsd32_capability.c
  head/sys/compat/freebsd32/syscalls.master

Modified: head/sys/compat/freebsd32/freebsd32_capability.c
==
--- head/sys/compat/freebsd32/freebsd32_capability.cSun Aug 18 13:34:11 
2013(r254490)
+++ head/sys/compat/freebsd32/freebsd32_capability.cSun Aug 18 13:37:54 
2013(r254491)
@@ -38,9 +38,11 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
+#include 
 #include 
 
 #ifdef CAPABILITIES
@@ -48,6 +50,17 @@ __FBSDID("$FreeBSD$");
 MALLOC_DECLARE(M_FILECAPS);
 
 int
+freebsd32_cap_rights_limit(struct thread *td,
+struct freebsd32_cap_rights_limit_args *uap)
+{
+   struct cap_rights_limit_args ap;
+
+   ap.fd = uap->fd;
+   ap.rights = PAIR32TO64(uint64_t, uap->rights);
+   return (sys_cap_rights_limit(td, &ap));
+}
+
+int
 freebsd32_cap_ioctls_limit(struct thread *td,
 struct freebsd32_cap_ioctls_limit_args *uap)
 {
@@ -135,6 +148,14 @@ out:
 #else /* !CAPABILITIES */
 
 int
+freebsd32_cap_rights_limit(struct thread *td,
+struct freebsd32_cap_rights_limit_args *uap)
+{
+
+   return (ENOSYS);
+}
+
+int
 freebsd32_cap_ioctls_limit(struct thread *td,
 struct freebsd32_cap_ioctls_limit_args *uap)
 {

Modified: head/sys/compat/freebsd32/syscalls.master
==
--- head/sys/compat/freebsd32/syscalls.master   Sun Aug 18 13:34:11 2013
(r254490)
+++ head/sys/compat/freebsd32/syscalls.master   Sun Aug 18 13:37:54 2013
(r254491)
@@ -1016,6 +1016,10 @@
int *status, int options, \
struct wrusage32 *wrusage, \
siginfo_t *info); }
+533AUE_CAP_RIGHTS_LIMITSTD { \
+   int freebsd32_cap_rights_limit(int fd, \
+   int pad, \
+   uint32_t rights1, uint32_t rights2); }
 #else
 530AUE_NULLSTD { int freebsd32_posix_fallocate(int fd,\
uint32_t offset1, uint32_t offset2,\
@@ -1029,9 +1033,10 @@
int *status, int options, \
struct wrusage32 *wrusage, \
siginfo_t *info); }
+533AUE_CAP_RIGHTS_LIMITSTD { \
+   int freebsd32_cap_rights_limit(int fd, \
+   uint32_t rights1, uint32_t rights2); }
 #endif
-533AUE_CAP_RIGHTS_LIMITNOPROTO { int cap_rights_limit(int fd, \
-   uint64_t rights); }
 534AUE_CAP_IOCTLS_LIMITSTD { \
int freebsd32_cap_ioctls_limit(int fd, \
const uint32_t *cmds, size_t ncmds); }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254490 - head/sys/compat/freebsd32

2013-08-18 Thread Pawel Jakub Dawidek
Author: pjd
Date: Sun Aug 18 13:34:11 2013
New Revision: 254490
URL: http://svnweb.freebsd.org/changeset/base/254490

Log:
  Move the PAIR32TO64() macro and the RETVAL_HI/RETVAL_LO defines to a
  header file for use by other .c files.
  
  Sponsored by: The FreeBSD Foundation

Added:
  head/sys/compat/freebsd32/freebsd32_misc.h   (contents, props changed)
Modified:
  head/sys/compat/freebsd32/freebsd32_misc.c

Modified: head/sys/compat/freebsd32/freebsd32_misc.c
==
--- head/sys/compat/freebsd32/freebsd32_misc.c  Sun Aug 18 13:27:04 2013
(r254489)
+++ head/sys/compat/freebsd32/freebsd32_misc.c  Sun Aug 18 13:34:11 2013
(r254490)
@@ -102,6 +102,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -128,16 +129,6 @@ CTASSERT(sizeof(struct sigaction32) == 2
 static int freebsd32_kevent_copyout(void *arg, struct kevent *kevp, int count);
 static int freebsd32_kevent_copyin(void *arg, struct kevent *kevp, int count);
 
-#if BYTE_ORDER == BIG_ENDIAN
-#define PAIR32TO64(type, name) ((name ## 2) | ((type)(name ## 1) << 32))
-#define RETVAL_HI 0
-#define RETVAL_LO 1
-#else
-#define PAIR32TO64(type, name) ((name ## 1) | ((type)(name ## 2) << 32))
-#define RETVAL_HI 1
-#define RETVAL_LO 0
-#endif
-
 void
 freebsd32_rusage_out(const struct rusage *s, struct rusage32 *s32)
 {

Added: head/sys/compat/freebsd32/freebsd32_misc.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/compat/freebsd32/freebsd32_misc.h  Sun Aug 18 13:34:11 2013
(r254490)
@@ -0,0 +1,47 @@
+/*-
+ * Copyright (c) 2013 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Pawel Jakub Dawidek under sponsorship from
+ * the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef_COMPAT_FREEBSD32_MISC_H_
+#define_COMPAT_FREEBSD32_MISC_H_
+
+#include 
+
+#if BYTE_ORDER == BIG_ENDIAN
+#definePAIR32TO64(type, name)  ((name ## 2) | ((type)(name ## 1) << 
32))
+#defineRETVAL_HI   0   
+#defineRETVAL_LO   1   
+#else
+#definePAIR32TO64(type, name)  ((name ## 1) | ((type)(name ## 2) << 
32))
+#defineRETVAL_HI   1   
+#defineRETVAL_LO   0   
+#endif
+
+#endif /* !_COMPAT_FREEBSD32_MISC_H_ */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254489 - head/sys/kern

2013-08-18 Thread Jilles Tjoelker
Author: jilles
Date: Sun Aug 18 13:27:04 2013
New Revision: 254489
URL: http://svnweb.freebsd.org/changeset/base/254489

Log:
  Disallow opening a POSIX message queue for execute.
  
  O_EXEC was formerly ignored, so equivalent to O_RDONLY.
  
  Reject O_EXEC with [EINVAL] like the invalid mode 3.

Modified:
  head/sys/kern/uipc_mqueue.c

Modified: head/sys/kern/uipc_mqueue.c
==
--- head/sys/kern/uipc_mqueue.c Sun Aug 18 13:25:18 2013(r254488)
+++ head/sys/kern/uipc_mqueue.c Sun Aug 18 13:27:04 2013(r254489)
@@ -2046,7 +2046,7 @@ sys_kmq_open(struct thread *td, struct k
struct mq_attr attr;
int flags, error;
 
-   if ((uap->flags & O_ACCMODE) == O_ACCMODE)
+   if ((uap->flags & O_ACCMODE) == O_ACCMODE || uap->flags & O_EXEC)
return (EINVAL);
flags = FFLAGS(uap->flags);
if ((flags & O_CREAT) != 0 && uap->attr != NULL) {
@@ -2682,7 +2682,7 @@ freebsd32_kmq_open(struct thread *td, st
struct mq_attr32 attr32;
int flags, error;
 
-   if ((uap->flags & O_ACCMODE) == O_ACCMODE)
+   if ((uap->flags & O_ACCMODE) == O_ACCMODE || uap->flags & O_EXEC)
return (EINVAL);
flags = FFLAGS(uap->flags);
if ((flags & O_CREAT) != 0 && uap->attr != NULL) {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254488 - head/lib/libc/gen

2013-08-18 Thread Jilles Tjoelker
Author: jilles
Date: Sun Aug 18 13:25:18 2013
New Revision: 254488
URL: http://svnweb.freebsd.org/changeset/base/254488

Log:
  dup3(3): Replace copyright notice.
  
  Although I copied dup(2) to create dup3(3), I removed almost all the
  non-boilerplate, so dup3(3) is copyright me.
  
  Reported by:  bjk

Modified:
  head/lib/libc/gen/dup3.3

Modified: head/lib/libc/gen/dup3.3
==
--- head/lib/libc/gen/dup3.3Sun Aug 18 11:54:20 2013(r254487)
+++ head/lib/libc/gen/dup3.3Sun Aug 18 13:25:18 2013(r254488)
@@ -1,5 +1,5 @@
-.\" Copyright (c) 1980, 1991, 1993
-.\"The Regents of the University of California.  All rights reserved.
+.\" Copyright (c) 2013 Jilles Tjoelker
+.\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
 .\" modification, are permitted provided that the following conditions
@@ -9,14 +9,11 @@
 .\" 2. Redistributions in binary form must reproduce the above copyright
 .\"notice, this list of conditions and the following disclaimer in the
 .\"documentation and/or other materials provided with the distribution.
-.\" 4. Neither the name of the University nor the names of its contributors
-.\"may be used to endorse or promote products derived from this software
-.\"without specific prior written permission.
 .\"
-.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" 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 REGENTS OR CONTRIBUTORS BE LIABLE
+.\" 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)
@@ -25,7 +22,6 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" @(#)dup.2  8.1 (Berkeley) 6/4/93
 .\" $FreeBSD$
 .\"
 .Dd August 16, 2013
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254487 - head/sys/arm/conf

2013-08-18 Thread Andrew Turner
Author: andrew
Date: Sun Aug 18 11:54:20 2013
New Revision: 254487
URL: http://svnweb.freebsd.org/changeset/base/254487

Log:
  Enable VFP support on EFIKA MX.

Modified:
  head/sys/arm/conf/EFIKA_MX

Modified: head/sys/arm/conf/EFIKA_MX
==
--- head/sys/arm/conf/EFIKA_MX  Sun Aug 18 11:25:42 2013(r254486)
+++ head/sys/arm/conf/EFIKA_MX  Sun Aug 18 11:54:20 2013(r254487)
@@ -58,6 +58,7 @@ options   SYSVMSG # SYSV-style message 
 optionsSYSVSEM # SYSV-style semaphores
 options_KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time 
extensions
 optionsINCLUDE_CONFIG_FILE # Include this file in kernel
+optionsVFP # vfp/neon
 
 # required for netbooting
 #options   BOOTP
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254486 - head/usr.sbin/rwhod

2013-08-18 Thread Pawel Jakub Dawidek
Author: pjd
Date: Sun Aug 18 11:25:42 2013
New Revision: 254486
URL: http://svnweb.freebsd.org/changeset/base/254486

Log:
  Cast argument of is*() ctype functions to unsigned char.
  
  Without the cast there is ambiguity between 0xFF and -1 (EOF).
  
  Suggested by: jilles
  Submitted by: Mariusz Zaborski 
  Sponsored by: Google Summer of Code 2013

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

Modified: head/usr.sbin/rwhod/rwhod.c
==
--- head/usr.sbin/rwhod/rwhod.c Sun Aug 18 10:44:37 2013(r254485)
+++ head/usr.sbin/rwhod/rwhod.c Sun Aug 18 11:25:42 2013(r254486)
@@ -337,8 +337,11 @@ verify(char *name, int maxlen)
 
size = 0;
while (*name != '\0' && size < maxlen - 1) {
-   if (!isascii(*name) || !(isalnum(*name) || ispunct(*name)))
+   if (!isascii((unsigned char)*name) ||
+   !(isalnum((unsigned char)*name) ||
+   ispunct((unsigned char)*name))) {
return (0);
+   }
name++;
size++;
}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254485 - head/usr.bin/procstat

2013-08-18 Thread Pawel Jakub Dawidek
Author: pjd
Date: Sun Aug 18 10:44:37 2013
New Revision: 254485
URL: http://svnweb.freebsd.org/changeset/base/254485

Log:
  Make the "FD" column one character wider, so that "trace" can also align
  properly.

Modified:
  head/usr.bin/procstat/procstat_files.c

Modified: head/usr.bin/procstat/procstat_files.c
==
--- head/usr.bin/procstat/procstat_files.c  Sun Aug 18 10:38:59 2013
(r254484)
+++ head/usr.bin/procstat/procstat_files.c  Sun Aug 18 10:44:37 2013
(r254485)
@@ -332,19 +332,19 @@ procstat_files(struct procstat *procstat
printf("%5d ", kipp->ki_pid);
printf("%-16s ", kipp->ki_comm);
if (fst->fs_uflags & PS_FST_UFLAG_CTTY)
-   printf("ctty ");
+   printf(" ctty ");
else if (fst->fs_uflags & PS_FST_UFLAG_CDIR)
-   printf(" cwd ");
+   printf("  cwd ");
else if (fst->fs_uflags & PS_FST_UFLAG_JAIL)
-   printf("jail ");
+   printf(" jail ");
else if (fst->fs_uflags & PS_FST_UFLAG_RDIR)
-   printf("root ");
+   printf(" root ");
else if (fst->fs_uflags & PS_FST_UFLAG_TEXT)
-   printf("text ");
+   printf(" text ");
else if (fst->fs_uflags & PS_FST_UFLAG_TRACE)
printf("trace ");
else
-   printf("%4d ", fst->fs_fd);
+   printf("%5d ", fst->fs_fd);
 
switch (fst->fs_type) {
case PS_FST_TYPE_VNODE:
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254484 - head/lib/libc/net

2013-08-18 Thread Pawel Jakub Dawidek
Author: pjd
Date: Sun Aug 18 10:38:59 2013
New Revision: 254484
URL: http://svnweb.freebsd.org/changeset/base/254484

Log:
  Consistently use 'af' as an argument name for address family.
  Now both gethostbyname2(3) and gethostbyaddr(3) use the same argument name.
  The same argument name is also used in implementations of those functions.

Modified:
  head/lib/libc/net/gethostbyname.3

Modified: head/lib/libc/net/gethostbyname.3
==
--- head/lib/libc/net/gethostbyname.3   Sun Aug 18 10:33:46 2013
(r254483)
+++ head/lib/libc/net/gethostbyname.3   Sun Aug 18 10:38:59 2013
(r254484)
@@ -51,7 +51,7 @@
 .Ft struct hostent *
 .Fn gethostbyname2 "const char *name" "int af"
 .Ft struct hostent *
-.Fn gethostbyaddr "const void *addr" "socklen_t len" "int type"
+.Fn gethostbyaddr "const void *addr" "socklen_t len" "int af"
 .Ft struct hostent *
 .Fn gethostent void
 .Ft void
@@ -107,7 +107,7 @@ in binary form
 .Tn ASCII
 form).
 The
-.Fa type
+.Fa af
 argument specifies the address family
 (e.g.\&
 .Dv AF_INET , AF_INET6 ,
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254483 - head/lib/libc/stdlib

2013-08-18 Thread Pawel Jakub Dawidek
Author: pjd
Date: Sun Aug 18 10:33:46 2013
New Revision: 254483
URL: http://svnweb.freebsd.org/changeset/base/254483

Log:
  Make example more correct (errstr is a pointer, not boolean).

Modified:
  head/lib/libc/stdlib/strtonum.3

Modified: head/lib/libc/stdlib/strtonum.3
==
--- head/lib/libc/stdlib/strtonum.3 Sun Aug 18 10:31:30 2013
(r254482)
+++ head/lib/libc/stdlib/strtonum.3 Sun Aug 18 10:33:46 2013
(r254483)
@@ -97,7 +97,7 @@ int iterations;
 const char *errstr;
 
 iterations = strtonum(optarg, 1, 64, &errstr);
-if (errstr)
+if (errstr != NULL)
errx(1, "number of iterations is %s: %s", errstr, optarg);
 .Ed
 .Pp
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r254482 - head/sys/compat/freebsd32

2013-08-18 Thread Pawel Jakub Dawidek
Author: pjd
Date: Sun Aug 18 10:31:30 2013
New Revision: 254482
URL: http://svnweb.freebsd.org/changeset/base/254482

Log:
  Regenerate after r254481.

Modified:
  head/sys/compat/freebsd32/freebsd32_proto.h
  head/sys/compat/freebsd32/freebsd32_syscall.h
  head/sys/compat/freebsd32/freebsd32_syscalls.c
  head/sys/compat/freebsd32/freebsd32_sysent.c
  head/sys/compat/freebsd32/freebsd32_systrace_args.c

Modified: head/sys/compat/freebsd32/freebsd32_proto.h
==
--- head/sys/compat/freebsd32/freebsd32_proto.h Sun Aug 18 10:30:41 2013
(r254481)
+++ head/sys/compat/freebsd32/freebsd32_proto.h Sun Aug 18 10:31:30 2013
(r254482)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 254447 
2013-08-17 14:17:13Z pjd 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 254481 
2013-08-18 10:30:41Z pjd 
  */
 
 #ifndef _FREEBSD32_SYSPROTO_H_
@@ -653,6 +653,16 @@ struct freebsd32_wait6_args {
char info_l_[PADL_(siginfo_t *)]; siginfo_t * info; char 
info_r_[PADR_(siginfo_t *)];
 };
 #endif
+struct freebsd32_cap_ioctls_limit_args {
+   char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
+   char cmds_l_[PADL_(const uint32_t *)]; const uint32_t * cmds; char 
cmds_r_[PADR_(const uint32_t *)];
+   char ncmds_l_[PADL_(size_t)]; size_t ncmds; char 
ncmds_r_[PADR_(size_t)];
+};
+struct freebsd32_cap_ioctls_get_args {
+   char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
+   char cmds_l_[PADL_(uint32_t *)]; uint32_t * cmds; char 
cmds_r_[PADR_(uint32_t *)];
+   char maxcmds_l_[PADL_(size_t)]; size_t maxcmds; char 
maxcmds_r_[PADR_(size_t)];
+};
 struct freebsd32_aio_mlock_args {
char aiocbp_l_[PADL_(struct aiocb32 *)]; struct aiocb32 * aiocbp; char 
aiocbp_r_[PADR_(struct aiocb32 *)];
 };
@@ -779,6 +789,8 @@ int freebsd32_posix_fallocate(struct thr
 intfreebsd32_posix_fadvise(struct thread *, struct 
freebsd32_posix_fadvise_args *);
 intfreebsd32_wait6(struct thread *, struct freebsd32_wait6_args *);
 #endif
+intfreebsd32_cap_ioctls_limit(struct thread *, struct 
freebsd32_cap_ioctls_limit_args *);
+intfreebsd32_cap_ioctls_get(struct thread *, struct 
freebsd32_cap_ioctls_get_args *);
 intfreebsd32_aio_mlock(struct thread *, struct freebsd32_aio_mlock_args *);
 
 #ifdef COMPAT_43
@@ -1177,6 +1189,8 @@ int   freebsd7_freebsd32_shmctl(struct thr
 #defineFREEBSD32_SYS_AUE_freebsd32_posix_fallocate AUE_NULL
 #defineFREEBSD32_SYS_AUE_freebsd32_posix_fadvise   AUE_NULL
 #defineFREEBSD32_SYS_AUE_freebsd32_wait6   AUE_WAIT6
+#defineFREEBSD32_SYS_AUE_freebsd32_cap_ioctls_limit
AUE_CAP_IOCTLS_LIMIT
+#defineFREEBSD32_SYS_AUE_freebsd32_cap_ioctls_get  
AUE_CAP_IOCTLS_GET
 #defineFREEBSD32_SYS_AUE_freebsd32_aio_mlock   AUE_NULL
 
 #undef PAD_

Modified: head/sys/compat/freebsd32/freebsd32_syscall.h
==
--- head/sys/compat/freebsd32/freebsd32_syscall.h   Sun Aug 18 10:30:41 
2013(r254481)
+++ head/sys/compat/freebsd32/freebsd32_syscall.h   Sun Aug 18 10:31:30 
2013(r254482)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 254447 
2013-08-17 14:17:13Z pjd 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 254481 
2013-08-18 10:30:41Z pjd 
  */
 
 #defineFREEBSD32_SYS_syscall   0
@@ -442,8 +442,8 @@
 #defineFREEBSD32_SYS_freebsd32_posix_fadvise   531
 #defineFREEBSD32_SYS_freebsd32_wait6   532
 #defineFREEBSD32_SYS_cap_rights_limit  533
-#defineFREEBSD32_SYS_cap_ioctls_limit  534
-#defineFREEBSD32_SYS_cap_ioctls_get535
+#defineFREEBSD32_SYS_freebsd32_cap_ioctls_limit534
+#defineFREEBSD32_SYS_freebsd32_cap_ioctls_get  535
 #defineFREEBSD32_SYS_cap_fcntls_limit  536
 #defineFREEBSD32_SYS_cap_fcntls_get537
 #defineFREEBSD32_SYS_bindat538

Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c
==
--- head/sys/compat/freebsd32/freebsd32_syscalls.c  Sun Aug 18 10:30:41 
2013(r254481)
+++ head/sys/compat/freebsd32/freebsd32_syscalls.c  Sun Aug 18 10:31:30 
2013(r254482)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 254447 
2013-08-17 14:17:13Z pjd 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 254481 
2013-08-18 10:30:41Z pjd 
  */
 
 const char *freebsd32_syscallnames[] = {
@@ -563,8 +563,8 @@ const char *freebsd32_syscallnames[] = {
   

svn commit: r254481 - in head/sys: compat/freebsd32 conf kern sys

2013-08-18 Thread Pawel Jakub Dawidek
Author: pjd
Date: Sun Aug 18 10:30:41 2013
New Revision: 254481
URL: http://svnweb.freebsd.org/changeset/base/254481

Log:
  Implement 32bit versions of the cap_ioctls_limit(2) and cap_ioctls_get(2)
  system calls as unsigned longs have different size on i386 and amd64.
  
  Reported by:  jilles
  Sponsored by: The FreeBSD Foundation

Added:
  head/sys/compat/freebsd32/freebsd32_capability.c   (contents, props changed)
Modified:
  head/sys/compat/freebsd32/syscalls.master
  head/sys/conf/files
  head/sys/kern/sys_capability.c
  head/sys/sys/syscallsubr.h

Added: head/sys/compat/freebsd32/freebsd32_capability.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/compat/freebsd32/freebsd32_capability.cSun Aug 18 10:30:41 
2013(r254481)
@@ -0,0 +1,153 @@
+/*-
+ * Copyright (c) 2013 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Pawel Jakub Dawidek under sponsorship from
+ * the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include "opt_capsicum.h"
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+
+#ifdef CAPABILITIES
+
+MALLOC_DECLARE(M_FILECAPS);
+
+int
+freebsd32_cap_ioctls_limit(struct thread *td,
+struct freebsd32_cap_ioctls_limit_args *uap)
+{
+   u_long *cmds;
+   uint32_t *cmds32;
+   size_t ncmds;
+   u_int i;
+   int error;
+
+   ncmds = uap->ncmds;
+
+   if (ncmds > 256)/* XXX: Is 256 sane? */
+   return (EINVAL);
+
+   if (ncmds == 0) {
+   cmds = NULL;
+   } else {
+   cmds32 = malloc(sizeof(cmds32[0]) * ncmds, M_FILECAPS, 
M_WAITOK);
+   error = copyin(uap->cmds, cmds32, sizeof(cmds32[0]) * ncmds);
+   if (error != 0) {
+   free(cmds32, M_FILECAPS);
+   return (error);
+   }
+   cmds = malloc(sizeof(cmds[0]) * ncmds, M_FILECAPS, M_WAITOK);
+   for (i = 0; i < ncmds; i++)
+   cmds[i] = cmds32[i];
+   free(cmds32, M_FILECAPS);
+   }
+
+   return (kern_cap_ioctls_limit(td, uap->fd, cmds, ncmds));
+}
+
+int
+freebsd32_cap_ioctls_get(struct thread *td,
+struct freebsd32_cap_ioctls_get_args *uap)
+{
+   struct filedesc *fdp;
+   struct filedescent *fdep;
+   uint32_t *cmds32;
+   u_long *cmds;
+   size_t maxcmds;
+   int error, fd;
+   u_int i;
+
+   fd = uap->fd;
+   cmds32 = uap->cmds;
+   maxcmds = uap->maxcmds;
+
+   AUDIT_ARG_FD(fd);
+
+   fdp = td->td_proc->p_fd;
+   FILEDESC_SLOCK(fdp);
+
+   if (fget_locked(fdp, fd) == NULL) {
+   error = EBADF;
+   goto out;
+   }
+
+   /*
+* If all ioctls are allowed (fde_nioctls == -1 && fde_ioctls == NULL)
+* the only sane thing we can do is to not populate the given array and
+* return CAP_IOCTLS_ALL (actually, INT_MAX).
+*/
+
+   fdep = &fdp->fd_ofiles[fd];
+   cmds = fdep->fde_ioctls;
+   if (cmds32 != NULL && cmds != NULL) {
+   for (i = 0; i < MIN(fdep->fde_nioctls, maxcmds); i++) {
+   error = suword32(&cmds32[i], cmds[i]);
+   if (error != 0)
+   goto out;
+   }
+   }
+   if (fdep->fde_nioctls == -1)
+   td->td_retval[0] = INT_MAX;
+   else
+   td->td_retval[0] = fdep->fde_nioctls;
+
+   error = 0;
+out:
+   FILEDESC_SUNLOCK(fdp);
+   return (error);
+}

svn commit: r254480 - in head/sys: amd64/conf i386/conf ia64/conf pc98/conf powerpc/conf sparc64/conf

2013-08-18 Thread Pawel Jakub Dawidek
Author: pjd
Date: Sun Aug 18 10:21:29 2013
New Revision: 254480
URL: http://svnweb.freebsd.org/changeset/base/254480

Log:
  Add process descriptors support to the GENERIC kernel. It is already being
  used by the tools in base systems and with sandboxing more and more tools
  the usage should only increase.
  
  Submitted by: Mariusz Zaborski 
  Sponsored by: Google Summer of Code 2013
  MFC after:1 month

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

Modified: head/sys/amd64/conf/GENERIC
==
--- head/sys/amd64/conf/GENERIC Sun Aug 18 09:45:52 2013(r254479)
+++ head/sys/amd64/conf/GENERIC Sun Aug 18 10:21:29 2013(r254480)
@@ -66,6 +66,7 @@ options   HWPMC_HOOKS # Necessary kernel
 optionsAUDIT   # Security event auditing
 optionsCAPABILITY_MODE # Capsicum capability mode
 optionsCAPABILITIES# Capsicum capabilities
+optionsPROCDESC# Support for process descriptors
 optionsMAC # TrustedBSD MAC Framework
 optionsKDTRACE_FRAME   # Ensure frames are compiled in
 optionsKDTRACE_HOOKS   # Kernel DTrace hooks

Modified: head/sys/i386/conf/GENERIC
==
--- head/sys/i386/conf/GENERIC  Sun Aug 18 09:45:52 2013(r254479)
+++ head/sys/i386/conf/GENERIC  Sun Aug 18 10:21:29 2013(r254480)
@@ -67,6 +67,7 @@ options   HWPMC_HOOKS # Necessary kernel
 optionsAUDIT   # Security event auditing
 optionsCAPABILITY_MODE # Capsicum capability mode
 optionsCAPABILITIES# Capsicum capabilities
+optionsPROCDESC# Support for process descriptors
 optionsMAC # TrustedBSD MAC Framework
 optionsKDTRACE_HOOKS   # Kernel DTrace hooks
 optionsDDB_CTF # Kernel ELF linker loads CTF data

Modified: head/sys/ia64/conf/GENERIC
==
--- head/sys/ia64/conf/GENERIC  Sun Aug 18 09:45:52 2013(r254479)
+++ head/sys/ia64/conf/GENERIC  Sun Aug 18 10:21:29 2013(r254480)
@@ -26,8 +26,8 @@ ident GENERIC
 makeoptionsDEBUG=-g# Build kernel with debug information.
 
 optionsAUDIT   # Security event auditing
-optionsCAPABILITY_MODE # Capsicum capability mode
-optionsCAPABILITIES# Capsicum capabilities
+optionsCAPABILITY_MODE # Capsicum capability mode
+optionsCAPABILITIES# Capsicum capabilities
 optionsCD9660  # ISO 9660 Filesystem
 optionsCOMPAT_FREEBSD7 # Compatible with FreeBSD7
 optionsFFS # Berkeley Fast Filesystem
@@ -46,6 +46,7 @@ options   NFS_ROOT# NFS usable as root d
 optionsP1003_1B_SEMAPHORES # POSIX-style semaphores
 optionsPREEMPTION  # Enable kernel thread preemption
 optionsPRINTF_BUFR_SIZE=128  # Printf buffering to limit interspersion
+optionsPROCDESC# Support for process descriptors
 optionsPROCFS  # Process filesystem (/proc)
 optionsPSEUDOFS# Pseudo-filesystem framework
 optionsSCHED_ULE   # ULE scheduler

Modified: head/sys/pc98/conf/GENERIC
==
--- head/sys/pc98/conf/GENERIC  Sun Aug 18 09:45:52 2013(r254479)
+++ head/sys/pc98/conf/GENERIC  Sun Aug 18 10:21:29 2013(r254480)
@@ -65,6 +65,7 @@ options   HWPMC_HOOKS # Necessary kernel
 optionsAUDIT   # Security event auditing
 optionsCAPABILITY_MODE # Capsicum capability mode
 optionsCAPABILITIES# Capsicum capabilities
+optionsPROCDESC# Support for process descriptors
 optionsMAC # TrustedBSD MAC Framework
 optionsINCLUDE_CONFIG_FILE # Include this file in kernel
 optionsKDB # Kernel debugger related code

Modified: head/sys/powerpc/conf/GENERIC
==
--- head/sys/powerpc/conf/GENERIC   Sun Aug 18 09:45:52 2013
(r254479)
+++ head/sys/powerpc/conf/GENERIC   Sun Aug 18 10:21:29 2013
(r254480)
@@ -69,6 +69,7 @@ options   HWPMC_HOOKS # Necessary kernel
 optionsAUDIT   # Security event auditing
 optionsCAPABILITY_MODE # Capsicum capability mode
 optionsCAPABILITIES# Capsicum capabilities
+options   

svn commit: r254479 - head/sys/sys

2013-08-18 Thread Pawel Jakub Dawidek
Author: pjd
Date: Sun Aug 18 09:45:52 2013
New Revision: 254479
URL: http://svnweb.freebsd.org/changeset/base/254479

Log:
  Better organize the filecaps structure, which reduces its size from 32 bytes
  to 24 bytes on 64bit archs.

Modified:
  head/sys/sys/filedesc.h

Modified: head/sys/sys/filedesc.h
==
--- head/sys/sys/filedesc.h Sun Aug 18 08:24:58 2013(r254478)
+++ head/sys/sys/filedesc.h Sun Aug 18 09:45:52 2013(r254479)
@@ -43,9 +43,9 @@
 
 struct filecaps {
cap_rights_t fc_rights; /* per-descriptor capability rights */
-   uint32_t fc_fcntls; /* per-descriptor allowed fcntls */
u_long  *fc_ioctls; /* per-descriptor allowed ioctls */
int16_t  fc_nioctls;/* fc_ioctls array size */
+   uint32_t fc_fcntls; /* per-descriptor allowed fcntls */
 };
 
 struct filedescent {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r254466 - in head/sys/amd64: amd64 include

2013-08-18 Thread Slawa Olhovchenkov
On Sat, Aug 17, 2013 at 07:49:08PM +, Neel Natu wrote:

> Author: neel
> Date: Sat Aug 17 19:49:08 2013
> New Revision: 254466
> URL: http://svnweb.freebsd.org/changeset/base/254466
> 
> Log:
>   Bump up the maximum addressable memory on amd64 systems from 1TB to 4TB.
>   Bump up the KVA size proportionally from 512GB to 2TB.
>   
>   The number of page table pages used by the direct map is now calculated at
>   run time based on 'Maxmem'. This means the small memory systems will not
>   see any additional tax in terms of page table pages for the direct map.
>   
>   However all amd64 systems, regardless of the memory size, will use 3 more
>   pages to accomodate the bump in the KVA size.
>   
>   More details available here:
>   http://lists.freebsd.org/pipermail/freebsd-hackers/2013-June/043015.html
>   http://lists.freebsd.org/pipermail/freebsd-current/2013-July/043143.html
>   
>   Tested with the following configurations:
>   - Sandybridge server with 64GB of memory.
>   - bhyve VM with 64MB of memory.
>   - bhyve VM with a 8GB of memory with the memory segment above 4GB cuddling
> right up against the 4TB maximum memory limit.
>   
>   Discussed on:   hackers@, current@
>   Submitted by:   Chris Torek (to...@torek.net)
> 
> Modified:
>   head/sys/amd64/amd64/pmap.c
>   head/sys/amd64/include/pmap.h
>   head/sys/amd64/include/vmparam.h

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