svn commit: r233419 - head/sys/x86/include

2012-03-24 Thread Dimitry Andric
Author: dim
Date: Sat Mar 24 10:07:21 2012
New Revision: 233419
URL: http://svn.freebsd.org/changeset/base/233419

Log:
  Fix the following clang warning in sys/dev/dcons/dcons.c, caused by the
  recent changes in sys/x86/include/endian.h:
  
sys/dev/dcons/dcons.c:190:15: error: implicit conversion from '__uint32_t' 
(aka 'unsigned int') to '__uint16_t' (aka 'unsigned short') changes value from 
1684238190 to 28526 [-Werror,-Wconstant-conversion]
  buf->magic = ntohl(DCONS_MAGIC);
   ^~
sys/sys/param.h:306:18: note: expanded from:
#define ntohl(x)__ntohl(x)
  ^
./x86/endian.h:128:20: note: expanded from:
#define __ntohl(x)  __bswap32(x)
  ^
./x86/endian.h:78:20: note: expanded from:
  __bswap32_gen((__uint32_t)(x)) : __bswap32_var(x))
^
./x86/endian.h:68:26: note: expanded from:
  (((__uint32_t)__bswap16(x) << 16) | __bswap16((x) >> 16))
  ^
./x86/endian.h:75:53: note: expanded from:
  __bswap16_gen((__uint16_t)(x)) : __bswap16_var(x)))
   ~ ^
  
  This is because the __bswapXX_gen() macros (for x86) call the regular
  __bswapXX() macros.  Since the __bswapXX_gen() variants are only called
  when their arguments are constant, there is no need to do that constancy
  check recursively.  Also, it causes the above error with clang.
  
  Fix it by calling __bswap16_gen() from __bswap32_gen(), and similarly,
  __bswap32_gen() from  __bswap64_gen().
  
  While here, add extra parentheses around the __bswap16_gen() macro
  expansion, to prevent unexpected side effects.

Modified:
  head/sys/x86/include/endian.h

Modified: head/sys/x86/include/endian.h
==
--- head/sys/x86/include/endian.h   Sat Mar 24 06:40:41 2012
(r233418)
+++ head/sys/x86/include/endian.h   Sat Mar 24 10:07:21 2012
(r233419)
@@ -63,11 +63,11 @@
 #defineBYTE_ORDER  _BYTE_ORDER
 #endif
 
-#define__bswap16_gen(x)(__uint16_t)((x) << 8 | (x) >> 8)
+#define__bswap16_gen(x)((__uint16_t)((x) << 8 | (x) >> 8))
 #define__bswap32_gen(x)\
-   (((__uint32_t)__bswap16(x) << 16) | __bswap16((x) >> 16))
+   (((__uint32_t)__bswap16_gen(x) << 16) | __bswap16_gen((x) >> 16))
 #define__bswap64_gen(x)\
-   (((__uint64_t)__bswap32(x) << 32) | __bswap32((x) >> 32))
+   (((__uint64_t)__bswap32_gen(x) << 32) | __bswap32_gen((x) >> 32))
 
 #ifdef __GNUCLIKE_BUILTIN_CONSTANT_P
 #define__bswap16(x)\
___
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: r233271 - in head/sys: amd64/conf arm/conf i386/conf ia64/conf mips/conf pc98/conf powerpc/conf sparc64/conf

2012-03-24 Thread Dimitry Andric
On 2012-03-21 09:38, Ed Schouten wrote:
> Author: ed
> Date: Wed Mar 21 08:38:42 2012
> New Revision: 233271
> URL: http://svn.freebsd.org/changeset/base/233271
> 
> Log:
>   Remove pty(4) from our kernel configurations.
>   
>   As of FreeBSD 8, this driver should not be used. Applications that use
>   posix_openpt(2) and openpty(3) use the pts(4) that is built into the
>   kernel unconditionally. If it turns out high profile depend on the
>   pty(4) module anyway, I'd rather get those fixed. So please report any
>   issues to me.
>   
>   The pty(4) module is still available as a kernel module of course, so a
>   simple `kldload pty' can be used to run old-style pseudo-terminals.

Please put at least a note in UPDATING... :)  I just ran into an old
program (compiled for FreeBSD 6 I think), that suddenly started failing
with 'Cannot allocate master pty'.

Maybe the compat ports could be updated to also enable loading of the
pty module?
___
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: r233421 - head/sys/sparc64/pci

2012-03-24 Thread Marius Strobl
Author: marius
Date: Sat Mar 24 13:11:58 2012
New Revision: 233421
URL: http://svn.freebsd.org/changeset/base/233421

Log:
  Given that this is a host-PCI-Express bridge driver, create the parent
  DMA tag with a 4 GB boundary as required by PCI-Express. With r232403 in
  place this actually is redundant. However, the host-PCI-Express bridge
  driver is the more appropriate place for implementing this restriction.
  
  MFC after:3 days

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

Modified: head/sys/sparc64/pci/fire.c
==
--- head/sys/sparc64/pci/fire.c Sat Mar 24 10:19:40 2012(r233420)
+++ head/sys/sparc64/pci/fire.c Sat Mar 24 13:11:58 2012(r233421)
@@ -764,7 +764,7 @@ fire_attach(device_t dev)
if (sc->sc_pci_cfgt == NULL)
panic("%s: could not allocate PCI configuration space tag",
__func__);
-   if (bus_dma_tag_create(bus_get_dma_tag(dev), 8, 0,
+   if (bus_dma_tag_create(bus_get_dma_tag(dev), 8, 0x1,
sc->sc_is.is_pmaxaddr, ~0, NULL, NULL, sc->sc_is.is_pmaxaddr,
0xff, 0x, 0, NULL, NULL, &sc->sc_pci_dmat) != 0)
panic("%s: could not create PCI DMA tag", __func__);
___
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: r233422 - in head/share/man: man4 man4/man4.powerpc man7 man9

2012-03-24 Thread Joel Dahl
Author: joel (doc committer)
Date: Sat Mar 24 13:37:57 2012
New Revision: 233422
URL: http://svn.freebsd.org/changeset/base/233422

Log:
  Remove superfluous paragraph macro.

Modified:
  head/share/man/man4/acpi_hp.4
  head/share/man/man4/adv.4
  head/share/man/man4/ahc.4
  head/share/man/man4/atkbd.4
  head/share/man/man4/bridge.4
  head/share/man/man4/cas.4
  head/share/man/man4/cc_vegas.4
  head/share/man/man4/cy.4
  head/share/man/man4/dpms.4
  head/share/man/man4/ed.4
  head/share/man/man4/em.4
  head/share/man/man4/epair.4
  head/share/man/man4/fdc.4
  head/share/man/man4/fwohci.4
  head/share/man/man4/gem.4
  head/share/man/man4/geom_fox.4
  head/share/man/man4/geom_uzip.4
  head/share/man/man4/hptiop.4
  head/share/man/man4/igb.4
  head/share/man/man4/ip.4
  head/share/man/man4/isp.4
  head/share/man/man4/man4.powerpc/bm.4
  head/share/man/man4/man4.powerpc/snd_ai2s.4
  head/share/man/man4/man4.powerpc/snd_davbus.4
  head/share/man/man4/netmap.4
  head/share/man/man4/ng_netflow.4
  head/share/man/man4/nvram2env.4
  head/share/man/man4/oce.4
  head/share/man/man4/ppbus.4
  head/share/man/man4/snd_emu10kx.4
  head/share/man/man4/snd_hda.4
  head/share/man/man4/u3g.4
  head/share/man/man7/mailaddr.7
  head/share/man/man9/DB_COMMAND.9
  head/share/man/man9/fail.9
  head/share/man/man9/lock.9
  head/share/man/man9/locking.9
  head/share/man/man9/make_dev.9

Modified: head/share/man/man4/acpi_hp.4
==
--- head/share/man/man4/acpi_hp.4   Sat Mar 24 13:11:58 2012
(r233421)
+++ head/share/man/man4/acpi_hp.4   Sat Mar 24 13:37:57 2012
(r233422)
@@ -244,7 +244,6 @@ Set maximum detail level for /dev/hpcmi 
 .Bd -literal -offset indent
 sysctl dev.acpi_hp.0.cmi_detail=7
 .Ed
-.Pp
 .Sh SEE ALSO
 .Xr acpi 4 ,
 .Xr acpi_wmi 4 ,

Modified: head/share/man/man4/adv.4
==
--- head/share/man/man4/adv.4   Sat Mar 24 13:11:58 2012(r233421)
+++ head/share/man/man4/adv.4   Sat Mar 24 13:37:57 2012(r233422)
@@ -66,7 +66,6 @@ host adapter chips.
 The following tables list the AdvanSys products using these chips,
 their bus attachment type, maximum sync rate, and the maximum number of
 commands that can be handled by the adapter concurrently.
-.Pp
 .Bd -ragged -offset indent
 .Bl -column "ABP510/5150 " "ISA PnP " "Yes " "10MHz " "Commands " Footnotes
 Connectivity Products:
@@ -104,7 +103,6 @@ This board has been sold by SIIG as the 
 This board has been sold by SIIG as the Fast SCSI Pro PCI.
 .El
 .Ed
-.Pp
 .Bd -ragged -offset indent
 .Bl -column "ABP510/5150 " "ISA PnP " "Yes " "10MHz " Commands
 Single Channel Products:
@@ -121,7 +119,6 @@ ABP970PCI No 10MHz  
 ABP970U   PCI No 20MHz   240
 .El
 .Ed
-.Pp
 .Bd -ragged -offset indent
 .Bl -column "ABP510/5150 " "ISA PnP " "Yes " "10MHz " "Commands " "Channels "
 Multi Channel Products (Commands are per-channel):

Modified: head/share/man/man4/ahc.4
==
--- head/share/man/man4/ahc.4   Sat Mar 24 13:11:58 2012(r233421)
+++ head/share/man/man4/ahc.4   Sat Mar 24 13:37:57 2012(r233422)
@@ -146,7 +146,6 @@ driver.
 Note that wide and twin channel features, although always supported
 by a particular chip, may be disabled in a particular motherboard or card
 design.
-.Pp
 .Bd -ragged -offset indent
 .Bl -column "aic7770 " "10 " "EISA/VL  " "10MHz " "16bit " "SCBs " Features
 .Em "Chip   MIPSBus  MaxSync   MaxWidth  SCBs  Features"

Modified: head/share/man/man4/atkbd.4
==
--- head/share/man/man4/atkbd.4 Sat Mar 24 13:11:58 2012(r233421)
+++ head/share/man/man4/atkbd.4 Sat Mar 24 13:37:57 2012(r233422)
@@ -144,7 +144,6 @@ command.
 This option will disable this feature and prevent the user from
 changing key assignment.
 .El
-.Pp
 .Ss Driver Flags
 The
 .Nm

Modified: head/share/man/man4/bridge.4
==
--- head/share/man/man4/bridge.4Sat Mar 24 13:11:58 2012
(r233421)
+++ head/share/man/man4/bridge.4Sat Mar 24 13:37:57 2012
(r233422)
@@ -167,7 +167,6 @@ by enabling the
 .Va net.link.bridge.log_stp
 variable using
 .Xr sysctl 8 .
-.Pp
 .Sh PACKET FILTERING
 Packet filtering can be used with any firewall package that hooks in via the
 .Xr pfil 9

Modified: head/share/man/man4/cas.4
==
--- head/share/man/man4/cas.4   Sat Mar 24 13:11:58 2012(r233421)
+++ head/share/man/man4/cas.4   Sat Mar 24 13:37:57 2012(r233422)
@@ -70,7 +70,6 @@ Selecting an MTU larger than 1500 bytes 
 .Xr ifconfig 8
 utility configures the adapter to receive and transmit Jumbo Frames.
 .Sh HARDWARE
-.P

svn commit: r233423 - head/sys/dev/e1000

2012-03-24 Thread Marius Strobl
Author: marius
Date: Sat Mar 24 15:15:34 2012
New Revision: 233423
URL: http://svn.freebsd.org/changeset/base/233423

Log:
  Initialize the mutexes used for the NVM and the swflag as MTX_DUPOK in
  order to avoid otherwise harmless witness warnings when these are acquired
  at the same time and due to both using MTX_NETWORK_LOCK as their type.
  The right fix actually would be to use different, descriptive types for
  these. However, the latter would require undesirable changes to the shared
  code base. Another approach would be to just supply NULL as the type, which
  was deemed as less desirable though as it would cause the unique but cryptic
  name also to be used for the type and to diverge from the type used by other
  network device drivers.
  
  MFC after:1 week

Modified:
  head/sys/dev/e1000/e1000_osdep.h

Modified: head/sys/dev/e1000/e1000_osdep.h
==
--- head/sys/dev/e1000/e1000_osdep.hSat Mar 24 13:37:57 2012
(r233422)
+++ head/sys/dev/e1000/e1000_osdep.hSat Mar 24 15:15:34 2012
(r233423)
@@ -84,7 +84,8 @@
 /* Mutex used in the shared code */
 #define E1000_MUTEX struct mtx
 #define E1000_MUTEX_INIT(mutex) mtx_init((mutex), #mutex, \
-MTX_NETWORK_LOCK, MTX_DEF)
+MTX_NETWORK_LOCK, \
+MTX_DEF | MTX_DUPOK)
 #define E1000_MUTEX_DESTROY(mutex)  mtx_destroy(mutex)
 #define E1000_MUTEX_LOCK(mutex) mtx_lock(mutex)
 #define E1000_MUTEX_TRYLOCK(mutex)  mtx_trylock(mutex)
___
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: r233424 - head/lib/libusb

2012-03-24 Thread Joel Dahl
Author: joel (doc committer)
Date: Sat Mar 24 15:17:18 2012
New Revision: 233424
URL: http://svn.freebsd.org/changeset/base/233424

Log:
  Minor mdoc fixes.

Modified:
  head/lib/libusb/libusb.3

Modified: head/lib/libusb/libusb.3
==
--- head/lib/libusb/libusb.3Sat Mar 24 15:15:34 2012(r233423)
+++ head/lib/libusb/libusb.3Sat Mar 24 15:17:18 2012(r233424)
@@ -43,7 +43,6 @@ The
 library contains interfaces for directly managing a usb device.
 The current implementation supports v1.0 of the libusb API.
 .Sh LIBRARY INITIALISATION / DEINITIALISATION
-.Pp
 .Ft int
 .Fn libusb_init libusb_context **ctx
 This function initialises libusb.
@@ -270,9 +269,7 @@ LIBUSB_ERROR_NO_DEVICE
 if the device has been disconnected, LIBUSB_ERROR_BUSY if the driver cannot be
 attached because the interface is claimed by a program or driver and a
 LIBUSB_ERROR code on failure.
-.Pp
 .Sh USB DESCRIPTORS
-.Pp
 .Ft int
 .Fn libusb_get_device_descriptor "libusb_device *dev" 
"libusb_device_descriptor *desc"
 Get the USB device descriptor for the device
@@ -349,9 +346,7 @@ libusb_free_bos_descriptor function.
 .Ft void
 .Fn libusb_free_bos_descriptor "libusb_bos_descriptor *bos"
 This function is NULL safe and frees a parsed BOS descriptor.
-.Pp
 .Sh USB ASYNCHRONOUS I/O
-.Pp
 .Ft struct libusb_transfer *
 .Fn libusb_alloc_transfer "int iso_packets"
 Allocate a transfer with the number of isochronous packet descriptors
@@ -374,9 +369,7 @@ LIBUSB_ERROR code on other failure.
 .Fn libusb_cancel_transfer "struct libusb_transfer *tr"
 This function asynchronously cancels a transfer.
 Returns 0 on success and a LIBUSB_ERROR code on failure.
-.Pp
 .Sh USB SYNCHRONOUS I/O
-.Pp
 .Ft int
 .Fn libusb_control_transfer "libusb_device_handle *devh" "uint8_t 
bmRequestType" "uint8_t bRequest" "uint16_t wValue" "uint16_t wIndex" "unsigned 
char *data" "uint16_t wLength" "unsigned int timeout"
 Perform a USB control transfer.
@@ -411,9 +404,7 @@ if the transfer timed out, LIBUSB_ERROR_
 supported, LIBUSB_ERROR_OVERFLOW if the device offered more data,
 LIBUSB_ERROR_NO_DEVICE if the device has been disconnected and
 a LIBUSB_ERROR code on other failure.
-.Pp
 .Sh USB EVENTS
-.Pp
 .Ft int
 .Fn libusb_try_lock_events "libusb_context *ctx"
 Try to acquire the event handling lock.
@@ -429,7 +420,7 @@ This function is blocking.
 Release the event handling lock.
 This will wake up any thread blocked
 on
-.B libusb_wait_for_event() .
+.Fn libusb_wait_for_event .
 .Pp
 .Ft int
 .Fn libusb_event_handling_ok "libusb_context *ctx"
@@ -506,7 +497,6 @@ Retrive a list of file descriptors that 
 libusb event sources.
 Returns a NULL-terminated list on success or NULL on failure.
 .Sh LIBUSB VERSION 0.1 COMPATIBILITY
-.Pp
 The library is also compliant with LibUSB version 0.1.12.
 .Pp
 .Fn usb_open
___
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: r233391 - head/contrib/libstdc++/libsupc++

2012-03-24 Thread Alexander Kabaev
On Fri, 23 Mar 2012 23:39:44 +
David Chisnall  wrote:

> On 23 Mar 2012, at 21:10, Konstantin Belousov wrote:
> 
> > The patch just committed made the base-shipped library incompatible
> > with the ports and manual libstdc++ builds.
> 
> To clarify - the one shipped in the base system has been incompatible
> with the one in ports since late 2007...
>
That says something about the extend of the breakage, does it not?
 
> In future, however, we will want libstdc++ in ports to be using the
> system ABI library (e.g. libcxxrt) so that it can be linked with
> libraries using the system C++ stack, so the layout of std::type_info
> in its headers doesn't matter too much because it won't be used.
> 
> > I think it is wiser to
> > not 'undo the undo', and instead start living with the
> > upstream-approved ABI. For symvered library, it does not make any
> > difference if you break it in 10.0 or 9.1.
> 
> Not true.  The vtable layout can not be symbol versioned
> effectively.  The std::type_info class is required by the ABI to
> exist (and is in libsupc++ / libcxxrt, so is independent of our STL
> implementation, either libstdc++ or libc++).  Users expect to be able
> to cast 
> 
> > Also, I think that consumers that depend of the ABI of
> > std::typeinfo can be hacked to understand the layout of vtable.
> 
> Supporting both layouts is not really tenable.  We need to do one of
> the following:
> 
> - Say 'we are going to break this now!' and force people to recompile
> libsupc++, libcxxrt, and libobjc2.
> - Keep the layout that we currently ship and patch  in
> ports.
> 
> I don't mind which of these we do since I'm not the one that has to
> do the work in ensuring compatibility with ports but it will need to
> pick one and then stick to it...
> 
> > I doubt that there are
> > many users that utilize typeinfo.
> 
> Yes, to my knowledge there are three, and two of them are me :-(
> 

I will support the switch to 'default' ABI used upstream, provided
David is onboard. The breakage is very limited at the moment and
can only grow over time, so will grow the pain, while we insist on being
diverged from GCC. We might as well bite the bullet and live through
this at the cost of 9.1 release errata that only affects libobjc2.


-- 
Alexander Kabaev


signature.asc
Description: PGP signature


svn commit: r233425 - head/sys/dev/mpt/mpilib

2012-03-24 Thread Marius Strobl
Author: marius
Date: Sat Mar 24 16:23:21 2012
New Revision: 233425
URL: http://svn.freebsd.org/changeset/base/233425

Log:
  Consistently update to the MPI header set version 01.05.20 after r224761.
  Requested by: mjacob
  
  MFC after:1 week

Added:
  head/sys/dev/mpt/mpilib/mpi_log_fc.h   (contents, props changed)
  head/sys/dev/mpt/mpilib/mpi_log_sas.h   (contents, props changed)
Deleted:
  head/sys/dev/mpt/mpilib/mpi_inb.h
Modified:
  head/sys/dev/mpt/mpilib/mpi.h
  head/sys/dev/mpt/mpilib/mpi_cnfg.h
  head/sys/dev/mpt/mpilib/mpi_fc.h
  head/sys/dev/mpt/mpilib/mpi_init.h
  head/sys/dev/mpt/mpilib/mpi_ioc.h
  head/sys/dev/mpt/mpilib/mpi_lan.h
  head/sys/dev/mpt/mpilib/mpi_raid.h
  head/sys/dev/mpt/mpilib/mpi_sas.h
  head/sys/dev/mpt/mpilib/mpi_targ.h
  head/sys/dev/mpt/mpilib/mpi_tool.h
  head/sys/dev/mpt/mpilib/mpi_type.h

Modified: head/sys/dev/mpt/mpilib/mpi.h
==
--- head/sys/dev/mpt/mpilib/mpi.h   Sat Mar 24 15:17:18 2012
(r233424)
+++ head/sys/dev/mpt/mpilib/mpi.h   Sat Mar 24 16:23:21 2012
(r233425)
@@ -1,6 +1,6 @@
 /* $FreeBSD$ */
 /*-
- * Copyright (c) 2000-2005, LSI Logic Corporation and its contributors.
+ * Copyright (c) 2000-2010, LSI Logic Corporation and its contributors.
  * All rights reserved.
  * 
  * Redistribution and use in source and binary forms, with or without
@@ -33,7 +33,7 @@
  *  Title:  MPI Message independent structures and definitions
  *  Creation Date:  July 27, 2000
  *
- *mpi.h Version:  01.05.13
+ *mpi.h Version:  01.05.17
  *
  *  Version History
  *  ---
@@ -106,6 +106,10 @@
  *  03-27-06  01.05.11  Bumped MPI_HEADER_VERSION_UNIT.
  *  10-11-06  01.05.12  Bumped MPI_HEADER_VERSION_UNIT.
  *  05-24-07  01.05.13  Bumped MPI_HEADER_VERSION_UNIT.
+ *  08-07-07  01.05.14  Bumped MPI_HEADER_VERSION_UNIT.
+ *  01-15-08  01.05.15  Bumped MPI_HEADER_VERSION_UNIT.
+ *  03-28-08  01.05.16  Bumped MPI_HEADER_VERSION_UNIT.
+ *  07-11-08  01.05.17  Bumped MPI_HEADER_VERSION_UNIT.
  *  --
  */
 
@@ -136,7 +140,7 @@
 /* Note: The major versions of 0xe0 through 0xff are reserved */
 
 /* versioning for this MPI header set */
-#define MPI_HEADER_VERSION_UNIT (0x10)
+#define MPI_HEADER_VERSION_UNIT (0x14)
 #define MPI_HEADER_VERSION_DEV  (0x00)
 #define MPI_HEADER_VERSION_UNIT_MASK(0xFF00)
 #define MPI_HEADER_VERSION_UNIT_SHIFT   (8)

Modified: head/sys/dev/mpt/mpilib/mpi_cnfg.h
==
--- head/sys/dev/mpt/mpilib/mpi_cnfg.h  Sat Mar 24 15:17:18 2012
(r233424)
+++ head/sys/dev/mpt/mpilib/mpi_cnfg.h  Sat Mar 24 16:23:21 2012
(r233425)
@@ -1,6 +1,6 @@
 /* $FreeBSD$ */
 /*-
- * Copyright (c) 2000-2005, LSI Logic Corporation and its contributors.
+ * Copyright (c) 2000-2010, LSI Logic Corporation and its contributors.
  * All rights reserved.
  * 
  * Redistribution and use in source and binary forms, with or without
@@ -33,7 +33,7 @@
  *  Title:  MPI Config message, structures, and Pages
  *  Creation Date:  July 27, 2000
  *
- *mpi_cnfg.h Version:  01.05.15
+ *mpi_cnfg.h Version:  01.05.19
  *
  *  Version History
  *  ---
@@ -335,6 +335,28 @@
  *  Expander Page 0 Flags field.
  *  Fixed define for
  *  MPI_SAS_EXPANDER1_DISCINFO_BAD_PHY_DISABLED.
+ *  08-07-07  01.05.16  Added MPI_IOCPAGE6_CAP_FLAGS_MULTIPORT_DRIVE_SUPPORT
+ *  define.
+ *  Added BIOS Page 4 structure.
+ *  Added MPI_RAID_PHYS_DISK1_PATH_MAX define for RAID
+ *  Physcial Disk Page 1.
+ *  01-15-07  01.05.17  Added additional bit defines for ExtFlags field of
+ *  Manufacturing Page 4.
+ *  Added Solid State Drives Supported bit to IOC Page 6
+ *  Capabilities Flags.
+ *  Added new value for AccessStatus field of SAS Device
+ *  Page 0 (_SATA_NEEDS_INITIALIZATION).
+ *  03-28-08  01.05.18  Defined new bits in Manufacturing Page 4 ExtFlags field
+ *  to control coercion size and the mixing of SAS and SATA
+ *  SSD drives.
+ *  07-11-08  01.05.19  Added defines MPI_MANPAGE4_EXTFLAGS_RAID0_SINGLE_DRIVE
+ *  and MPI_MANPAGE4_EXTFLAGS_SSD_SCRUB_DISABLE for 
ExtFlags
+ *  field of Manufacturing Page 4.
+ *  Added defines for a new bit in BIOS Page 1 BiosOptions
+ *  field to control adapter scan order.
+ *  Added BootDeviceWaitTime field to SAS IO Unit Page 2.
+ *  Added MPI_SAS_PHY0_PHYINFO_PHY_VACANT for use in 
PhyInfo
+ *  field of SAS Expander Page

Re: svn commit: r233419 - head/sys/x86/include

2012-03-24 Thread Bruce Evans

On Sat, 24 Mar 2012, Dimitry Andric wrote:


Log:
 Fix the following clang warning in sys/dev/dcons/dcons.c, caused by the
 recent changes in sys/x86/include/endian.h:

   sys/dev/dcons/dcons.c:190:15: error: implicit conversion from '__uint32_t' 
(aka 'unsigned int') to '__uint16_t' (aka 'unsigned short') changes value from 
1684238190 to 28526 [-Werror,-Wconstant-conversion]

  buf->magic = ntohl(DCONS_MAGIC);
   ^~
   sys/sys/param.h:306:18: note: expanded from:
   #define ntohl(x)__ntohl(x)
  ^
   ./x86/endian.h:128:20: note: expanded from:
   #define __ntohl(x)  __bswap32(x)
  ^
   ./x86/endian.h:78:20: note: expanded from:
  __bswap32_gen((__uint32_t)(x)) : __bswap32_var(x))
^
   ./x86/endian.h:68:26: note: expanded from:
  (((__uint32_t)__bswap16(x) << 16) | __bswap16((x) >> 16))
  ^
   ./x86/endian.h:75:53: note: expanded from:
  __bswap16_gen((__uint16_t)(x)) : __bswap16_var(x)))
   ~ ^


This warning was discussed before things were committed.  gcc gives a
similar warning, but according to tijl, it can't happen in normal use
with either gcc or clang because -Wno-system-headers suppresses warnings
in system headers.  -Wnosystem-headers is the default in the kernel,
where the above problem happens, so I don't see how it happens.
However, bsd.sys.mk forces the non-default of -Wsystem-headers in
userland at WARNS >= 1, so I don't see why there isn't a problem in
userland if userland actually uses an expression like
ntohl(DCONS_MAGIC).


 This is because the __bswapXX_gen() macros (for x86) call the regular
 __bswapXX() macros.  Since the __bswapXX_gen() variants are only called
 when their arguments are constant, there is no need to do that constancy
 check recursively.  Also, it causes the above error with clang.


Not true.  The __bswapXX_gen() are called with non-constant args from
__bswap64_var() in the i386 case.  As documented there, it is important
for optimizations that __bswap64_gen() does do the constancy check
recursively.  This was discussed before things were committed, and
again when jhb siggested breaking it similarly to this commit to avoid
a problem on ia64.


 Fix it by calling __bswap16_gen() from __bswap32_gen(), and similarly,
 __bswap32_gen() from  __bswap64_gen().


This breaks it.  DIring development, I had a correct fix involving
casting down the arg.


 While here, add extra parentheses around the __bswap16_gen() macro
 expansion, to prevent unexpected side effects.


These parentheses were intentionally left out for clarity.
__bswap16_gen() is not user-serving, and all places in endian.h that
use it supply enough parentheses.


Modified:
 head/sys/x86/include/endian.h

Modified: head/sys/x86/include/endian.h
==
--- head/sys/x86/include/endian.h   Sat Mar 24 06:40:41 2012
(r233418)
+++ head/sys/x86/include/endian.h   Sat Mar 24 10:07:21 2012
(r233419)
@@ -63,11 +63,11 @@
#define BYTE_ORDER  _BYTE_ORDER
#endif

-#define__bswap16_gen(x)(__uint16_t)((x) << 8 | (x) >> 8)
+#define__bswap16_gen(x)((__uint16_t)((x) << 8 | (x) >> 8))
#define __bswap32_gen(x)\
-   (((__uint32_t)__bswap16(x) << 16) | __bswap16((x) >> 16))
+   (((__uint32_t)__bswap16_gen(x) << 16) | __bswap16_gen((x) >> 16))
#define __bswap64_gen(x)\
-   (((__uint64_t)__bswap32(x) << 32) | __bswap32((x) >> 32))
+   (((__uint64_t)__bswap32_gen(x) << 32) | __bswap32_gen((x) >> 32))

#ifdef __GNUCLIKE_BUILTIN_CONSTANT_P
#define __bswap16(x)\


Hmm, __bswap32_gen() and __bswap64_gen() were sloppy about leaving out
the parentheses.  They have unnecssary (?) parentheses around the whole
expression.  These parentheses are a bit more needed than for
__bswap16_gen(), since '(cast)(expr)' rarely needs more while 'foo | bar'
often does.   These functions also have unnecessary and
style-conflicting parentheses around the '<<' expression.  Such
parentheses are not used for either the '<<' or the '>>' expression
for __bswap16_gen().  They are needed for parameter passing for the
other 2 '>>' expressions.

Bruce
___
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: r233426 - head/share/man/man4

2012-03-24 Thread Marius Strobl
Author: marius
Date: Sat Mar 24 18:06:48 2012
New Revision: 233426
URL: http://svn.freebsd.org/changeset/base/233426

Log:
  Add QGE-X to the list of known-working cards.
  
  MFC after:1 week

Modified:
  head/share/man/man4/cas.4

Modified: head/share/man/man4/cas.4
==
--- head/share/man/man4/cas.4   Sat Mar 24 16:23:21 2012(r233425)
+++ head/share/man/man4/cas.4   Sat Mar 24 18:06:48 2012(r233426)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 3, 2010
+.Dd March 24, 2012
 .Dt CAS 4
 .Os
 .Sh NAME
@@ -101,6 +101,9 @@ Sun GigaSwift Ethernet UTP (GCS)
 .It
 Sun Quad GigaSwift Ethernet UTP (QGE)
 (part no.\& 501-6522)
+.It
+Sun Quad GigaSwift Ethernet PCI-X (QGE-X)
+(part no.\& 501-6738)
 .El
 .Sh NOTES
 On sparc64 the
___
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: r233427 - in head/sys: amd64/conf i386/conf

2012-03-24 Thread Marius Strobl
Author: marius
Date: Sat Mar 24 18:08:28 2012
New Revision: 233427
URL: http://svn.freebsd.org/changeset/base/233427

Log:
  Add cas(4), gem(4) and hme(4) to x86 GENERICs as suggested by netchild@ in
  <20120222095239.horde.0hpyhjjmrsrprkzxsofr...@webmail.leidinger.net>.
  According to some private emails received, it apparently is not unpopular
  to use at least Quad GigaSwift cards driven by cas(4) in x86 machines.
  
  MFC after:1 week

Modified:
  head/sys/amd64/conf/GENERIC
  head/sys/i386/conf/GENERIC

Modified: head/sys/amd64/conf/GENERIC
==
--- head/sys/amd64/conf/GENERIC Sat Mar 24 18:06:48 2012(r233426)
+++ head/sys/amd64/conf/GENERIC Sat Mar 24 18:08:28 2012(r233427)
@@ -218,9 +218,12 @@ device ale # Atheros 
AR8121/AR8113/AR8
 device bce # Broadcom BCM5706/BCM5708 Gigabit Ethernet
 device bfe # Broadcom BCM440x 10/100 Ethernet
 device bge # Broadcom BCM570xx Gigabit Ethernet
+device cas # Sun Cassini/Cassini+ and NS DP83065 Saturn
 device dc  # DEC/Intel 21143 and various workalikes
 device et  # Agere ET1310 10/100/Gigabit Ethernet
 device fxp # Intel EtherExpress PRO/100B (82557, 82558)
+device gem # Sun GEM/Sun ERI/Apple GMAC
+device hme # Sun HME (Happy Meal Ethernet)
 device jme # JMicron JMC250 Gigabit/JMC260 Fast Ethernet
 device lge # Level 1 LXT1001 gigabit Ethernet
 device msk # Marvell/SysKonnect Yukon II Gigabit Ethernet

Modified: head/sys/i386/conf/GENERIC
==
--- head/sys/i386/conf/GENERIC  Sat Mar 24 18:06:48 2012(r233426)
+++ head/sys/i386/conf/GENERIC  Sat Mar 24 18:08:28 2012(r233427)
@@ -228,9 +228,12 @@ device ale # Atheros 
AR8121/AR8113/AR8
 device bce # Broadcom BCM5706/BCM5708 Gigabit Ethernet
 device bfe # Broadcom BCM440x 10/100 Ethernet
 device bge # Broadcom BCM570xx Gigabit Ethernet
+device cas # Sun Cassini/Cassini+ and NS DP83065 Saturn
 device dc  # DEC/Intel 21143 and various workalikes
 device et  # Agere ET1310 10/100/Gigabit Ethernet
 device fxp # Intel EtherExpress PRO/100B (82557, 82558)
+device gem # Sun GEM/Sun ERI/Apple GMAC
+device hme # Sun HME (Happy Meal Ethernet)
 device jme # JMicron JMC250 Gigabit/JMC260 Fast Ethernet
 device lge # Level 1 LXT1001 gigabit Ethernet
 device msk # Marvell/SysKonnect Yukon II Gigabit Ethernet
___
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: r233428 - head/share/examples/cvsup

2012-03-24 Thread Eitan Adler
Author: eadler
Date: Sat Mar 24 18:25:16 2012
New Revision: 233428
URL: http://svn.freebsd.org/changeset/base/233428

Log:
  Direct users to csup instead of cvsup in the csup-file boilerplate text.
  
  Reviewed by:  maxim, des, swills
  Approved by:  cperciva
  MFC after:3 days

Modified:
  head/share/examples/cvsup/cvs-supfile
  head/share/examples/cvsup/doc-supfile
  head/share/examples/cvsup/gnats-supfile
  head/share/examples/cvsup/ports-supfile
  head/share/examples/cvsup/stable-supfile
  head/share/examples/cvsup/standard-supfile
  head/share/examples/cvsup/www-supfile

Modified: head/share/examples/cvsup/cvs-supfile
==
--- head/share/examples/cvsup/cvs-supfile   Sat Mar 24 18:08:28 2012
(r233427)
+++ head/share/examples/cvsup/cvs-supfile   Sat Mar 24 18:25:16 2012
(r233428)
@@ -3,19 +3,16 @@
 # This file contains all of the "CVSup collections" that make up the
 # CVS development tree of the FreeBSD system.
 #
-# CVSup (CVS Update Protocol) allows you to download the latest CVS
+# csup (CVS Update Protocol) allows you to download the latest CVS
 # tree (or any branch of development therefrom) to your system easily
-# and efficiently (far more so than with sup, which CVSup is aimed
-# at replacing).  If you're running CVSup interactively, and are
-# currently using an X display server, you should run CVSup as follows
-# to keep your CVS tree up-to-date:
+# and efficiently
 #
-#  cvsup cvs-supfile
+# To keep your CVS tree up-to-date run:
 #
-# If not running X, or invoking cvsup from a non-interactive script, then
-# run it as follows:
+#  csup cvs-supfile
 #
-#  cvsup -g -L 2 cvs-supfile
+# Note that this only updates the tree contents and does not
+# update what is actually installed.
 #
 # You may wish to change some of the settings in this file to better
 # suit your system:
@@ -29,7 +26,7 @@
 #  with cvsup's "-h host" option.
 #
 # base=/var/db
-#  This specifies the root where CVSup will store information
+#  This specifies the root where csup will store information
 #  about the collections you have transferred to your system.
 #  A setting of "/var/db" will generate this information in
 #  /var/db/sup.  You can override the "base" setting on the

Modified: head/share/examples/cvsup/doc-supfile
==
--- head/share/examples/cvsup/doc-supfile   Sat Mar 24 18:08:28 2012
(r233427)
+++ head/share/examples/cvsup/doc-supfile   Sat Mar 24 18:25:16 2012
(r233428)
@@ -3,19 +3,16 @@
 # This file contains all of the "CVSup collections" that make up the
 # source of the FreeBSD doc tree
 #
-# CVSup (CVS Update Protocol) allows you to download the latest CVS
+# csup (CVS Update Protocol) allows you to download the latest CVS
 # tree (or any branch of development therefrom) to your system easily
-# and efficiently (far more so than with sup, which CVSup is aimed
-# at replacing).  If you're running CVSup interactively, and are
-# currently using an X display server, you should run CVSup as follows
-# to keep your CVS tree up-to-date:
+# and efficiently
 #
-#  cvsup doc-supfile
+# To keep your CVS tree up-to-date run:
 #
-# If not running X, or invoking cvsup from a non-interactive script, then
-# run it as follows:
+#  csup doc-supfile
 #
-#  cvsup -g -L 2 doc-supfile
+# Note that this only updates the tree contents and does not
+# update what is actually installed.
 #
 # You may wish to change some of the settings in this file to better
 # suit your system:
@@ -29,7 +26,7 @@
 #  with cvsup's "-h host" option.
 #
 # base=/var/db
-#  This specifies the root where CVSup will store information
+#  This specifies the root where csup will store information
 #  about the collections you have transferred to your system.
 #  A setting of "/var/db" will generate this information in
 #  /var/db/sup.  You can override the "base" setting on the

Modified: head/share/examples/cvsup/gnats-supfile
==
--- head/share/examples/cvsup/gnats-supfile Sat Mar 24 18:08:28 2012
(r233427)
+++ head/share/examples/cvsup/gnats-supfile Sat Mar 24 18:25:16 2012
(r233428)
@@ -3,19 +3,16 @@
 # This file contains all of the "CVSup collections" that make up the
 # FreeBSD GNATS bug report database.
 #
-# CVSup (CVS Update Protocol) allows you to download the latest CVS
+# csup (CVS Update Protocol) allows you to download the latest CVS
 # tree (or any branch of development therefrom) to your system easily
-# and efficiently (far more so than with sup, which CVSup is aimed
-# at replacing).  If you're running CVSup interactively, and are
-# currently using an X display server, you sh

svn commit: r233429 - in head: etc/root share/examples share/examples/csh

2012-03-24 Thread Eitan Adler
Author: eadler
Date: Sat Mar 24 18:43:18 2012
New Revision: 233429
URL: http://svn.freebsd.org/changeset/base/233429

Log:
  - Make the default values for tcsh more user friendly
  - Add an examples file with many of the not accepted suggestions from the 
discussion
  
  PR:   conf/160689
  Reviewed by:  many
  Discussed on: current
  Approved by:  cperciva

Added:
  head/share/examples/csh/
  head/share/examples/csh/dot.cshrc   (contents, props changed)
Modified:
  head/etc/root/dot.cshrc
  head/share/examples/Makefile

Modified: head/etc/root/dot.cshrc
==
--- head/etc/root/dot.cshrc Sat Mar 24 18:25:16 2012(r233428)
+++ head/etc/root/dot.cshrc Sat Mar 24 18:43:18 2012(r233429)
@@ -3,13 +3,14 @@
 # .cshrc - csh resource script, read at beginning of execution by each shell
 #
 # see also csh(1), environ(7).
+# more examples available at /usr/share/examples/csh/
 #
 
 alias hhistory 25
 alias jjobs -l
-alias la   ls -a
+alias la   ls -aF
 alias lf   ls -FA
-alias ll   ls -lA
+alias ll   ls -lAF
 
 # A righteous umask
 umask 22
@@ -17,19 +18,30 @@ umask 22
 set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin 
/usr/local/bin $HOME/bin)
 
 setenv EDITOR  vi
-setenv PAGER   more
+setenv PAGER   less
 setenv BLOCKSIZE   K
 
 if ($?prompt) then
# An interactive shell -- set some stuff up
-   set prompt = "`/bin/hostname -s`# "
+   set prompt = "%n@%m:%c04%# "
+   set promptchars = "%#"
+
set filec
-   set history = 100
-   set savehist = 100
+   set history = 1000
+   set savehist = 1000
+   set autolist = ambiguous
+   # Use history to aid expansion
+   set autoexpand
+   set autorehash
set mail = (/var/mail/$USER)
if ( $?tcsh ) then
bindkey "^W" backward-delete-word
bindkey -k up history-search-backward
bindkey -k down history-search-forward
+
+   bindkey "\e[1~" beginning-of-line #make Home key work;
+   bindkey "\e[3~" delete-char #make Delete key work;
+   bindkey "\e[4~" end-of-line #make End key work;
endif
+
 endif

Modified: head/share/examples/Makefile
==
--- head/share/examples/MakefileSat Mar 24 18:25:16 2012
(r233428)
+++ head/share/examples/MakefileSat Mar 24 18:43:18 2012
(r233429)
@@ -8,6 +8,7 @@ LDIRS=  BSD_daemon \
FreeBSD_version \
IPv6 \
bootforth \
+   csh \
cvsup \
diskless \
drivers \
@@ -49,6 +50,7 @@ XFILES=   BSD_daemon/FreeBSD.pfa \
bootforth/menu.4th \
bootforth/menuconf.4th \
bootforth/screen.4th \
+   csh/dot.cshrc \
cvsup/README \
cvsup/cvs-supfile \
cvsup/doc-supfile \

Added: head/share/examples/csh/dot.cshrc
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/examples/csh/dot.cshrc   Sat Mar 24 18:43:18 2012
(r233429)
@@ -0,0 +1,60 @@
+# Here are some example (t)csh options and configurations that you may find 
interesting
+#
+# $FreeBSD$
+#
+
+# Sets SSH_AUTH_SOCK to the user's ssh-agent socket path if running
+if (${?SSH_AUTH_SOCK} != "1") then
+   setenv SSH_AUTH_SOCK `sockstat | grep "${USER}" | cut -d ' ' -f 6` 
+endif
+
+# Change only root's prompt
+if (`id -g` == 0)
+   set prompt="root@%m# "
+endif
+
+# This maps the "Delete" key to do the right thing
+# Pressing CTRL-v followed by the key of interest will print the shell's
+# mapping for the key
+bindkey "^[[3~" delete-char-or-list-or-eof
+
+# Make the Ins key work
+bindkey "\e[2~" overwrite-mode 
+
+# Some common completions
+complete chown  'p/1/u/'
+complete man'C/*/c/'
+complete service'n/*/`service -l`/'
+complete service   'c/-/(e l r v)/' 'p/1/`service -l`/' 'n/*/(start stop 
reload restart status rcvar onestart onestop)/'
+complete kldunload 'n@*@`kldstat | awk \{sub\(\/\.ko\/,\"\",\$NF\)\;print\ 
\$NF\} | grep -v Name` @'
+complete make   'n@*@`make -pn | sed -n -E "/^[#_.\/[:blank:]]+/d; 
/=/d; s/[[:blank:]]*:.*//gp;"`@'
+complete pkg_delete 'c/-/(i v D n p d f G x X r)/' 'n@*@`ls /var/db/pkg`@'
+complete pkg_info   'c/-/(a b v p q Q c d D f g i I j k K r R m L s o G O 
x X e E l t V P)/' 'n@*@`\ls -1 /var/db/pkg | sed svar/db/pkg/%%`@"
+complete kill  'c/-/S/' 'c/%/j/' 'n/*/`ps -ax | awk '"'"'{print 
$1}'"'"'`/'
+complete killall   'c/-/S/' 'c/%/j/' 'n/*/`ps -ax | awk '"'"'{print 
$5}'"'"'`/'
+alias _PKGS_PkGs_PoRtS_ 'awk -F\| 
\{sub\(\"\/usr\/ports\/\"\,\"\"\,\$2\)\;print\ \$2\} /usr/ports/INDEX-name -r | 
cut -d . -f 1A
+alias _PKGS_PkGs_PoRtS_ 'awk -F\| 
\{sub\(\"\/

Re: svn commit: r233391 - head/contrib/libstdc++/libsupc++

2012-03-24 Thread Konstantin Belousov
On Sat, Mar 24, 2012 at 11:54:21AM -0400, Alexander Kabaev wrote:
> On Fri, 23 Mar 2012 23:39:44 +
> David Chisnall  wrote:
> 
> > On 23 Mar 2012, at 21:10, Konstantin Belousov wrote:
> > 
> > > The patch just committed made the base-shipped library incompatible
> > > with the ports and manual libstdc++ builds.
> > 
> > To clarify - the one shipped in the base system has been incompatible
> > with the one in ports since late 2007...
> >
> That says something about the extend of the breakage, does it not?
>  
> > In future, however, we will want libstdc++ in ports to be using the
> > system ABI library (e.g. libcxxrt) so that it can be linked with
> > libraries using the system C++ stack, so the layout of std::type_info
> > in its headers doesn't matter too much because it won't be used.
> > 
> > > I think it is wiser to
> > > not 'undo the undo', and instead start living with the
> > > upstream-approved ABI. For symvered library, it does not make any
> > > difference if you break it in 10.0 or 9.1.
> > 
> > Not true.  The vtable layout can not be symbol versioned
> > effectively.  The std::type_info class is required by the ABI to
> > exist (and is in libsupc++ / libcxxrt, so is independent of our STL
> > implementation, either libstdc++ or libc++).  Users expect to be able
> > to cast 
> > 
> > > Also, I think that consumers that depend of the ABI of
> > > std::typeinfo can be hacked to understand the layout of vtable.
> > 
> > Supporting both layouts is not really tenable.  We need to do one of
> > the following:
> > 
> > - Say 'we are going to break this now!' and force people to recompile
> > libsupc++, libcxxrt, and libobjc2.
> > - Keep the layout that we currently ship and patch  in
> > ports.
> > 
> > I don't mind which of these we do since I'm not the one that has to
> > do the work in ensuring compatibility with ports but it will need to
> > pick one and then stick to it...
> > 
> > > I doubt that there are
> > > many users that utilize typeinfo.
> > 
> > Yes, to my knowledge there are three, and two of them are me :-(
> > 
> 
> I will support the switch to 'default' ABI used upstream, provided
> David is onboard. The breakage is very limited at the moment and
> can only grow over time, so will grow the pain, while we insist on being
> diverged from GCC. We might as well bite the bullet and live through
> this at the cost of 9.1 release errata that only affects libobjc2.
Right, this was my point, and you seems to agree with me:
better to make a switch back to the upstream ABI sooner (9.1) rather then
later (10.0).


pgp1kAnJO7eA7.pgp
Description: PGP signature


Re: svn commit: r233429 - in head: etc/root share/examples share/examples/csh

2012-03-24 Thread Chris Rees
On 24 Mar 2012 18:43, "Eitan Adler"  wrote:
>
> Author: eadler
> Date: Sat Mar 24 18:43:18 2012
> New Revision: 233429
> URL: http://svn.freebsd.org/changeset/base/233429
>
> Log:
>  - Make the default values for tcsh more user friendly
>  - Add an examples file with many of the not accepted suggestions from
the discussion
>
>  PR:   conf/160689
>  Reviewed by:  many
>  Discussed on: current
>  Approved by:  cperciva
>
> Added:
>  head/share/examples/csh/
>  head/share/examples/csh/dot.cshrc   (contents, props changed)
> Modified:
>  head/etc/root/dot.cshrc
>  head/share/examples/Makefile
>
> Modified: head/etc/root/dot.cshrc
>

Fantastic, thanks for getting this in.

Chris
___
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: r233430 - head/libexec/rtld-elf

2012-03-24 Thread Konstantin Belousov
Author: kib
Date: Sat Mar 24 19:13:10 2012
New Revision: 233430
URL: http://svn.freebsd.org/changeset/base/233430

Log:
  Provide short-circuit exit(3) implementation for rtld.
  There is no atexit finalizers in rtld to call on rtld exiting (due to errors).
  
  Submitted by: bde
  No objections from:   kan
  MFC after:2 weeks

Modified:
  head/libexec/rtld-elf/rtld.c

Modified: head/libexec/rtld-elf/rtld.c
==
--- head/libexec/rtld-elf/rtld.cSat Mar 24 18:43:18 2012
(r233429)
+++ head/libexec/rtld-elf/rtld.cSat Mar 24 19:13:10 2012
(r233430)
@@ -4364,6 +4364,17 @@ __getosreldate(void)
return (osreldate);
 }
 
+void
+exit(int status)
+{
+
+   _exit(status);
+}
+
+void (*__cleanup)(void);
+int __isthreaded = 0;
+int _thread_autoinit_dummy_decl = 1;
+
 /*
  * No unresolved symbols for rtld.
  */
___
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: r233431 - head/libexec/rtld-elf

2012-03-24 Thread Konstantin Belousov
Author: kib
Date: Sat Mar 24 19:14:44 2012
New Revision: 233431
URL: http://svn.freebsd.org/changeset/base/233431

Log:
  Remove libssp_nonshared from the rtld linking set. The only use for the
  library was definition for the weak alias of __stack_chk_fail.
  
  No objections from:   kan
  MFC after:2 weeks

Modified:
  head/libexec/rtld-elf/Makefile
  head/libexec/rtld-elf/rtld.c

Modified: head/libexec/rtld-elf/Makefile
==
--- head/libexec/rtld-elf/Makefile  Sat Mar 24 19:13:10 2012
(r233430)
+++ head/libexec/rtld-elf/Makefile  Sat Mar 24 19:14:44 2012
(r233431)
@@ -40,7 +40,7 @@ CFLAGS+=  -fpic
 CFLAGS+=   -DPIC $(DEBUG)
 LDFLAGS+=  -shared -Wl,-Bsymbolic
 DPADD= ${LIBC_PIC}
-LDADD= -lc_pic -lssp_nonshared
+LDADD= -lc_pic
 
 .if ${MK_SYMVER} == "yes"
 LIBCDIR=   ${TOPSRCDIR}/lib/libc

Modified: head/libexec/rtld-elf/rtld.c
==
--- head/libexec/rtld-elf/rtld.cSat Mar 24 19:13:10 2012
(r233430)
+++ head/libexec/rtld-elf/rtld.cSat Mar 24 19:14:44 2012
(r233431)
@@ -4390,6 +4390,7 @@ __stack_chk_fail(void)
_rtld_error("stack overflow detected; terminated");
die();
 }
+__weak_reference(__stack_chk_fail, __stack_chk_fail_local);
 
 void
 __chk_fail(void)
___
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: r233428 - head/share/examples/cvsup

2012-03-24 Thread Juli Mallett
On Sat, Mar 24, 2012 at 11:25, Eitan Adler  wrote:
> Author: eadler
> Date: Sat Mar 24 18:25:16 2012
> New Revision: 233428
> URL: http://svn.freebsd.org/changeset/base/233428
>
> Log:
>  Direct users to csup instead of cvsup in the csup-file boilerplate text.

Thanks for doing this!  I'm not sure about this one change that was
made in several places:

> -# CVSup (CVS Update Protocol) allows you to download the latest CVS
> +# csup (CVS Update Protocol) allows you to download the latest CVS

The name of the protocol is certainly CVSup and not csup.  And the
protocol is what is being referred to here (as is suggested by the
parenthetical.)  If the protocol weren't being referred to, it would
be a literal "cvsup" since that's the spelling of the command, not
"CVSup".
___
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: r233391 - head/contrib/libstdc++/libsupc++

2012-03-24 Thread Pedro Giffuni

Ahem..

On 03/23/12 15:10, David Chisnall wrote:

Author: theraven
Date: Fri Mar 23 20:10:56 2012
New Revision: 233391
URL: http://svn.freebsd.org/changeset/base/233391

Log:
   Revert ABI breakage in libsupc++.

   Unfortunately, the ABI was broken upstream for the 4.2 release, which we
   imported.  We then shipped the broken version for several years and certain
   ports (e.g. libobjc2) depend on it, so we're stuck with it for now...

   We should revisit this for 10.0, since we're allowed to break the ABI then, 
but
   until then we should keep the ABI we shipped with 8.x and 9.x.

   Reviewed by: kan
   Approved by: dim (mentor)
   MFC after:   1 week

Modified:
   head/contrib/libstdc++/libsupc++/typeinfo




Let me try to recap:

gcc-4.2.1 broke the ABI and we shipped it for a long time.

The bug was detected by Apple and others:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35081

It was fixed for gcc-4.2.2 (which we didn't ship):
http://gcc.gnu.org/viewcvs?view=revision&revision=129061 




I inadvertently fixed the bug 3 months ago when I brought in the
last LGPLv2 updates for libstdc++:

http://svnweb.freebsd.org/base?view=revision&revision=228780 




The fix hasn't been shipped but was MFC'd and is actually
in 8.3-RC* !!

David's commit actually restores the gcc 4.2.1 bug (?).

Pedro.
___
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: r233429 - in head: etc/root share/examples share/examples/csh

2012-03-24 Thread Florian Smeets

On 24.03.12 19:43, Eitan Adler wrote:

Author: eadler
Date: Sat Mar 24 18:43:18 2012
New Revision: 233429
URL: http://svn.freebsd.org/changeset/base/233429

Log:
   - Make the default values for tcsh more user friendly
   - Add an examples file with many of the not accepted suggestions from the 
discussion

   PR:  conf/160689
   Reviewed by: many
   Discussed on:current
   Approved by: cperciva



Something like this is missing:

Index: etc/mtree/BSD.usr.dist
===
--- etc/mtree/BSD.usr.dist  (revision 233429)
+++ etc/mtree/BSD.usr.dist  (working copy)
@@ -209,6 +209,8 @@
 ..
 bootforth
 ..
+csh
+..
 cvs
 contrib
 ..

otherwise the build fails

install -o root -g wheel -m 444 
/home/flo/dev/checkouts/svn-src/share/examples/csh/dot.cshrc 
//usr/share/examples/csh/dot.cshrc

install: //usr/share/examples/csh/dot.cshrc: No such file or directory

Florian
___
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: r233432 - in head/secure: usr.bin/ssh usr.sbin/sshd

2012-03-24 Thread Eitan Adler
Author: eadler
Date: Sat Mar 24 19:41:43 2012
New Revision: 233432
URL: http://svn.freebsd.org/changeset/base/233432

Log:
  Restore the ability to use a non-standard LOCALBASE to sshd
  Add the ability to use a non-standard LOCALBASE to ssh
  
  Submitted by: jhb
  Reviewed by:  des
  Approved by:  cperciva
  MFC after:0 days (with r233136)

Modified:
  head/secure/usr.bin/ssh/Makefile
  head/secure/usr.sbin/sshd/Makefile

Modified: head/secure/usr.bin/ssh/Makefile
==
--- head/secure/usr.bin/ssh/MakefileSat Mar 24 19:14:44 2012
(r233431)
+++ head/secure/usr.bin/ssh/MakefileSat Mar 24 19:41:43 2012
(r233432)
@@ -28,6 +28,10 @@ LDADD+=   -lgssapi
 DPADD+=${LIBCRYPT} ${LIBCRYPTO}
 LDADD+=-lcrypt -lcrypto
 
+.if defined(LOCALBASE)
+CFLAGS+= -DXAUTH_PATH=\"${LOCALBASE}/bin/xauth\"
+.endif
+
 .include 
 
 .PATH: ${SSHDIR}

Modified: head/secure/usr.sbin/sshd/Makefile
==
--- head/secure/usr.sbin/sshd/Makefile  Sat Mar 24 19:14:44 2012
(r233431)
+++ head/secure/usr.sbin/sshd/Makefile  Sat Mar 24 19:41:43 2012
(r233432)
@@ -43,6 +43,10 @@ LDADD+=   -lgssapi_krb5 -lgssapi -lkrb5 -
 DPADD+=${LIBCRYPTO} ${LIBCRYPT}
 LDADD+=-lcrypto -lcrypt
 
+.if defined(LOCALBASE)
+CFLAGS+= -DXAUTH_PATH=\"${LOCALBASE}/bin/xauth\"
+.endif
+
 .include 
 
 .PATH: ${SSHDIR}
___
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: r233433 - in head/sys: amd64/amd64 amd64/conf conf i386/conf i386/i386

2012-03-24 Thread Alan Cox
Author: alc
Date: Sat Mar 24 19:43:49 2012
New Revision: 233433
URL: http://svn.freebsd.org/changeset/base/233433

Log:
  Disable detailed PV entry accounting by default.  Add a config option
  to enable it.
  
  MFC after:1 week

Modified:
  head/sys/amd64/amd64/pmap.c
  head/sys/amd64/conf/NOTES
  head/sys/conf/options.amd64
  head/sys/conf/options.i386
  head/sys/i386/conf/NOTES
  head/sys/i386/i386/pmap.c

Modified: head/sys/amd64/amd64/pmap.c
==
--- head/sys/amd64/amd64/pmap.c Sat Mar 24 19:41:43 2012(r233432)
+++ head/sys/amd64/amd64/pmap.c Sat Mar 24 19:43:49 2012(r233433)
@@ -158,7 +158,6 @@ __FBSDID("$FreeBSD$");
 #define PMAP_INLINE
 #endif
 
-#define PV_STATS
 #ifdef PV_STATS
 #define PV_STAT(x) do { x ; } while (0)
 #else

Modified: head/sys/amd64/conf/NOTES
==
--- head/sys/amd64/conf/NOTES   Sat Mar 24 19:41:43 2012(r233432)
+++ head/sys/amd64/conf/NOTES   Sat Mar 24 19:43:49 2012(r233433)
@@ -559,6 +559,10 @@ optionsLINSYSFS
 
 optionsKSTACK_PAGES=5
 
+# Enable detailed accounting by the PV entry allocator.
+
+optionsPV_STATS
+
 #
 
 # More undocumented options for linting.

Modified: head/sys/conf/options.amd64
==
--- head/sys/conf/options.amd64 Sat Mar 24 19:41:43 2012(r233432)
+++ head/sys/conf/options.amd64 Sat Mar 24 19:43:49 2012(r233433)
@@ -10,6 +10,7 @@ PERFMON
 MPTABLE_FORCE_HTT
 MP_WATCHDOG
 NKPT   opt_pmap.h
+PV_STATS   opt_pmap.h
 
 # Options for emulators.  These should only be used at config time, so
 # they are handled like options for static filesystems

Modified: head/sys/conf/options.i386
==
--- head/sys/conf/options.i386  Sat Mar 24 19:41:43 2012(r233432)
+++ head/sys/conf/options.i386  Sat Mar 24 19:43:49 2012(r233433)
@@ -16,6 +16,7 @@ NKPT  opt_pmap.h
 PERFMON
 PMAP_SHPGPERPROC   opt_pmap.h
 POWERFAIL_NMI  opt_trap.h
+PV_STATS   opt_pmap.h
 
 # Options for emulators.  These should only be used at config time, so
 # they are handled like options for static filesystems

Modified: head/sys/i386/conf/NOTES
==
--- head/sys/i386/conf/NOTESSat Mar 24 19:41:43 2012(r233432)
+++ head/sys/i386/conf/NOTESSat Mar 24 19:43:49 2012(r233433)
@@ -976,6 +976,10 @@ device lindev
 
 optionsKSTACK_PAGES=3
 
+# Enable detailed accounting by the PV entry allocator.
+
+optionsPV_STATS
+
 #
 
 # More undocumented options for linting.

Modified: head/sys/i386/i386/pmap.c
==
--- head/sys/i386/i386/pmap.c   Sat Mar 24 19:41:43 2012(r233432)
+++ head/sys/i386/i386/pmap.c   Sat Mar 24 19:43:49 2012(r233433)
@@ -172,7 +172,6 @@ __FBSDID("$FreeBSD$");
 #define PMAP_INLINE
 #endif
 
-#define PV_STATS
 #ifdef PV_STATS
 #define PV_STAT(x) do { x ; } while (0)
 #else
___
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: r233429 - in head: etc/root share/examples share/examples/csh

2012-03-24 Thread Eitan Adler
On Sat, Mar 24, 2012 at 3:36 PM, Florian Smeets  wrote:
> On 24.03.12 19:43, Eitan Adler wrote:
>>
>> Author: eadler
>> Date: Sat Mar 24 18:43:18 2012
>> New Revision: 233429
>> URL: http://svn.freebsd.org/changeset/base/233429
>>
>> Log:
>>   - Make the default values for tcsh more user friendly
>>   - Add an examples file with many of the not accepted suggestions from
>> the discussion
>>
>>   PR:          conf/160689
>>   Reviewed by: many
>>   Discussed on:        current
>>   Approved by: cperciva
>>
>
> Something like this is missing:
>
> Index: etc/mtree/BSD.usr.dist
> ===
> --- etc/mtree/BSD.usr.dist      (revision 233429)
> +++ etc/mtree/BSD.usr.dist      (working copy)
> @@ -209,6 +209,8 @@
>             ..
>             bootforth
>             ..
> +            csh
> +            ..
>             cvs
>                 contrib
>                 ..
>
> otherwise the build fails
>
> install -o root -g wheel -m 444
> /home/flo/dev/checkouts/svn-src/share/examples/csh/dot.cshrc
> //usr/share/examples/csh/dot.cshrc
> install: //usr/share/examples/csh/dot.cshrc: No such file or directory

checking this out now - it didn't fail when I did installworld in a vm
but I may have missed something.


-- 
Eitan Adler
Source & Ports committer
X11, Bugbusting teams
___
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: r233434 - head/sys/powerpc/aim

2012-03-24 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Sat Mar 24 19:59:14 2012
New Revision: 233434
URL: http://svn.freebsd.org/changeset/base/233434

Log:
  Following suggestions from alc, skip wired mappings in pmap_remove_pages()
  and remove moea64_attr_*() in favor of direct calls to vm_page_dirty()
  and friends.

Modified:
  head/sys/powerpc/aim/mmu_oea64.c

Modified: head/sys/powerpc/aim/mmu_oea64.c
==
--- head/sys/powerpc/aim/mmu_oea64.cSat Mar 24 19:43:49 2012
(r233433)
+++ head/sys/powerpc/aim/mmu_oea64.cSat Mar 24 19:59:14 2012
(r233434)
@@ -396,29 +396,6 @@ vm_page_to_pvoh(vm_page_t m)
 }
 
 static __inline void
-moea64_attr_clear(vm_page_t m, u_int64_t ptebit)
-{
-
-   mtx_assert(&vm_page_queue_mtx, MA_OWNED);
-   m->md.mdpg_attrs &= ~ptebit;
-}
-
-static __inline u_int64_t
-moea64_attr_fetch(vm_page_t m)
-{
-
-   return (m->md.mdpg_attrs);
-}
-
-static __inline void
-moea64_attr_save(vm_page_t m, u_int64_t ptebit)
-{
-
-   mtx_assert(&vm_page_queue_mtx, MA_OWNED);
-   m->md.mdpg_attrs |= ptebit;
-}
-
-static __inline void
 moea64_pte_create(struct lpte *pt, uint64_t vsid, vm_offset_t va, 
 uint64_t pte_lo, int flags)
 {
@@ -1555,7 +1532,7 @@ moea64_remove_write(mmu_t mmu, vm_page_t
struct  pvo_entry *pvo;
uintptr_t pt;
pmap_t  pmap;
-   uint64_t lo;
+   uint64_t lo = 0;
 
KASSERT((m->oflags & VPO_UNMANAGED) == 0,
("moea64_remove_write: page %p is not managed", m));
@@ -1570,7 +1547,6 @@ moea64_remove_write(mmu_t mmu, vm_page_t
(m->aflags & PGA_WRITEABLE) == 0)
return;
vm_page_lock_queues();
-   lo = moea64_attr_fetch(m);
powerpc_sync();
LIST_FOREACH(pvo, vm_page_to_pvoh(m), pvo_vlink) {
pmap = pvo->pvo_pmap;
@@ -1593,10 +1569,8 @@ moea64_remove_write(mmu_t mmu, vm_page_t
UNLOCK_TABLE();
PMAP_UNLOCK(pmap);
}
-   if ((lo & LPTE_CHG) != 0) {
-   moea64_attr_clear(m, LPTE_CHG);
+   if ((lo & LPTE_CHG) != 0) 
vm_page_dirty(m);
-   }
vm_page_aflag_clear(m, PGA_WRITEABLE);
vm_page_unlock_queues();
 }
@@ -1945,6 +1919,21 @@ moea64_pvo_protect(mmu_t mmu,  pmap_t pm
PAGE_SIZE);
}
}
+
+   /*
+* Update vm about the REF/CHG bits if the page is managed.
+*/
+   if ((pvo->pvo_vaddr & PVO_MANAGED) == PVO_MANAGED) {
+   struct  vm_page *pg;
+
+   pg = PHYS_TO_VM_PAGE(pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN);
+   if (pg != NULL) {
+   if (pvo->pvo_pte.lpte.pte_lo & LPTE_CHG)
+   vm_page_dirty(pg);
+   if (pvo->pvo_pte.lpte.pte_lo & LPTE_REF)
+   vm_page_aflag_set(pg, PGA_REFERENCED);
+   }
+   }
UNLOCK_TABLE();
 }
 
@@ -2055,8 +2044,10 @@ moea64_remove_pages(mmu_t mmu, pmap_t pm
 
vm_page_lock_queues();
PMAP_LOCK(pm);
-   LIST_FOREACH_SAFE(pvo, &pm->pmap_pvo, pvo_plink, tpvo)
-   moea64_pvo_remove(mmu, pvo);
+   LIST_FOREACH_SAFE(pvo, &pm->pmap_pvo, pvo_plink, tpvo) {
+   if (!(pvo->pvo_vaddr & PVO_WIRED))
+   moea64_pvo_remove(mmu, pvo);
+   }
vm_page_unlock_queues();
PMAP_UNLOCK(pm);
 }
@@ -2115,10 +2106,8 @@ moea64_remove_all(mmu_t mmu, vm_page_t m
moea64_pvo_remove(mmu, pvo);
PMAP_UNLOCK(pmap);
}
-   if ((m->aflags & PGA_WRITEABLE) && moea64_is_modified(mmu, m)) {
-   moea64_attr_clear(m, LPTE_CHG);
+   if ((m->aflags & PGA_WRITEABLE) && moea64_is_modified(mmu, m))
vm_page_dirty(m);
-   }
vm_page_aflag_clear(m, PGA_WRITEABLE);
vm_page_unlock_queues();
 }
@@ -2354,15 +2343,17 @@ moea64_pvo_remove(mmu_t mmu, struct pvo_
pvo->pvo_pmap->pm_stats.wired_count--;
 
/*
-* Save the REF/CHG bits into their cache if the page is managed.
+* Update vm about the REF/CHG bits if the page is managed.
 */
if ((pvo->pvo_vaddr & PVO_MANAGED) == PVO_MANAGED) {
struct  vm_page *pg;
 
pg = PHYS_TO_VM_PAGE(pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN);
if (pg != NULL) {
-   moea64_attr_save(pg, pvo->pvo_pte.lpte.pte_lo &
-   (LPTE_REF | LPTE_CHG));
+   if (pvo->pvo_pte.lpte.pte_lo & LPTE_CHG)
+   vm_page_dirty(pg);
+   if (pvo->pvo_pte.lpte.pte_lo & LPTE_REF)
+   vm_page_aflag_set(pg, PGA_REFERENCED);
}
}
 
@@ -2436,19 +2427,13 @@ moea64_query_bit(mmu_t mmu, vm_page_t m,
struct  pvo_entry *pvo;
uintptr_t pt;
 
-   if (moea64_attr_fetch(m) 

Re: svn commit: r233429 - in head: etc/root share/examples share/examples/csh

2012-03-24 Thread Jan Beich
Eitan Adler  writes:

> Author: eadler
> Date: Sat Mar 24 18:43:18 2012
> New Revision: 233429
> URL: http://svn.freebsd.org/changeset/base/233429
>
> Log:
>   - Make the default values for tcsh more user friendly
[...]
> Modified: head/etc/root/dot.cshrc
> ==
> --- head/etc/root/dot.cshrc   Sat Mar 24 18:25:16 2012(r233428)
> +++ head/etc/root/dot.cshrc   Sat Mar 24 18:43:18 2012(r233429)
[...]
> + bindkey "\e[1~" beginning-of-line #make Home key work;
> + bindkey "\e[4~" end-of-line #make End key work;

Home/End keys are already bound unless termcap is somehow broken.

  $ tcsh -f
  > bindkey
  ...
  Arrow key bindings
  down   -> down-history
  up -> up-history
  left   -> backward-char
  right  -> forward-char
  home   -> beginning-of-line
  end-> end-of-line
 
Also, if you launch xterm with `-kt tcap' it would produce
whatever kh/@7 sequences are, e.g. different under tmux/screen.

> + bindkey "\e[3~" delete-char #make Delete key work;

inb4 someone expands static list of arrow keys in tcsh

  set key_dc=`echotc kD`
  bindkey $key_dc delete-char
___
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: r233429 - in head: etc/root share/examples share/examples/csh

2012-03-24 Thread Eitan Adler
On Sat, Mar 24, 2012 at 3:49 PM, Eitan Adler  wrote:
>> Something like this is missing:
...
>> otherwise the build fails

Is the following correct? For some reason the build doesn't fail for
me in either case so I can't actually confirm.


commit 6060054640292a746de3e9ffcfee9d87ed0a8750
Author: Eitan Adler 
Date:   Sat Mar 24 16:28:02 2012 -0400

Fix build by adding new directory to mtree in r233429

Submitted by:   flo
Approved by:cperciva
MFC after:  1 week

diff --git a/etc/mtree/BSD.usr.dist b/etc/mtree/BSD.usr.dist
index 87497b1..b9f79d2 100644
--- a/etc/mtree/BSD.usr.dist
+++ b/etc/mtree/BSD.usr.dist
@@ -209,6 +209,8 @@
 ..
 bootforth
 ..
+   csh
+   ..
 cvs
 contrib
 ..

-- 
Eitan Adler
Source & Ports committer
X11, Bugbusting teams
___
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: r233428 - head/share/examples/cvsup

2012-03-24 Thread Eitan Adler
On Sat, Mar 24, 2012 at 3:16 PM, Juli Mallett  wrote:
> The name of the protocol is certainly CVSup and not csup.  And the
> protocol is what is being referred to here (as is suggested by the
> parenthetical.)  If the protocol weren't being referred to, it would
> be a literal "cvsup" since that's the spelling of the command, not
> "CVSup".

I read this as
csup the program (what does csup stand for?)

but I don't care much either way. I'd be happy to change it to CVSup
if people care :)


-- 
Eitan Adler
Source & Ports committer
X11, Bugbusting teams
___
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: r233435 - head/etc/mtree

2012-03-24 Thread Eitan Adler
Author: eadler
Date: Sat Mar 24 21:10:19 2012
New Revision: 233435
URL: http://svn.freebsd.org/changeset/base/233435

Log:
  Fix build by adding new directory to mtree in r233429
  
  Submitted by: flo
  Approved by:  cperciva
  MFC after:1 week

Modified:
  head/etc/mtree/BSD.usr.dist

Modified: head/etc/mtree/BSD.usr.dist
==
--- head/etc/mtree/BSD.usr.dist Sat Mar 24 19:59:14 2012(r233434)
+++ head/etc/mtree/BSD.usr.dist Sat Mar 24 21:10:19 2012(r233435)
@@ -209,6 +209,8 @@
 ..
 bootforth
 ..
+   csh
+   ..
 cvs
 contrib
 ..
___
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: r233419 - head/sys/x86/include

2012-03-24 Thread Dimitry Andric
On 2012-03-24 18:48, Bruce Evans wrote:
> On Sat, 24 Mar 2012, Dimitry Andric wrote:
> 
>> Log:
>>  Fix the following clang warning in sys/dev/dcons/dcons.c, caused by the
>>  recent changes in sys/x86/include/endian.h:
>>
>>sys/dev/dcons/dcons.c:190:15: error: implicit conversion from 
>> '__uint32_t' (aka 'unsigned int') to '__uint16_t' (aka 'unsigned short') 
>> changes value from 1684238190 to 28526 [-Werror,-Wconstant-conversion]
>>
>>buf->magic = ntohl(DCONS_MAGIC);
>> ^~
>>sys/sys/param.h:306:18: note: expanded from:
>>#define ntohl(x)__ntohl(x)
>>^
>>./x86/endian.h:128:20: note: expanded from:
>>#define __ntohl(x)  __bswap32(x)
>>^
>>./x86/endian.h:78:20: note: expanded from:
>>__bswap32_gen((__uint32_t)(x)) : __bswap32_var(x))
>>  ^
>>./x86/endian.h:68:26: note: expanded from:
>>(((__uint32_t)__bswap16(x) << 16) | __bswap16((x) >> 16))
>>^
>>./x86/endian.h:75:53: note: expanded from:
>>__bswap16_gen((__uint16_t)(x)) : __bswap16_var(x)))
>> ~ ^
> 
> This warning was discussed before things were committed.

Then why was it committed without fixing the warning first?


> gcc gives a
> similar warning, but according to tijl, it can't happen in normal use
> with either gcc or clang because -Wno-system-headers suppresses warnings
> in system headers.  -Wnosystem-headers is the default in the kernel,
> where the above problem happens, so I don't see how it happens.

I don't see that option anywhere in either the world or kernel build.
Why would you not want to warn about system headers?


> However, bsd.sys.mk forces the non-default of -Wsystem-headers in
> userland at WARNS >= 1, so I don't see why there isn't a problem in
> userland if userland actually uses an expression like
> ntohl(DCONS_MAGIC).

It only occurs in certain cases, and I have not been able to exactly
determine when.  It doesn't seem to be related to -Wsystem-headers.


>>  This is because the __bswapXX_gen() macros (for x86) call the regular
>>  __bswapXX() macros.  Since the __bswapXX_gen() variants are only called
>>  when their arguments are constant, there is no need to do that constancy
>>  check recursively.  Also, it causes the above error with clang.
> 
> Not true.  The __bswapXX_gen() are called with non-constant args from
> __bswap64_var() in the i386 case.

Sure, but there it doesn't matter at all.


> As documented there, it is important
> for optimizations that __bswap64_gen() does do the constancy check
> recursively.  This was discussed before things were committed, and
> again when jhb siggested breaking it similarly to this commit to avoid
> a problem on ia64.

Isn't it much easier, and less obtuse, to just jam in two bswaps for the
i386?  I never saw the reason for making the bswap macros *more*
complicated instead of less.  If you obfuscate them enough, no compiler
will be able to optimize properly... :)


>>  Fix it by calling __bswap16_gen() from __bswap32_gen(), and similarly,
>>  __bswap32_gen() from  __bswap64_gen().
> 
> This breaks it.  DIring development, I had a correct fix involving
> casting down the arg.

If it works correctly with clang, please post it.


>>  While here, add extra parentheses around the __bswap16_gen() macro
>>  expansion, to prevent unexpected side effects.
> 
> These parentheses were intentionally left out for clarity.
> __bswap16_gen() is not user-serving, and all places in endian.h that
> use it supply enough parentheses.

Let's hope so, until a follow up commit breaks it again.
___
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: r233436 - head/sys/powerpc/aim

2012-03-24 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Sat Mar 24 22:32:19 2012
New Revision: 233436
URL: http://svn.freebsd.org/changeset/base/233436

Log:
  Only call vm_page_dirty() on pages that are writable in order not to
  confuse the VM.

Modified:
  head/sys/powerpc/aim/mmu_oea64.c

Modified: head/sys/powerpc/aim/mmu_oea64.c
==
--- head/sys/powerpc/aim/mmu_oea64.cSat Mar 24 21:10:19 2012
(r233435)
+++ head/sys/powerpc/aim/mmu_oea64.cSat Mar 24 22:32:19 2012
(r233436)
@@ -1889,6 +1889,7 @@ static void
 moea64_pvo_protect(mmu_t mmu,  pmap_t pm, struct pvo_entry *pvo, vm_prot_t 
prot)
 {
uintptr_t pt;
+   uint64_t oldlo;
 
/*
 * Grab the PTE pointer before we diddle with the cached PTE
@@ -1900,11 +1901,15 @@ moea64_pvo_protect(mmu_t mmu,  pmap_t pm
/*
 * Change the protection of the page.
 */
+   oldlo = pvo->pvo_pte.lpte.pte_lo;
pvo->pvo_pte.lpte.pte_lo &= ~LPTE_PP;
-   pvo->pvo_pte.lpte.pte_lo |= LPTE_BR;
pvo->pvo_pte.lpte.pte_lo &= ~LPTE_NOEXEC;
if ((prot & VM_PROT_EXECUTE) == 0) 
pvo->pvo_pte.lpte.pte_lo |= LPTE_NOEXEC;
+   if (prot & VM_PROT_WRITE) 
+   pvo->pvo_pte.lpte.pte_lo |= LPTE_BW;
+   else
+   pvo->pvo_pte.lpte.pte_lo |= LPTE_BR;
 
/*
 * If the PVO is in the page table, update that pte as well.
@@ -1921,9 +1926,11 @@ moea64_pvo_protect(mmu_t mmu,  pmap_t pm
}
 
/*
-* Update vm about the REF/CHG bits if the page is managed.
+* Update vm about the REF/CHG bits if the page is managed and we have
+* removed write access.
 */
-   if ((pvo->pvo_vaddr & PVO_MANAGED) == PVO_MANAGED) {
+   if ((pvo->pvo_vaddr & PVO_MANAGED) == PVO_MANAGED && 
+   (oldlo & LPTE_PP) != LPTE_BR && !(prot && VM_PROT_WRITE)) {
struct  vm_page *pg;
 
pg = PHYS_TO_VM_PAGE(pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN);
@@ -2345,7 +2352,8 @@ moea64_pvo_remove(mmu_t mmu, struct pvo_
/*
 * Update vm about the REF/CHG bits if the page is managed.
 */
-   if ((pvo->pvo_vaddr & PVO_MANAGED) == PVO_MANAGED) {
+   if ((pvo->pvo_vaddr & PVO_MANAGED) == PVO_MANAGED &&
+   (pvo->pvo_pte.lpte.pte_lo & LPTE_PP) != LPTE_BR) {
struct  vm_page *pg;
 
pg = PHYS_TO_VM_PAGE(pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN);
___
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: r233437 - head/share/examples/csh

2012-03-24 Thread Eitan Adler
Author: eadler
Date: Sat Mar 24 23:10:18 2012
New Revision: 233437
URL: http://svn.freebsd.org/changeset/base/233437

Log:
  Add a few more examples
  
  Submitted by: jmallett
  Approved by:  cperciva (implicit)
  MFC after:3 days
  X-MFC-With:   r233429

Modified:
  head/share/examples/csh/dot.cshrc

Modified: head/share/examples/csh/dot.cshrc
==
--- head/share/examples/csh/dot.cshrc   Sat Mar 24 22:32:19 2012
(r233436)
+++ head/share/examples/csh/dot.cshrc   Sat Mar 24 23:10:18 2012
(r233437)
@@ -32,6 +32,7 @@ complete pkg_delete 'c/-/(i v D n p 
 complete pkg_info   'c/-/(a b v p q Q c d D f g i I j k K r R m L s o G O 
x X e E l t V P)/' 'n@*@`\ls -1 /var/db/pkg | sed svar/db/pkg/%%`@"
 complete kill  'c/-/S/' 'c/%/j/' 'n/*/`ps -ax | awk '"'"'{print 
$1}'"'"'`/'
 complete killall   'c/-/S/' 'c/%/j/' 'n/*/`ps -ax | awk '"'"'{print 
$5}'"'"'`/'
+complete dd'c/[io]f=/f/ n/*/"(if of ibs obs bs skip seek count)"/='
 alias _PKGS_PkGs_PoRtS_ 'awk -F\| 
\{sub\(\"\/usr\/ports\/\"\,\"\"\,\$2\)\;print\ \$2\} /usr/ports/INDEX-name -r | 
cut -d . -f 1A
 alias _PKGS_PkGs_PoRtS_ 'awk -F\| 
\{sub\(\"\/usr\/ports\/\"\,\"\"\,\$2\)\;print\ \$2\} /usr/ports/INDEX-`uname -r 
| cut -d . -f 1`&& pkg_info -E \*'
 complete portmaster   'c/--/(always-fetch check-depends check-port-dbdir 
clean-distfiles \
@@ -56,5 +57,8 @@ set ellipsis
 alias ll   ls -lAhG
 alias ls   ls -G
 
+# Color on many system utilities
+setenv CLICOLOR 1
+
 # other autolist options
 setautolist = TAB
___
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: r233438 - head/sys/ufs/ffs

2012-03-24 Thread Kirk McKusick
Author: mckusick
Date: Sun Mar 25 00:02:37 2012
New Revision: 233438
URL: http://svn.freebsd.org/changeset/base/233438

Log:
  Add a third flags argument to ffs_syncvnode to avoid a possible conflict
  with MNT_WAIT flags that passed in its second argument. This will be
  MFC'ed together with r232351.
  
  Discussed with: kib

Modified:
  head/sys/ufs/ffs/ffs_balloc.c
  head/sys/ufs/ffs/ffs_extern.h
  head/sys/ufs/ffs/ffs_inode.c
  head/sys/ufs/ffs/ffs_rawread.c
  head/sys/ufs/ffs/ffs_snapshot.c
  head/sys/ufs/ffs/ffs_softdep.c
  head/sys/ufs/ffs/ffs_vfsops.c
  head/sys/ufs/ffs/ffs_vnops.c

Modified: head/sys/ufs/ffs/ffs_balloc.c
==
--- head/sys/ufs/ffs/ffs_balloc.c   Sat Mar 24 23:10:18 2012
(r233437)
+++ head/sys/ufs/ffs/ffs_balloc.c   Sun Mar 25 00:02:37 2012
(r233438)
@@ -450,7 +450,7 @@ fail:
 *
 * XXX Still have to journal the free below
 */
-   (void) ffs_syncvnode(vp, MNT_WAIT);
+   (void) ffs_syncvnode(vp, MNT_WAIT, 0);
for (deallocated = 0, blkp = allociblk, lbns_remfree = lbns;
 blkp < allocblk; blkp++, lbns_remfree++) {
/*
@@ -497,7 +497,7 @@ fail:
dp->di_blocks -= btodb(deallocated);
ip->i_flag |= IN_CHANGE | IN_UPDATE;
}
-   (void) ffs_syncvnode(vp, MNT_WAIT);
+   (void) ffs_syncvnode(vp, MNT_WAIT, 0);
/*
 * After the buffers are invalidated and on-disk pointers are
 * cleared, free the blocks.
@@ -994,7 +994,7 @@ fail:
 *
 * XXX Still have to journal the free below
 */
-   (void) ffs_syncvnode(vp, MNT_WAIT);
+   (void) ffs_syncvnode(vp, MNT_WAIT, 0);
for (deallocated = 0, blkp = allociblk, lbns_remfree = lbns;
 blkp < allocblk; blkp++, lbns_remfree++) {
/*
@@ -1041,7 +1041,7 @@ fail:
dp->di_blocks -= btodb(deallocated);
ip->i_flag |= IN_CHANGE | IN_UPDATE;
}
-   (void) ffs_syncvnode(vp, MNT_WAIT);
+   (void) ffs_syncvnode(vp, MNT_WAIT, 0);
/*
 * After the buffers are invalidated and on-disk pointers are
 * cleared, free the blocks.

Modified: head/sys/ufs/ffs/ffs_extern.h
==
--- head/sys/ufs/ffs/ffs_extern.h   Sat Mar 24 23:10:18 2012
(r233437)
+++ head/sys/ufs/ffs/ffs_extern.h   Sun Mar 25 00:02:37 2012
(r233438)
@@ -92,7 +92,7 @@ void  ffs_snapshot_mount(struct mount *mp
 void   ffs_snapshot_unmount(struct mount *mp);
 void   process_deferred_inactive(struct mount *mp);
 void   ffs_sync_snap(struct mount *, int);
-intffs_syncvnode(struct vnode *vp, int waitfor);
+intffs_syncvnode(struct vnode *vp, int waitfor, int flags);
 intffs_truncate(struct vnode *, off_t, int, struct ucred *, struct thread 
*);
 intffs_update(struct vnode *, int);
 intffs_valloc(struct vnode *, int, struct ucred *, struct vnode **);
@@ -168,12 +168,11 @@ void  softdep_freework(struct workhead *)
 #define FLUSH_BLOCKS   3
 #define FLUSH_BLOCKS_WAIT  4
 /*
- * Flag to ffs_syncinode() to request flushing of data only,
+ * Flag to ffs_syncvnode() to request flushing of data only,
  * but skip the ffs_update() on the inode itself. Used to avoid
  * deadlock when flushing snapshot inodes while holding snaplk.
- * Avoid bit conflicts with MNT_WAIT values in sys/mount.h
  */
-#defineNO_INO_UPDT 0x10
+#defineNO_INO_UPDT 0x0001
 
 intffs_rdonly(struct inode *);
 

Modified: head/sys/ufs/ffs/ffs_inode.c
==
--- head/sys/ufs/ffs/ffs_inode.cSat Mar 24 23:10:18 2012
(r233437)
+++ head/sys/ufs/ffs/ffs_inode.cSun Mar 25 00:02:37 2012
(r233438)
@@ -228,7 +228,7 @@ ffs_truncate(vp, length, flags, cred, td
goto extclean;
needextclean = 1;
} else {
-   if ((error = ffs_syncvnode(vp, MNT_WAIT)) != 0)
+   if ((error = ffs_syncvnode(vp, MNT_WAIT, 0)) != 0)
return (error);
 #ifdef QUOTA
(void) chkdq(ip, -extblocks, NOCRED, 0);
@@ -321,7 +321,7 @@ ffs_truncate(vp, length, flags, cred, td
 * rarely, we solve the problem by syncing the file
 * so that it will have no data structures left.
 */
-   if ((error = ffs_syncvnode(vp, MNT_WAIT)) != 0)
+   if ((error = ffs_syncvnode(vp, MNT_WAIT, 0)) != 0)
return (error);
} else {
flags = IO_NORMAL | (needextclean ? IO_EXT: 0);
@@ -366,7 +366,7 @@ ffs_truncate(vp, length, flags, cred, td
   

svn commit: r233445 - head/contrib/tzdata

2012-03-24 Thread Edwin Groothuis
Author: edwin
Date: Sun Mar 25 02:10:31 2012
New Revision: 233445
URL: http://svn.freebsd.org/changeset/base/233445

Log:
  MFV of 233442, tzdata2012a
  
  - Updates to various locations in Antarctica.
  - Armenia will abolish DST this year.
  - Not only Samoa has moved to UTC+14, also Fakaofo did.
  - There will be a leap second in 30 June 2012.
  - Historical updates of 1918 to Canada, Winn, Regina, Edm, Vanc, Creston.
  - Chili stays on DST until 28 April 2012
  - The Falkland islands will stay on DST this year.

Modified:
  head/contrib/tzdata/antarctica
  head/contrib/tzdata/asia
  head/contrib/tzdata/australasia
  head/contrib/tzdata/europe
  head/contrib/tzdata/leapseconds
  head/contrib/tzdata/northamerica
  head/contrib/tzdata/southamerica
  head/contrib/tzdata/zone.tab
Directory Properties:
  head/contrib/tzdata/   (props changed)

Modified: head/contrib/tzdata/antarctica
==
--- head/contrib/tzdata/antarctica  Sun Mar 25 02:07:47 2012
(r233444)
+++ head/contrib/tzdata/antarctica  Sun Mar 25 02:10:31 2012
(r233445)
@@ -1,5 +1,5 @@
 # 
-# @(#)antarctica   8.9
+# @(#)antarctica   8.10
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -42,8 +42,19 @@ Rule ChileAQ 1997only-   Mar 30  3:00u   
0   
 Rule   ChileAQ 1998only-   Mar Sun>=9  3:00u   0   -
 Rule   ChileAQ 1998only-   Sep 27  4:00u   1:00S
 Rule   ChileAQ 1999only-   Apr  4  3:00u   0   -
-Rule   ChileAQ 1999max -   Oct Sun>=9  4:00u   1:00S
-Rule   ChileAQ 2000max -   Mar Sun>=9  3:00u   0   -
+Rule   ChileAQ 19992010-   Oct Sun>=9  4:00u   1:00S
+Rule   ChileAQ 20002007-   Mar Sun>=9  3:00u   0   -
+# N.B.: the end of March 29 in Chile is March 30 in Universal time,
+# which is used below in specifying the transition.
+Rule   ChileAQ 2008only-   Mar 30  3:00u   0   -
+Rule   ChileAQ 2009only-   Mar Sun>=9  3:00u   0   -
+Rule   ChileAQ 2010only-   Apr Sun>=1  3:00u   0   -
+Rule   ChileAQ 2011only-   May Sun>=2  3:00u   0   -
+Rule   ChileAQ 2011only-   Aug Sun>=16 4:00u   1:00S
+Rule   ChileAQ 2012only-   Apr Sun>=23 3:00u   0   -
+Rule   ChileAQ 2012only-   Sep Sun>=2  4:00u   1:00S
+Rule   ChileAQ 2013max -   Mar Sun>=9  3:00u   0   -
+Rule   ChileAQ 2013max -   Oct Sun>=9  4:00u   1:00S
 
 # These rules are stolen from the `australasia' file.
 Rule   AusAQ   1917only-   Jan  1  0:011:00-
@@ -142,12 +153,16 @@ Zone Antarctica/Casey 0   -   zzz 1969
# Western (Aus) Standard Time
11:00   -   CAST2010 Mar 5 2:00
# Casey Time
+   8:00-   WST 2011 Oct 28 2:00
+   11:00   -   CAST2012 Feb 21 17:00u
8:00-   WST
 Zone Antarctica/Davis  0   -   zzz 1957 Jan 13
7:00-   DAVT1964 Nov # Davis Time
0   -   zzz 1969 Feb
7:00-   DAVT2009 Oct 18 2:00
5:00-   DAVT2010 Mar 10 20:00u
+   7:00-   DAVT2011 Oct 28 2:00
+   5:00-   DAVT2012 Feb 21 20:00u
7:00-   DAVT
 Zone Antarctica/Mawson 0   -   zzz 1954 Feb 13
6:00-   MAWT2009 Oct 18 2:00

Modified: head/contrib/tzdata/asia
==
--- head/contrib/tzdata/asiaSun Mar 25 02:07:47 2012(r233444)
+++ head/contrib/tzdata/asiaSun Mar 25 02:10:31 2012(r233445)
@@ -1,4 +1,4 @@
-# @(#)asia 8.69
+# @(#)asia 8.70
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -77,10 +77,6 @@ Rule RussiaAsia  1993max -   Mar lastSun 
 
 Rule RussiaAsia19931995-   Sep lastSun  2:00s  0   
-
 Rule RussiaAsia1996max -   Oct lastSun  2:00s  0   
-
 
-# From Arthur David Olson (2011-06-15):
-# While Russia abandoned DST in 2011, Armenia may choose to
-# follow Russia's "old" rules.
-
 # Afghanistan
 # Zone NAMEGMTOFF  RULES   FORMAT  [UNTIL]
 Zone   Asia/Kabul  4:36:48 -   LMT 1890
@@ -97,6 +93,21 @@ Zone Asia/Kabul  4:36:48 -   LMT 1890
 # in 1996, though it did use DST in 1995.  IATA SSIM (1991/1998) reports that
 # Arm

svn commit: r233451 - head/lib/libpmc

2012-03-24 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Sun Mar 25 02:22:32 2012
New Revision: 233451
URL: http://svn.freebsd.org/changeset/base/233451

Log:
  Update manual pages for MIPS-related CPUs:
  
  - Rename pmc.mips to pmc.mips24k since it covers just one CPU,
  no whole architecture
  - Add documetnations for Octeon's PMC counters
  - Remove CAVEATS section from pmc.mips24k page: PMC for MIPS supports
  sampling now.

Added:
  head/lib/libpmc/pmc.mips24k.3
 - copied, changed from r233380, head/lib/libpmc/pmc.mips.3
  head/lib/libpmc/pmc.octeon.3   (contents, props changed)
Deleted:
  head/lib/libpmc/pmc.mips.3
Modified:
  head/lib/libpmc/Makefile

Modified: head/lib/libpmc/Makefile
==
--- head/lib/libpmc/MakefileSun Mar 25 02:20:18 2012(r233450)
+++ head/lib/libpmc/MakefileSun Mar 25 02:22:32 2012(r233451)
@@ -42,6 +42,9 @@ MAN+= pmc.westmereuc.3
 MAN+=  pmc.tsc.3
 .elif ${MACHINE_CPUARCH} == "arm" && ${CPUTYPE} == "xscale"
 MAN+=  pmc.xscale.3
+.elif ${MACHINE_CPUARCH} == "mips"
+MAN+=  pmc.mips24k.3
+MAN+=  pmc.octeon.3
 .endif
 
 MLINKS+= \

Copied and modified: head/lib/libpmc/pmc.mips24k.3 (from r233380, 
head/lib/libpmc/pmc.mips.3)
==
--- head/lib/libpmc/pmc.mips.3  Fri Mar 23 18:03:38 2012(r233380, copy 
source)
+++ head/lib/libpmc/pmc.mips24k.3   Sun Mar 25 02:22:32 2012
(r233451)
@@ -23,13 +23,13 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd February 25, 2012
-.Dt PMC.MIPS 3
+.Dd March 24, 2012
+.Dt PMC.MIPS24K 3
 .Os
 .Sh NAME
-.Nm pmc.mips
+.Nm pmc.mips24k
 .Nd measurement events for
-.Tn MIPS
+.Tn MIPS24K
 family CPUs
 .Sh LIBRARY
 .Lb libpmc
@@ -388,6 +388,7 @@ and the underlying hardware events used.
 .Xr pmc.iaf 3 ,
 .Xr pmc.k7 3 ,
 .Xr pmc.k8 3 ,
+.Xr pmc.octeon 3 ,
 .Xr pmc.p4 3 ,
 .Xr pmc.p5 3 ,
 .Xr pmc.p6 3 ,
@@ -409,5 +410,3 @@ library was written by
 MIPS support was added by
 .An "George Neville-Neil"
 .Aq g...@freebsd.org .
-.Sh CAVEATS
-The MIPS code does not yet support sampling.

Added: head/lib/libpmc/pmc.octeon.3
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libpmc/pmc.octeon.3Sun Mar 25 02:22:32 2012
(r233451)
@@ -0,0 +1,253 @@
+.\" Copyright (c) 2010 George Neville-Neil.  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.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd March 24, 2012
+.Dt PMC.OCTEON 3
+.Os
+.Sh NAME
+.Nm pmc.octeon
+.Nd measurement events for
+.Tn Octeon
+family CPUs
+.Sh LIBRARY
+.Lb libpmc
+.Sh SYNOPSIS
+.In pmc.h
+.Sh DESCRIPTION
+.Pp
+There are two counters per core supported by the hardware and each is 64 bits
+wide.
+.Ss Event Specifiers (Programmable PMCs)
+MIPS programmable PMCs support the following events:
+.Bl -tag -width indent
+.It Li CLK
+.Pq Event 1
+Conditionally clocked cycles (as opposed to count/cvm_count which count even 
with no clocks)
+.It Li ISSUE
+.Pq Event 2
+Instructions issued but not retired
+.It Li RET
+.Pq Event 3
+Instructions retired
+.It Li NISSUE
+.Pq Event 4
+Cycles no issue
+.It Li SISSUE
+.Pq Event 5
+Cycles single issue
+.It Li DISSUE
+.Pq Event 6
+Cycles dual issue
+.It Li IFI
+.Pq Event 7
+Cycle ifetch issued (but not necessarily commit to pp_mem)
+.It Li BR
+.Pq Event 8
+Branches retired
+.It Li BRMIS
+.Pq Event 9
+Branch mispredicts
+.It Li J
+.Pq Event 10
+Jumps retired
+.It Li JMIS
+.Pq Event 11
+Jumps mispredicted
+.It Li REPLAY
+.Pq Event 12
+Mem Replays
+.It Li IUNA
+.Pq Event 13
+Cycles idle due to unaligned_replays
+.It Li TRAP
+.Pq Event 14
+trap_6a signal
+

svn commit: r233452 - head/sys/net80211

2012-03-24 Thread Adrian Chadd
Author: adrian
Date: Sun Mar 25 03:11:57 2012
New Revision: 233452
URL: http://svn.freebsd.org/changeset/base/233452

Log:
  Create a new task to handle 802.11n channel width changes.
  
  Currently, a channel width change updates the 802.11n HT info data in
  net80211 but it doesn't trigger any device changes.  So the device
  driver may decide that HT40 frames can be transmitted but the last
  device channel set only had HT20 set.
  
  Now, a task is scheduled so a hardware reset or change isn't done
  during any active ongoing RX. It also means that it's serialised
  with the other task operations (eg channel change.)
  
  This isn't the final incantation of this work, see below.
  
  For now, any unmodified drivers will simply receive a channel
  change log entry.  A subsequent patch to ath(4) will introduce
  some basic channel change handling (by resetting the NIC.)
  Other NICs may need to update their rate control information.
  
  TODO:
  
  * There's still a small window at the present moment where the
channel width has been updated but the task hasn't been fired.
The final version of this should likely pass in a channel width
field to the driver and let the driver atomically do whatever
it needs to before changing the channel.
  
  PR:   kern/166286

Modified:
  head/sys/net80211/ieee80211.c
  head/sys/net80211/ieee80211_ht.c
  head/sys/net80211/ieee80211_ht.h
  head/sys/net80211/ieee80211_node.c
  head/sys/net80211/ieee80211_node.h
  head/sys/net80211/ieee80211_proto.c
  head/sys/net80211/ieee80211_sta.c
  head/sys/net80211/ieee80211_var.h

Modified: head/sys/net80211/ieee80211.c
==
--- head/sys/net80211/ieee80211.c   Sun Mar 25 02:22:32 2012
(r233451)
+++ head/sys/net80211/ieee80211.c   Sun Mar 25 03:11:57 2012
(r233452)
@@ -256,6 +256,13 @@ null_input(struct ifnet *ifp, struct mbu
m_freem(m);
 }
 
+static void
+null_update_chw(struct ieee80211com *ic)
+{
+
+   if_printf(ic->ic_ifp, "%s: need callback\n", __func__);
+}
+
 /*
  * Attach/setup the common net80211 state.  Called by
  * the driver on attach to prior to creating any vap's.
@@ -287,6 +294,7 @@ ieee80211_ifattach(struct ieee80211com *
 
ic->ic_update_mcast = null_update_mcast;
ic->ic_update_promisc = null_update_promisc;
+   ic->ic_update_chw = null_update_chw;
 
ic->ic_hash_key = arc4random();
ic->ic_bintval = IEEE80211_BINTVAL_DEFAULT;

Modified: head/sys/net80211/ieee80211_ht.c
==
--- head/sys/net80211/ieee80211_ht.cSun Mar 25 02:22:32 2012
(r233451)
+++ head/sys/net80211/ieee80211_ht.cSun Mar 25 03:11:57 2012
(r233452)
@@ -1428,12 +1428,13 @@ ieee80211_parse_htinfo(struct ieee80211_
  * required channel change is done (e.g. in sta mode when
  * parsing the contents of a beacon frame).
  */
-static void
+static int
 htinfo_update_chw(struct ieee80211_node *ni, int htflags)
 {
struct ieee80211com *ic = ni->ni_ic;
struct ieee80211_channel *c;
int chanflags;
+   int ret = 0;
 
chanflags = (ni->ni_chan->ic_flags &~ IEEE80211_CHAN_HT) | htflags;
if (chanflags != ni->ni_chan->ic_flags) {
@@ -1460,11 +1461,13 @@ htinfo_update_chw(struct ieee80211_node 
IEEE80211_IS_CHAN_HT40(c) ? 40 : 20,
c->ic_freq, c->ic_flags);
ni->ni_chan = c;
+   ret = 1;
}
/* NB: caller responsible for forcing any channel change */
}
/* update node's tx channel width */
ni->ni_chw = IEEE80211_IS_CHAN_HT40(ni->ni_chan)? 40 : 20;
+   return (ret);
 }
 
 /*
@@ -1515,13 +1518,14 @@ htcap_update_shortgi(struct ieee80211_no
  * Parse and update HT-related state extracted from
  * the HT cap and info ie's.
  */
-void
+int
 ieee80211_ht_updateparams(struct ieee80211_node *ni,
const uint8_t *htcapie, const uint8_t *htinfoie)
 {
struct ieee80211vap *vap = ni->ni_vap;
const struct ieee80211_ie_htinfo *htinfo;
int htflags;
+   int ret = 0;
 
ieee80211_parse_htcap(ni, htcapie);
if (vap->iv_htcaps & IEEE80211_HTCAP_SMPS)
@@ -1543,13 +1547,16 @@ ieee80211_ht_updateparams(struct ieee802
else if (ni->ni_ht2ndchan == IEEE80211_HTINFO_2NDCHAN_BELOW)
htflags = IEEE80211_CHAN_HT40D;
}
-   htinfo_update_chw(ni, htflags);
+   if (htinfo_update_chw(ni, htflags))
+   ret = 1;
 
if ((htinfo->hi_byte1 & IEEE80211_HTINFO_RIFSMODE_PERM) &&
(vap->iv_flags_ht & IEEE80211_FHT_RIFS))
ni->ni_flags |= IEEE80211_NODE_RIFS;
else
ni->ni_flags &= ~IEEE80211_NODE_RIFS;
+
+   return (ret);
 }
 
 /*
@@ -1578,7 +1585,7 @@ ieee80211_ht_updatehtcap(struct ieee80

svn commit: r233453 - head/sys/dev/ath

2012-03-24 Thread Adrian Chadd
Author: adrian
Date: Sun Mar 25 03:14:31 2012
New Revision: 233453
URL: http://svn.freebsd.org/changeset/base/233453

Log:
  Add the new channel width change field to the ath(4) driver.
  
  This is not entirely correct as it simply resets the channel, flushing
  whatever is in the TX/RX queue.  This can and will break aggregation
  BAW tracking.  But the alternative (HT40 frames being sent with the hardware
  in HT20 mode) is even worse.
  
  There's still a small window between the htinfo being received (and the ni_chw
  field being updated) which could cause problems.  I'll look at fleshing this
  out in follow-up commits.
  
  PR:   kern/166286

Modified:
  head/sys/dev/ath/if_ath.c

Modified: head/sys/dev/ath/if_ath.c
==
--- head/sys/dev/ath/if_ath.c   Sun Mar 25 03:11:57 2012(r233452)
+++ head/sys/dev/ath/if_ath.c   Sun Mar 25 03:14:31 2012(r233453)
@@ -199,6 +199,7 @@ static void ath_chan_change(struct ath_s
 static voidath_scan_start(struct ieee80211com *);
 static voidath_scan_end(struct ieee80211com *);
 static voidath_set_channel(struct ieee80211com *);
+static voidath_update_chw(struct ieee80211com *);
 static voidath_calibrate(void *);
 static int ath_newstate(struct ieee80211vap *, enum ieee80211_state, int);
 static voidath_setup_stationkey(struct ieee80211_node *);
@@ -794,6 +795,7 @@ ath_attach(u_int16_t devid, struct ath_s
ic->ic_scan_start = ath_scan_start;
ic->ic_scan_end = ath_scan_end;
ic->ic_set_channel = ath_set_channel;
+   ic->ic_update_chw = ath_update_chw;
 
/* 802.11n specific - but just override anyway */
sc->sc_addba_request = ic->ic_addba_request;
@@ -5717,6 +5719,31 @@ ath_scan_end(struct ieee80211com *ic)
 sc->sc_curaid);
 }
 
+/*
+ * For now, just do a channel change.
+ *
+ * Later, we'll go through the hard slog of suspending tx/rx, changing rate
+ * control state and resetting the hardware without dropping frames out
+ * of the queue.
+ *
+ * The unfortunate trouble here is making absolutely sure that the
+ * channel width change has propagated enough so the hardware
+ * absolutely isn't handed bogus frames for it's current operating
+ * mode. (Eg, 40MHz frames in 20MHz mode.) Since TX and RX can and
+ * does occur in parallel, we need to make certain we've blocked
+ * any further ongoing TX (and RX, that can cause raw TX)
+ * before we do this.
+ */
+static void
+ath_update_chw(struct ieee80211com *ic)
+{
+   struct ifnet *ifp = ic->ic_ifp;
+   struct ath_softc *sc = ifp->if_softc;
+
+   DPRINTF(sc, ATH_DEBUG_STATE, "%s: called\n", __func__);
+   ath_set_channel(ic);
+}
+
 static void
 ath_set_channel(struct ieee80211com *ic)
 {
___
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: r233419 - head/sys/x86/include

2012-03-24 Thread Bruce Evans

On Sat, 24 Mar 2012, Dimitry Andric wrote:


On 2012-03-24 18:48, Bruce Evans wrote:

On Sat, 24 Mar 2012, Dimitry Andric wrote:


Log:
 Fix the following clang warning in sys/dev/dcons/dcons.c, caused by the
 recent changes in sys/x86/include/endian.h:

   sys/dev/dcons/dcons.c:190:15: error: implicit conversion from '__uint32_t' 
(aka 'unsigned int') to '__uint16_t' (aka 'unsigned short') changes value from 
1684238190 to 28526 [-Werror,-Wconstant-conversion]

  buf->magic = ntohl(DCONS_MAGIC);
   ^~
   sys/sys/param.h:306:18: note: expanded from:
   #define ntohl(x)__ntohl(x)
  ^
   ./x86/endian.h:128:20: note: expanded from:
   #define __ntohl(x)  __bswap32(x)
  ^
   ./x86/endian.h:78:20: note: expanded from:
  __bswap32_gen((__uint32_t)(x)) : __bswap32_var(x))
^
   ./x86/endian.h:68:26: note: expanded from:
  (((__uint32_t)__bswap16(x) << 16) | __bswap16((x) >> 16))
  ^
   ./x86/endian.h:75:53: note: expanded from:
  __bswap16_gen((__uint16_t)(x)) : __bswap16_var(x)))
   ~ ^


This warning was discussed before things were committed.


Then why was it committed without fixing the warning first?


Because testing (by tijl) showed that there was no warning.

Testing now (by me) shows the warning for dcons.


gcc gives a
similar warning, but according to tijl, it can't happen in normal use
with either gcc or clang because -Wno-system-headers suppresses warnings
in system headers.  -Wnosystem-headers is the default in the kernel,
where the above problem happens, so I don't see how it happens.


I don't see that option anywhere in either the world or kernel build.


It is the default for gcc.  It seems to be the default for clang too.


Why would you not want to warn about system headers?


We do want to warn about system headers.  That's why we add
-Wsystem-headers to CFLAGS in bsd.sys.mk if WARNS >= 1 (to change the
default).  But WARNS is not supported for kernels, and is not normally
set for modules.


However, bsd.sys.mk forces the non-default of -Wsystem-headers in
userland at WARNS >= 1, so I don't see why there isn't a problem in
userland if userland actually uses an expression like
ntohl(DCONS_MAGIC).


It only occurs in certain cases, and I have not been able to exactly
determine when.  It doesn't seem to be related to -Wsystem-headers.


-Wsystem-headers operates mysteriously.  It is reported to not work for
clang, but it works for me in _not_ suppressing the warning for
(x && y || z && t), yet not for the ntohl() warning.  What a system
header is undocumented.  It seems to be related to using the standard
search path: `-I.' to reach  doesn't work, but '-I.' to reach x86
does work.  So I was able to test ./x86/endian.h as a "system header"
and put garbage in it, and got strange results:
- when ./x86/endian.h is a "system" header, clang never warns about
  the ntohl(), irrespective of -Wsystem-headers
- when ./x86/endian.h is not a "system" header, clang always warns about
  the ntohl()
- gcc never warns about the ntohl()
- when ./x86/endian.h is a "system" header, with -Wall both gcc and clang
  warns about (x && y || z && t) according to -Wsystem-headers
- when ./x86/endian.h is not a "system" header, with -Wall both gcc and
  clang always warn about (x && y || z && t)
- when ./x86/endian.h is a "system" header, with -Wimplicit-int clang
  warns about 'x(void);' according to -Wsystem-headers, but gcc never
  warns about it.
- when ./x86/endian.h is not a "system" header, with -Wall both gcc and
  clang always warn about 'x(void);'.


 This is because the __bswapXX_gen() macros (for x86) call the regular
 __bswapXX() macros.  Since the __bswapXX_gen() variants are only called
 when their arguments are constant, there is no need to do that constancy
 check recursively.  Also, it causes the above error with clang.


Not true.  The __bswapXX_gen() are called with non-constant args from
__bswap64_var() in the i386 case.


Sure, but there it doesn't matter at all.


As documented there, it is important


Of course it matters there.  It is the difference between gcc generating
2 32-bit bswap instructions for bswap64(var) and 25 lines of shifts and
mask instructions.


 This is because the __bswapXX_gen() macros (for x86) call the regular
 __bswapXX() macros.  Since the __bswapXX_gen() variants are only called
 when their arguments are constant, there is no need to do that constancy
 check recursively.  Also, it causes the above error with clang.


Not true.  The __bswapXX_gen() are called with non-constant args from
__bswap64_var() in the i386 case.


Sure, but there it doesn't matter at all.


Of course it matters.


As documented there, it is important
for optimizations that __bswap64_gen() does do the constancy check
recursively.  This was discussed b

svn commit: r233454 - head/sys/powerpc/aim

2012-03-24 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Sun Mar 25 06:01:34 2012
New Revision: 233454
URL: http://svn.freebsd.org/changeset/base/233454

Log:
  More PMAP performance improvements: on powerpc64, when TLBIE can be run
  with exceptions enabled, leave them enabled and use a regular mutex to
  guard TLB invalidations instead of a spinlock.

Modified:
  head/sys/powerpc/aim/moea64_native.c

Modified: head/sys/powerpc/aim/moea64_native.c
==
--- head/sys/powerpc/aim/moea64_native.cSun Mar 25 03:14:31 2012
(r233453)
+++ head/sys/powerpc/aim/moea64_native.cSun Mar 25 06:01:34 2012
(r233454)
@@ -138,7 +138,7 @@ __FBSDID("$FreeBSD$");
  * Just to add to the fun, exceptions must be off as well
  * so that we can't trap in 64-bit mode. What a pain.
  */
-struct mtx tlbie_mutex;
+static struct mtx  tlbie_mutex;
 
 static __inline void
 TLBIE(uint64_t vpn) {
@@ -151,8 +151,8 @@ TLBIE(uint64_t vpn) {
vpn <<= ADDR_PIDX_SHFT;
vpn &= ~(0xULL << 48);
 
-   mtx_lock_spin(&tlbie_mutex);
 #ifdef __powerpc64__
+   mtx_lock(&tlbie_mutex);
__asm __volatile("\
ptesync; \
tlbie %0; \
@@ -160,10 +160,13 @@ TLBIE(uint64_t vpn) {
tlbsync; \
ptesync;" 
:: "r"(vpn) : "memory");
+   mtx_unlock(&tlbie_mutex);
 #else
vpn_hi = (uint32_t)(vpn >> 32);
vpn_lo = (uint32_t)vpn;
 
+   /* Note: spin mutex is to disable exceptions while fiddling MSR */
+   mtx_lock_spin(&tlbie_mutex);
__asm __volatile("\
mfmsr %0; \
mr %1, %0; \
@@ -181,8 +184,8 @@ TLBIE(uint64_t vpn) {
ptesync;" 
: "=r"(msr), "=r"(scratch) : "r"(vpn_hi), "r"(vpn_lo), "r"(32), "r"(1)
: "memory");
-#endif
mtx_unlock_spin(&tlbie_mutex);
+#endif
 }
 
 #define DISABLE_TRANS(msr) msr = mfmsr(); mtmsr(msr & ~PSL_DR)
@@ -413,7 +416,11 @@ moea64_bootstrap_native(mmu_t mmup, vm_o
/*
 * Initialize the TLBIE lock. TLBIE can only be executed by one CPU.
 */
-   mtx_init(&tlbie_mutex, "tlbie mutex", NULL, MTX_SPIN);
+#ifdef __powerpc64__
+   mtx_init(&tlbie_mutex, "tlbie", NULL, MTX_DEF);
+#else
+   mtx_init(&tlbie_mutex, "tlbie", NULL, MTX_SPIN);
+#endif
 
moea64_mid_bootstrap(mmup, kernelstart, kernelend);
 
___
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"