svn commit: r233342 - head/sys/geom/part

2012-03-23 Thread Andrey V. Elsukov
Author: ae
Date: Fri Mar 23 07:26:17 2012
New Revision: 233342
URL: http://svn.freebsd.org/changeset/base/233342

Log:
  Check that scheme is not already registered. This may happens when a
  KLD is preloaded with loader(8) and leads to infinity loops.
  
  Also do not return EEXIST error code from MOD_LOAD handler, because
  we have undocumented(?) ability replace kernel's module with preloaded one.
  And if we have so, then preloaded module will be initialized first.
  Thus error in MOD_LOAD handler will be triggered for the kernel.
  
  PR:   kern/165573
  MFC after:3 weeks

Modified:
  head/sys/geom/part/g_part.c

Modified: head/sys/geom/part/g_part.c
==
--- head/sys/geom/part/g_part.c Fri Mar 23 06:57:04 2012(r233341)
+++ head/sys/geom/part/g_part.c Fri Mar 23 07:26:17 2012(r233342)
@@ -2211,23 +2211,32 @@ g_part_unload_event(void *arg, int flag)
 int
 g_part_modevent(module_t mod, int type, struct g_part_scheme *scheme)
 {
+   struct g_part_scheme *iter;
uintptr_t arg;
int error;
 
+   error = 0;
switch (type) {
case MOD_LOAD:
-   TAILQ_INSERT_TAIL(&g_part_schemes, scheme, scheme_list);
-
-   error = g_retaste(&g_part_class);
-   if (error)
-   TAILQ_REMOVE(&g_part_schemes, scheme, scheme_list);
+   TAILQ_FOREACH(iter, &g_part_schemes, scheme_list) {
+   if (scheme == iter) {
+   printf("GEOM_PART: scheme %s is already "
+   "registered!\n", scheme->name);
+   break;
+   }
+   }
+   if (iter == NULL) {
+   TAILQ_INSERT_TAIL(&g_part_schemes, scheme,
+   scheme_list);
+   g_retaste(&g_part_class);
+   }
break;
case MOD_UNLOAD:
arg = (uintptr_t)scheme;
error = g_waitfor_event(g_part_unload_event, &arg, M_WAITOK,
NULL);
-   if (!error)
-   error = (arg == (uintptr_t)scheme) ? EDOOFUS : arg;
+   if (error == 0)
+   error = arg;
break;
default:
error = EOPNOTSUPP;
___
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: r233343 - head

2012-03-23 Thread Stanislav Sedov
Author: stas
Date: Fri Mar 23 07:45:11 2012
New Revision: 233343
URL: http://svn.freebsd.org/changeset/base/233343

Log:
  - Take krb5_verify_user.3.gz out of ObsoleteFiles as it's still being
installed.
  - Add 32-bit compat old kerberos libraries to ObsoleteFiles as well.
  
  Reported by:  pluknet@

Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Fri Mar 23 07:26:17 2012(r233342)
+++ head/ObsoleteFiles.inc  Fri Mar 23 07:45:11 2012(r233343)
@@ -56,7 +56,6 @@ OLD_FILES+=usr/include/krb5-v4compat.h \
 usr/share/man/man3/krb5_kt_cursor.3.gz \
 usr/share/man/man3/krb5_kt_ops.3.gz \
 usr/share/man/man3/krb5_set_warn_dest.3.gz \
-usr/share/man/man3/krb5_verify_user.3.gz \
 usr/share/man/man3/krb5_verr.3.gz \
 usr/share/man/man3/krb5_verrx.3.gz \
 usr/share/man/man3/krb5_vwarnx.3.gz \
@@ -70,7 +69,16 @@ OLD_LIBS+=usr/lib/libasn1.so.10 \
usr/lib/libkadm5srv.so.10 \
usr/lib/libkafs5.so.10 \
usr/lib/libkrb5.so.10 \
-   usr/lib/libroken.so.10
+   usr/lib/libroken.so.10 \
+   usr/lib32/libasn1.so.10 \
+   usr/lib32/libhdb.so.10 \
+   usr/lib32/libheimntlm.so.10 \
+   usr/lib32/libhx509.so.10 \
+   usr/lib32/libkadm5clnt.so.10 \
+   usr/lib32/libkadm5srv.so.10 \
+   usr/lib32/libkafs5.so.10 \
+   usr/lib32/libkrb5.so.10 \
+   usr/lib32/libroken.so.10
 # 20120309: Remove fifofs header files.
 OLD_FILES+=usr/include/fs/fifofs/fifo.h
 OLD_DIRS+=usr/include/fs/fifofs
___
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: r233344 - head

2012-03-23 Thread Stanislav Sedov
Author: stas
Date: Fri Mar 23 07:52:37 2012
New Revision: 233344
URL: http://svn.freebsd.org/changeset/base/233344

Log:
  - Actually fill the date of the Heimdal update.

Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Fri Mar 23 07:45:11 2012(r233343)
+++ head/ObsoleteFiles.inc  Fri Mar 23 07:52:37 2012(r233344)
@@ -38,7 +38,7 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
-# 201203XX: Update heimdal to 1.5.1.
+# 20120322: Update heimdal to 1.5.1.
 OLD_FILES+=usr/include/krb5-v4compat.h \
usr/include/krb_err.h \
usr/include/hdb-private.h \
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2012-03-23 Thread Ed Schouten
Author: ed
Date: Fri Mar 23 08:26:31 2012
New Revision: 233345
URL: http://svn.freebsd.org/changeset/base/233345

Log:
  Make utmpx(3) thread safe if we support TLS.
  
  Because the utmpx interface is generally not required to be thread-safe,
  but it is nice to have, if easy to do so. Therefore don't make a mess
  out of the code and only use it if __NO_TLS is not defined.

Modified:
  head/lib/libc/gen/getutxent.c
  head/lib/libc/gen/utxdb.c

Modified: head/lib/libc/gen/getutxent.c
==
--- head/lib/libc/gen/getutxent.c   Fri Mar 23 07:52:37 2012
(r233344)
+++ head/lib/libc/gen/getutxent.c   Fri Mar 23 08:26:31 2012
(r233345)
@@ -38,8 +38,13 @@ __FBSDID("$FreeBSD$");
 #include "utxdb.h"
 #include "un-namespace.h"
 
+#ifdef __NO_TLS
 static FILE *uf = NULL;
 static int udb;
+#else
+static _Thread_local FILE *uf = NULL;
+static _Thread_local int udb;
+#endif
 
 int
 setutxdb(int db, const char *file)

Modified: head/lib/libc/gen/utxdb.c
==
--- head/lib/libc/gen/utxdb.c   Fri Mar 23 07:52:37 2012(r233344)
+++ head/lib/libc/gen/utxdb.c   Fri Mar 23 08:26:31 2012(r233345)
@@ -126,7 +126,11 @@ utx_to_futx(const struct utmpx *ut, stru
 struct utmpx *
 futx_to_utx(const struct futx *fu)
 {
+#ifdef __NO_TLS
static struct utmpx *ut;
+#else
+   static _Thread_local struct utmpx *ut;
+#endif
 
if (ut == NULL) {
ut = calloc(1, sizeof *ut);
___
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: r232821 - in head: . include sys/fs/cd9660 sys/fs/ext2fs sys/fs/fifofs sys/fs/nfs sys/fs/tmpfs sys/fs/udf sys/gnu/fs/xfs/FreeBSD sys/kern sys/nfsclient sys/sys sys/ufs/ufs

2012-03-23 Thread Sergey Kandaurov
On 11 March 2012 16:19, Konstantin Belousov  wrote:
> Author: kib
> Date: Sun Mar 11 12:19:58 2012
> New Revision: 232821
> URL: http://svn.freebsd.org/changeset/base/232821
>
> Log:
>  Remove fifo.h. The only used function declaration from the header is
>  migrated to sys/vnode.h.
>
>  Submitted by: gianni

Looks like it is still installed with src/etc/mtree/BSD.include.dist.

-- 
wbr,
pluknet
___
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: r233346 - head/etc/mtree

2012-03-23 Thread Sergey Kandaurov
Author: pluknet
Date: Fri Mar 23 10:12:35 2012
New Revision: 233346
URL: http://svn.freebsd.org/changeset/base/233346

Log:
  Clean up of fs/fifofs include directory after fifo.h removal.
  
  Glanced by:   kib

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

Modified: head/etc/mtree/BSD.include.dist
==
--- head/etc/mtree/BSD.include.dist Fri Mar 23 08:26:31 2012
(r233345)
+++ head/etc/mtree/BSD.include.dist Fri Mar 23 10:12:35 2012
(r233346)
@@ -152,8 +152,6 @@
 ..
 fdescfs
 ..
-fifofs
-..
 msdosfs
 ..
 nfs
___
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: r233347 - head/share/man/man9

2012-03-23 Thread Sergey Kandaurov
Author: pluknet
Date: Fri Mar 23 10:33:24 2012
New Revision: 233347
URL: http://svn.freebsd.org/changeset/base/233347

Log:
  Clean up from the old kern.polling.
  
  Reviewed by:  attilio
  MFC after:1 week

Modified:
  head/share/man/man9/ifnet.9

Modified: head/share/man/man9/ifnet.9
==
--- head/share/man/man9/ifnet.9 Fri Mar 23 10:12:35 2012(r233346)
+++ head/share/man/man9/ifnet.9 Fri Mar 23 10:33:24 2012(r233347)
@@ -798,20 +798,7 @@ The capability of a network interface to
 .Xr polling 4
 mode involves several flags in different
 global variables and per-interface fields.
-First, there is a system-wide
-.Xr sysctl 8
-master switch named
-.Va kern.polling.enable ,
-which can toggle
-.Xr polling 4
-globally.
-If that variable is set to non-zero,
-.Xr polling 4
-will be used on those devices where it is enabled individually.
-Otherwise,
-.Xr polling 4
-will not be used in the system.
-Second, the capability flag
+The capability flag
 .Dv IFCAP_POLLING
 set in interface's
 .Va if_capabilities
@@ -821,20 +808,19 @@ on the particular interface.
 If set in
 .Va if_capabilities ,
 the same flag can be marked or cleared in the interface's
-.Va if_capenable ,
+.Va if_capenable
+within
+.Fn ifioctl ,
 thus initiating switch of the interface to
 .Xr polling 4
 mode or interrupt
 mode, respectively.
-The actual mode change will occur at an implementation-specific moment
-in the future, e.g., during the next interrupt or
-.Xr polling 4
-cycle.
-And finally, if the mode transition has been successful, the flag
-.Dv IFF_POLLING
-is marked or cleared in the interface's
-.Va if_flags
-to indicate the current mode of the interface.
+The actual mode change is managed by the driver-specific
+.Fn if_ioctl
+routine.
+The
+.Xr polling
+handler returns the number of packets processed.
 .Ss The Vt if_data Ss Structure
 The
 .Vt if_data
@@ -880,18 +866,6 @@ to attempt to ensure that there is alway
 sufficient space to prepend a link-layer header without allocating an
 additional
 .Vt mbuf .
-.\" (See
-.\" .Xr mbuf 9 . )
-.\" .It Va ifi_recvquota
-.\" .Pq Vt u_char
-.\" Number of packets the interface is permitted to receive at one time
-.\" when in polled mode.
-.\" .It Va ifi_xmitquota
-.\" .Pq Vt u_char
-.\" Number of packets the interface is permitted to queue for transmission
-.\" at one time when in polled mode.
-.\" There is some controversy over
-.\" whether such a restriction makes any sense at all.
 .It Va ifi_datalen
 .Pq Vt u_char
 Length of the
@@ -972,18 +946,6 @@ Number of packets dropped on input.
 Rarely implemented.
 .It Va ifi_noproto
 Number of packets received for unknown network-layer protocol.
-.\" .It Va ifi_recvtiming
-.\" Amount of time, in microseconds, spent to receive an average packet on
-.\" this interface.
-.\" See the
-.\" .Sx Polling
-.\" section, below.
-.\" .It Va ifi_xmittiming
-.\" Amount of time, in microseconds, spent to service a transmit-complete
-.\" interrupt on this interface.
-.\" See the
-.\" .Sx Polling
-.\" section, below.
 .It Va ifi_lastchange
 .Pq Vt "struct timeval"
 The time of the last administrative change to the interface (as required
___
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: r233348 - head/share/man/man9

2012-03-23 Thread Sergey Kandaurov
Author: pluknet
Date: Fri Mar 23 10:39:50 2012
New Revision: 233348
URL: http://svn.freebsd.org/changeset/base/233348

Log:
  Update IFCAP_* macro descriptions.
  
  Reviewed by:  attilio (polling part, a previous version)
  MFC after:1 week

Modified:
  head/share/man/man9/ifnet.9

Modified: head/share/man/man9/ifnet.9
==
--- head/share/man/man9/ifnet.9 Fri Mar 23 10:33:24 2012(r233347)
+++ head/share/man/man9/ifnet.9 Fri Mar 23 10:39:50 2012(r233348)
@@ -685,13 +685,7 @@ Userland code shall use
 .Xr ioctl 2 .
 .Pp
 The following capabilities are currently supported by the system:
-.Bl -tag -width ".Dv IFCAP_VLAN_HWTAGGING" -offset indent
-.It Dv IFCAP_NETCONS
-This interface can be a network console.
-.It Dv IFCAP_POLLING
-This interface supports
-.Xr polling 4 .
-See below for details.
+.Bl -tag -width ".Dv IFCAP_POLLING_NOCOUNT" -offset indent
 .It Dv IFCAP_RXCSUM
 This interface can do checksum validation on receiving data.
 Some interfaces do not have sufficient buffer storage to store frames
@@ -703,9 +697,8 @@ This interface can do checksum calculati
 .It Dv IFCAP_HWCSUM
 A shorthand for
 .Pq Dv IFCAP_RXCSUM | IFCAP_TXCSUM .
-.It Dv IFCAP_VLAN_HWTAGGING
-This interface can do VLAN tagging on output and
-demultiplex frames by their VLAN tag on input.
+.It Dv IFCAP_NETCONS
+This interface can be a network console.
 .It Dv IFCAP_VLAN_MTU
 The
 .Xr vlan 4
@@ -715,11 +708,24 @@ without having to decrease MTU on
 interfaces below 1500 bytes.
 This implies the ability of this interface to cope with frames somewhat
 longer than permitted by the Ethernet specification.
+.It Dv IFCAP_VLAN_HWTAGGING
+This interface can do VLAN tagging on output and
+demultiplex frames by their VLAN tag on input.
 .It Dv IFCAP_JUMBO_MTU
 This Ethernet interface can transmit and receive frames up to
 9000 bytes long.
+.It Dv IFCAP_POLLING
+This interface supports
+.Xr polling 4 .
+See below for details.
+.It Dv IFCAP_VLAN_HWCSUM
+This interface can do checksum calculation on both transmitting
+and receiving data on
+.Xr vlan 4
+interfaces (implies
+.Dv IFCAP_HWCSUM ) .
 .It Dv IFCAP_TSO4
-This Ethernet interface supports TCP Segmentation offloading.
+This Ethernet interface supports TCP4 Segmentation offloading.
 .It Dv IFCAP_TSO6
 This Ethernet interface supports TCP6 Segmentation offloading.
 .It Dv IFCAP_TSO
@@ -729,7 +735,7 @@ A shorthand for
 This Ethernet interface supports TCP offloading.
 .It Dv IFCAP_TOE6
 This Ethernet interface supports TCP6 offloading.
-.It Dv ICAP_TOE
+.It Dv IFCAP_TOE
 A shorthand for
 .Pq Dv IFCAP_TOE4 | IFCAP_TOE6 .
 .It Dv IFCAP_WOL_UCAST
@@ -743,6 +749,27 @@ as those sent by
 .It Dv IFCAP_WOL
 A shorthand for
 .Pq Dv IFCAP_WOL_UCAST | IFCAP_WOL_MCAST | IFCAP_WOL_MAGIC .
+.It Dv IFCAP_TOE4
+This Ethernet interface supports TCP4 Offload Engine.
+.It Dv IFCAP_TOE6
+This Ethernet interface supports TCP6 Offload Engine.
+.It Dv IFCAP_TOE
+A shorthand for
+.Pq Dv IFCAP_TOE4 | IFCAP_TOE6 .
+.It Dv IFCAP_VLAN_HWFILTER
+This interface supports frame filtering in hardware on
+.Xr vlan 4
+interfaces.
+.It Dv IFCAP_POLLING_NOCOUNT
+The return value for the number of processed packets should be
+skipped for this interface.
+.It Dv IFCAP_VLAN_HWTSO
+This interface supports TCP Segmentation offloading on
+.Xr vlan 4
+interfaces (implies
+.Dv IFCAP_TSO ) .
+.It Dv IFCAP_LINKSTATE
+This Ethernet interface supports dynamic link state changes.
 .El
 .Pp
 The ability of advanced network interfaces to offload certain
___
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: r233346 - head/etc/mtree

2012-03-23 Thread Giovanni Trematerra
On Fri, Mar 23, 2012 at 11:12 AM, Sergey Kandaurov  wrote:
> Author: pluknet
> Date: Fri Mar 23 10:12:35 2012
> New Revision: 233346
> URL: http://svn.freebsd.org/changeset/base/233346
>
> Log:
>  Clean up of fs/fifofs include directory after fifo.h removal.
>
>  Glanced by:   kib
>
> Modified:
>  head/etc/mtree/BSD.include.dist
>

Thank you.
It was my fault.

Point-hat to: me
___
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: r233352 - head/lib/libarchive

2012-03-23 Thread Dimitry Andric
Author: dim
Date: Fri Mar 23 11:18:07 2012
New Revision: 233352
URL: http://svn.freebsd.org/changeset/base/233352

Log:
  Silence alignment warnings from clang in libarchive's ppmd code (which
  is actually third-party code).  Clang even warns about alignment issues
  on x86, and the warnings are not needed there.

Modified:
  head/lib/libarchive/Makefile

Modified: head/lib/libarchive/Makefile
==
--- head/lib/libarchive/MakefileFri Mar 23 11:01:04 2012
(r233351)
+++ head/lib/libarchive/MakefileFri Mar 23 11:18:07 2012
(r233352)
@@ -45,6 +45,7 @@ NO_WCAST_ALIGN=   yes
 CFLAGS+=   -DPPMD_32BIT
 .endif
 .endif
+NO_WCAST_ALIGN.clang=
 
 .PATH: ${LIBARCHIVEDIR}/libarchive
 
___
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: r233354 - in head/sys: conf modules/mps

2012-03-23 Thread Dimitry Andric
Author: dim
Date: Fri Mar 23 11:35:01 2012
New Revision: 233354
URL: http://svn.freebsd.org/changeset/base/233354

Log:
  Work around the following clang warning in mps(4):
  
sys/dev/mps/mps_sas.c:861:1: error: function 'mpssas_discovery_timeout' is 
not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration]
mpssas_discovery_timeout(void *data)
^
  
  Because the driver is obtained from upstream, we don't want to modify
  it; just silence the warning instead, it is harmless.
  
  MFC after:3 days

Modified:
  head/sys/conf/files
  head/sys/conf/kern.mk
  head/sys/modules/mps/Makefile

Modified: head/sys/conf/files
==
--- head/sys/conf/files Fri Mar 23 11:26:54 2012(r233353)
+++ head/sys/conf/files Fri Mar 23 11:35:01 2012(r233354)
@@ -1480,7 +1480,8 @@ dev/mps/mps.c optional mps
 dev/mps/mps_config.c   optional mps
 dev/mps/mps_mapping.c  optional mps
 dev/mps/mps_pci.c  optional mps pci
-dev/mps/mps_sas.c  optional mps
+dev/mps/mps_sas.c  optional mps \
+   compile-with "${NORMAL_C} ${NO_WUNNEEDED_INTERNAL_DECL}"
 dev/mps/mps_sas_lsi.c  optional mps
 dev/mps/mps_table.coptional mps
 dev/mps/mps_user.c optional mps

Modified: head/sys/conf/kern.mk
==
--- head/sys/conf/kern.mk   Fri Mar 23 11:26:54 2012(r233353)
+++ head/sys/conf/kern.mk   Fri Mar 23 11:35:01 2012(r233354)
@@ -23,6 +23,7 @@ NO_WSHIFT_COUNT_OVERFLOW= -Wno-shift-cou
 NO_WUNUSED_VALUE=  -Wno-unused-value
 NO_WSELF_ASSIGN=   -Wno-self-assign
 NO_WFORMAT_SECURITY=   -Wno-format-security
+NO_WUNNEEDED_INTERNAL_DECL=-Wno-unneeded-internal-declaration
 # Several other warnings which might be useful in some cases, but not severe
 # enough to error out the whole kernel build.  Display them anyway, so there is
 # some incentive to fix them eventually.

Modified: head/sys/modules/mps/Makefile
==
--- head/sys/modules/mps/Makefile   Fri Mar 23 11:26:54 2012
(r233353)
+++ head/sys/modules/mps/Makefile   Fri Mar 23 11:35:01 2012
(r233354)
@@ -11,3 +11,6 @@ SRCS+=device_if.h bus_if.h pci_if.h
 #CFLAGS += -DMPS_DEBUG
 
 .include 
+
+CWARNFLAGS.mps_sas.c=  ${NO_WUNNEEDED_INTERNAL_DECL}
+CWARNFLAGS+=   ${CWARNFLAGS.${.IMPSRC:T}}
___
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: r233357 - head/libexec/rtld-elf

2012-03-23 Thread Konstantin Belousov
Author: kib
Date: Fri Mar 23 12:04:44 2012
New Revision: 233357
URL: http://svn.freebsd.org/changeset/base/233357

Log:
  Implement xstrdup() using strlen()/xmalloc()/memcpy() already
  presented in rtld, instead of pulling in libc strdup().
  
  Submitted by:bde
  MFC after:   2 weeks

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

Modified: head/libexec/rtld-elf/xmalloc.c
==
--- head/libexec/rtld-elf/xmalloc.c Fri Mar 23 12:02:00 2012
(r233356)
+++ head/libexec/rtld-elf/xmalloc.c Fri Mar 23 12:04:44 2012
(r233357)
@@ -57,12 +57,13 @@ xmalloc(size_t size)
 }
 
 char *
-xstrdup(const char *s)
+xstrdup(const char *str)
 {
-char *p = strdup(s);
-if (p == NULL) {
-rtld_fdputstr(STDERR_FILENO, "Out of memory\n");
-_exit(1);
-}
-return p;
+   char *copy;
+   size_t len;
+
+   len = strlen(str) + 1;
+   copy = xmalloc(len);
+   memcpy(copy, str, len);
+   return (copy);
 }
___
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: r233360 - head/libexec/rtld-elf

2012-03-23 Thread Konstantin Belousov
Author: kib
Date: Fri Mar 23 12:10:12 2012
New Revision: 233360
URL: http://svn.freebsd.org/changeset/base/233360

Log:
  Centralize the calculation of the top source directory.  This
  simplifies the build of rtld with partial checkout, allowing to
  override only one place to reference other tree.
  
  Submitted by: bde
  MFC after:2 weeks

Modified:
  head/libexec/rtld-elf/Makefile

Modified: head/libexec/rtld-elf/Makefile
==
--- head/libexec/rtld-elf/Makefile  Fri Mar 23 12:06:32 2012
(r233359)
+++ head/libexec/rtld-elf/Makefile  Fri Mar 23 12:10:12 2012
(r233360)
@@ -9,8 +9,9 @@ SRCS=   rtld_start.S \
malloc.c xmalloc.c debug.c libmap.c
 MAN=   rtld.1
 CSTD?= gnu99
+TOPSRCDIR= ${.CURDIR}/../..
 CFLAGS+=   -Wall -DFREEBSD_ELF -DIN_RTLD
-CFLAGS+=   -I${.CURDIR}/../../lib/csu/common
+CFLAGS+=   -I${TOPSRCDIR}/lib/csu/common
 .if exists(${.CURDIR}/${MACHINE_ARCH})
 RTLD_ARCH= ${MACHINE_ARCH}
 .else
@@ -42,7 +43,7 @@ DPADD=${LIBC_PIC}
 LDADD= -lc_pic -lssp_nonshared
 
 .if ${MK_SYMVER} == "yes"
-LIBCDIR=   ${.CURDIR}/../../lib/libc
+LIBCDIR=   ${TOPSRCDIR}/lib/libc
 VERSION_DEF=   ${LIBCDIR}/Versions.def
 SYMBOL_MAPS=   ${.CURDIR}/Symbol.map
 VERSION_MAP=   Version.map
___
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: r233361 - head/libexec/rtld-elf

2012-03-23 Thread Konstantin Belousov
Author: kib
Date: Fri Mar 23 12:13:31 2012
New Revision: 233361
URL: http://svn.freebsd.org/changeset/base/233361

Log:
  Remove superfluous extern keywords.
  
  MFC after:   2 weeks

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

Modified: head/libexec/rtld-elf/rtld.h
==
--- head/libexec/rtld-elf/rtld.hFri Mar 23 12:10:12 2012
(r233360)
+++ head/libexec/rtld-elf/rtld.hFri Mar 23 12:13:31 2012
(r233361)
@@ -316,19 +316,19 @@ typedef struct Struct_SymLook {
 struct Struct_RtldLockState *lockstate;
 } SymLook;
 
-extern void _rtld_error(const char *, ...) __printflike(1, 2);
-extern const char *rtld_strerror(int);
-extern Obj_Entry *map_object(int, const char *, const struct stat *);
-extern void *xcalloc(size_t, size_t);
-extern void *xmalloc(size_t);
-extern char *xstrdup(const char *);
+void _rtld_error(const char *, ...) __printflike(1, 2);
+const char *rtld_strerror(int);
+Obj_Entry *map_object(int, const char *, const struct stat *);
+void *xcalloc(size_t, size_t);
+void *xmalloc(size_t);
+char *xstrdup(const char *);
 extern Elf_Addr _GLOBAL_OFFSET_TABLE_[];
 extern Elf_Sym sym_zero;   /* For resolving undefined weak refs. */
 
-extern void dump_relocations (Obj_Entry *);
-extern void dump_obj_relocations (Obj_Entry *);
-extern void dump_Elf_Rel (Obj_Entry *, const Elf_Rel *, u_long);
-extern void dump_Elf_Rela (Obj_Entry *, const Elf_Rela *, u_long);
+void dump_relocations(Obj_Entry *);
+void dump_obj_relocations(Obj_Entry *);
+void dump_Elf_Rel(Obj_Entry *, const Elf_Rel *, u_long);
+void dump_Elf_Rela(Obj_Entry *, const Elf_Rela *, u_long);
 
 /*
  * Function declarations.
___
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: r233362 - head/sys/dev/sound/pci

2012-03-23 Thread John Baldwin
Author: jhb
Date: Fri Mar 23 12:34:39 2012
New Revision: 233362
URL: http://svn.freebsd.org/changeset/base/233362

Log:
  Don't cast a bus address to a uint8_t pointer just to add an offset to
  it.  Instead, add the offset directly to the bus address.

Modified:
  head/sys/dev/sound/pci/emu10kx.c

Modified: head/sys/dev/sound/pci/emu10kx.c
==
--- head/sys/dev/sound/pci/emu10kx.cFri Mar 23 12:13:31 2012
(r233361)
+++ head/sys/dev/sound/pci/emu10kx.cFri Mar 23 12:34:39 2012
(r233362)
@@ -1137,7 +1137,7 @@ emu_memalloc(struct emu_mem *mem, uint32
ofs = 0;
for (idx = start; idx < start + blksz; idx++) {
mem->bmap[idx >> 3] |= 1 << (idx & 7);
-   tmp = (uint32_t) (u_long) ((uint8_t *) blk->buf_addr + ofs);
+   tmp = (uint32_t) (blk->buf_addr + ofs);
mem->ptb_pages[idx] = (tmp << 1) | idx;
ofs += EMUPAGESIZE;
}
___
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: r233370 - head/share/man/man9

2012-03-23 Thread Sergey Kandaurov
Author: pluknet
Date: Fri Mar 23 16:24:07 2012
New Revision: 233370
URL: http://svn.freebsd.org/changeset/base/233370

Log:
  Expand contraction.
  
  Spotted by:   bjk

Modified:
  head/share/man/man9/ifnet.9

Modified: head/share/man/man9/ifnet.9
==
--- head/share/man/man9/ifnet.9 Fri Mar 23 16:19:14 2012(r233369)
+++ head/share/man/man9/ifnet.9 Fri Mar 23 16:24:07 2012(r233370)
@@ -629,7 +629,7 @@ multiple physical layers on some devices
 This interface supports multicast.
 .It Dv IFF_CANTCONFIG
 .Aq S*
-The interface isn't configurable in a meaningful way.
+The interface is not configurable in a meaningful way.
 Primarily useful for
 .Dv IFT_USB
 interfaces registered at the interface list.
___
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: r233371 - head/sys/dev/isci

2012-03-23 Thread Jim Harris
Author: jimharris
Date: Fri Mar 23 16:28:11 2012
New Revision: 233371
URL: http://svn.freebsd.org/changeset/base/233371

Log:
  Call xpt_bus_register during attach context, then freeze and do not release
  until domain discovery is complete.  This fixes an isci(4) bug on FreeBSD 7.x
  where devices weren't always appearing after boot without an explicit rescan.
  
  Sponsored by: Intel
  Reported and tested by: 
  Reviewed by: scottl
  Approved by: scottl

Modified:
  head/sys/dev/isci/isci.h
  head/sys/dev/isci/isci_controller.c
  head/sys/dev/isci/isci_remote_device.c

Modified: head/sys/dev/isci/isci.h
==
--- head/sys/dev/isci/isci.hFri Mar 23 16:24:07 2012(r233370)
+++ head/sys/dev/isci/isci.hFri Mar 23 16:28:11 2012(r233371)
@@ -122,6 +122,7 @@ struct ISCI_CONTROLLER
SCI_CONTROLLER_HANDLE_T scif_controller_handle;
struct ISCI_DOMAIN  domain[SCI_MAX_DOMAINS];
BOOLis_started;
+   BOOLhas_been_scanned;
uint32_tinitial_discovery_mask;
BOOLis_frozen;
uint8_t *remote_device_memory;

Modified: head/sys/dev/isci/isci_controller.c
==
--- head/sys/dev/isci/isci_controller.c Fri Mar 23 16:24:07 2012
(r233370)
+++ head/sys/dev/isci/isci_controller.c Fri Mar 23 16:28:11 2012
(r233371)
@@ -36,6 +36,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include 
+#include 
+
 #include 
 #include 
 
@@ -300,6 +303,16 @@ SCI_STATUS isci_controller_initialize(st
TUNABLE_INT_FETCH("hw.isci.io_shortage", &io_shortage);
controller->sim_queue_depth += io_shortage;
 
+   /* Attach to CAM using xpt_bus_register now, then immediately freeze
+*  the simq.  It will get released later when initial domain discovery
+*  is complete.
+*/
+   controller->has_been_scanned = FALSE;
+   mtx_lock(&controller->lock);
+   isci_controller_attach_to_cam(controller);
+   xpt_freeze_simq(controller->sim, 1);
+   mtx_unlock(&controller->lock);
+
return (scif_controller_initialize(controller->scif_controller_handle));
 }
 
@@ -441,13 +454,13 @@ void isci_controller_start(void *control
 void isci_controller_domain_discovery_complete(
 struct ISCI_CONTROLLER *isci_controller, struct ISCI_DOMAIN *isci_domain)
 {
-   if (isci_controller->sim == NULL)
+   if (!isci_controller->has_been_scanned)
{
-   /* Controller has not been attached to CAM yet.  We'll clear
+   /* Controller has not been scanned yet.  We'll clear
 *  the discovery bit for this domain, then check if all bits
 *  are now clear.  That would indicate that all domains are
-*  done with discovery and we can then attach the controller
-*  to CAM.
+*  done with discovery and we can then proceed with initial
+*  scan.
 */
 
isci_controller->initial_discovery_mask &=
@@ -457,7 +470,25 @@ void isci_controller_domain_discovery_co
struct isci_softc *driver = isci_controller->isci;
uint8_t next_index = isci_controller->index + 1;
 
-   isci_controller_attach_to_cam(isci_controller);
+   isci_controller->has_been_scanned = TRUE;
+
+   /* Unfreeze simq to allow initial scan to proceed. */
+   xpt_release_simq(isci_controller->sim, TRUE);
+
+#if __FreeBSD_version < 80
+   /* When driver is loaded after boot, we need to
+*  explicitly rescan here for versions <8.0, because
+*  CAM only automatically scans new buses at boot
+*  time.
+*/
+   union ccb *ccb = xpt_alloc_ccb_nowait();
+
+   xpt_create_path(&ccb->ccb_h.path, xpt_periph,
+   cam_sim_path(isci_controller->sim),
+   CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD);
+
+   xpt_rescan(ccb);
+#endif
 
if (next_index < driver->controller_count) {
/*  There are more controllers that need to

Modified: head/sys/dev/isci/isci_remote_device.c
==
--- head/sys/dev/isci/isci_remote_device.c  Fri Mar 23 16:24:07 2012
(r233370)
+++ head/sys/dev/isci/isci_remote_device.c  Fri Mar 23 16:28:11 2012
(r233371)
@@ -74,13 +74,12 @@ scif_cb_remote_device_ready(SCI_CONTROLL
isci_controller->remote_device[device_index] =
isci_remote_device;
 
-   if (

svn commit: r233378 - head/libexec/rtld-elf/mips

2012-03-23 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Fri Mar 23 17:54:06 2012
New Revision: 233378
URL: http://svn.freebsd.org/changeset/base/233378

Log:
  Before jumping to application's entry point set ra == pc in order
  to let backtracing routine know to go no further.

Modified:
  head/libexec/rtld-elf/mips/rtld_start.S

Modified: head/libexec/rtld-elf/mips/rtld_start.S
==
--- head/libexec/rtld-elf/mips/rtld_start.S Fri Mar 23 17:24:52 2012
(r233377)
+++ head/libexec/rtld-elf/mips/rtld_start.S Fri Mar 23 17:54:06 2012
(r233378)
@@ -80,7 +80,8 @@ LEAF(rtld_start)
movea0, s0  /* stack pointer */
movet9, v0
PTR_SUBU sp, 4*SZREG/* ABI requires to reserve memory for 4 
regs */
-   jr  t9  /* _start(sp, cleanup, obj); */
+   movera,t9   /* RA == PC signals backtrace routine 
to stop */
+   j   t9  /* _start(sp, cleanup, obj); */
movea3, s3  /* restore ps_strings */
 END(rtld_start)
 
___
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: r233381 - head/sys/mips/include

2012-03-23 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Fri Mar 23 18:07:12 2012
New Revision: 233381
URL: http://svn.freebsd.org/changeset/base/233381

Log:
  Fix pmap_kextract prototype to align it with pmap.c change

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

Modified: head/sys/mips/include/pmap.h
==
--- head/sys/mips/include/pmap.hFri Mar 23 18:03:38 2012
(r233380)
+++ head/sys/mips/include/pmap.hFri Mar 23 18:07:12 2012
(r233381)
@@ -99,7 +99,7 @@ typedef struct pmap *pmap_t;
 #ifdef _KERNEL
 
 pt_entry_t *pmap_pte(pmap_t, vm_offset_t);
-vm_offset_t pmap_kextract(vm_offset_t va);
+vm_paddr_t pmap_kextract(vm_offset_t va);
 
 #definevtophys(va) pmap_kextract(((vm_offset_t) (va)))
 #definepmap_asid(pmap) (pmap)->pm_asid[PCPU_GET(cpuid)].asid
___
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: r233382 - head/sbin/ifconfig

2012-03-23 Thread Bernhard Schmidt
Author: bschmidt
Date: Fri Mar 23 18:12:25 2012
New Revision: 233382
URL: http://svn.freebsd.org/changeset/base/233382

Log:
  Also fix the parameter usage in set80211meshpeering().
  
  Submitted by: Monthadar Al Jaberi
  MFC after:1 week
  X-MFC after:  r233328

Modified:
  head/sbin/ifconfig/ifieee80211.c

Modified: head/sbin/ifconfig/ifieee80211.c
==
--- head/sbin/ifconfig/ifieee80211.cFri Mar 23 18:07:12 2012
(r233381)
+++ head/sbin/ifconfig/ifieee80211.cFri Mar 23 18:12:25 2012
(r233382)
@@ -1885,7 +1885,7 @@ DECL_CMD_FUNC(set80211meshforward, val, 
 static
 DECL_CMD_FUNC(set80211meshpeering, val, d)
 {
-   set80211(s, IEEE80211_IOC_MESH_AP, atoi(val), 0, NULL);
+   set80211(s, IEEE80211_IOC_MESH_AP, d, 0, NULL);
 }
 
 static
___
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: r233387 - in head/sys/dev: ipw iwi iwn wpi

2012-03-23 Thread Bernhard Schmidt
Author: bschmidt
Date: Fri Mar 23 19:32:30 2012
New Revision: 233387
URL: http://svn.freebsd.org/changeset/base/233387

Log:
  Use suspend/resume methods provided by net80211. This ensures that the
  appropriate state handling takes place, not doing so results in the
  device doing nothing until manual intervention.
  
  Reviewed by:  iwasaki
  Tested by:iwasaki (iwi)
  MFC after:4 weeks

Modified:
  head/sys/dev/ipw/if_ipw.c
  head/sys/dev/iwi/if_iwi.c
  head/sys/dev/iwn/if_iwn.c
  head/sys/dev/wpi/if_wpi.c

Modified: head/sys/dev/ipw/if_ipw.c
==
--- head/sys/dev/ipw/if_ipw.c   Fri Mar 23 18:29:28 2012(r233386)
+++ head/sys/dev/ipw/if_ipw.c   Fri Mar 23 19:32:30 2012(r233387)
@@ -835,9 +835,9 @@ static int
 ipw_suspend(device_t dev)
 {
struct ipw_softc *sc = device_get_softc(dev);
+   struct ieee80211com *ic = sc->sc_ifp->if_l2com;
 
-   ipw_stop(sc);
-
+   ieee80211_suspend_all(ic);
return 0;
 }
 
@@ -845,13 +845,11 @@ static int
 ipw_resume(device_t dev)
 {
struct ipw_softc *sc = device_get_softc(dev);
-   struct ifnet *ifp = sc->sc_ifp;
+   struct ieee80211com *ic = sc->sc_ifp->if_l2com;
 
pci_write_config(dev, 0x41, 0, 1);
 
-   if (ifp->if_flags & IFF_UP)
-   ipw_init(sc);
-
+   ieee80211_resume_all(ic);
return 0;
 }
 

Modified: head/sys/dev/iwi/if_iwi.c
==
--- head/sys/dev/iwi/if_iwi.c   Fri Mar 23 18:29:28 2012(r233386)
+++ head/sys/dev/iwi/if_iwi.c   Fri Mar 23 19:32:30 2012(r233387)
@@ -863,9 +863,9 @@ static int
 iwi_suspend(device_t dev)
 {
struct iwi_softc *sc = device_get_softc(dev);
+   struct ieee80211com *ic = sc->sc_ifp->if_l2com;
 
-   iwi_stop(sc);
-
+   ieee80211_suspend_all(ic);
return 0;
 }
 
@@ -873,13 +873,11 @@ static int
 iwi_resume(device_t dev)
 {
struct iwi_softc *sc = device_get_softc(dev);
-   struct ifnet *ifp = sc->sc_ifp;
+   struct ieee80211com *ic = sc->sc_ifp->if_l2com;
 
pci_write_config(dev, 0x41, 0, 1);
 
-   if (ifp->if_flags & IFF_UP)
-   iwi_init(sc);
-
+   ieee80211_resume_all(ic);
return 0;
 }
 

Modified: head/sys/dev/iwn/if_iwn.c
==
--- head/sys/dev/iwn/if_iwn.c   Fri Mar 23 18:29:28 2012(r233386)
+++ head/sys/dev/iwn/if_iwn.c   Fri Mar 23 19:32:30 2012(r233387)
@@ -945,13 +945,9 @@ static int
 iwn_suspend(device_t dev)
 {
struct iwn_softc *sc = device_get_softc(dev);
-   struct ifnet *ifp = sc->sc_ifp;
-   struct ieee80211com *ic = ifp->if_l2com;
-   struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps);
+   struct ieee80211com *ic = sc->sc_ifp->if_l2com;
 
-   iwn_stop(sc);
-   if (vap != NULL)
-   ieee80211_stop(vap);
+   ieee80211_suspend_all(ic);
return 0;
 }
 
@@ -959,20 +955,12 @@ static int
 iwn_resume(device_t dev)
 {
struct iwn_softc *sc = device_get_softc(dev);
-   struct ifnet *ifp = sc->sc_ifp;
-   struct ieee80211com *ic = ifp->if_l2com;
-   struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps);
+   struct ieee80211com *ic = sc->sc_ifp->if_l2com;
 
/* Clear device-specific "PCI retry timeout" register (41h). */
pci_write_config(dev, 0x41, 0, 1);
 
-   if (ifp->if_flags & IFF_UP) {
-   iwn_init(sc);
-   if (vap != NULL)
-   ieee80211_init(vap);
-   if (ifp->if_drv_flags & IFF_DRV_RUNNING)
-   iwn_start(ifp);
-   }
+   ieee80211_resume_all(ic);
return 0;
 }
 

Modified: head/sys/dev/wpi/if_wpi.c
==
--- head/sys/dev/wpi/if_wpi.c   Fri Mar 23 18:29:28 2012(r233386)
+++ head/sys/dev/wpi/if_wpi.c   Fri Mar 23 19:32:30 2012(r233387)
@@ -1218,8 +1218,9 @@ static int
 wpi_suspend(device_t dev)
 {
struct wpi_softc *sc = device_get_softc(dev);
+   struct ieee80211com *ic = sc->sc_ifp->if_l2com;
 
-   wpi_stop(sc);
+   ieee80211_suspend_all(ic);
return 0;
 }
 
@@ -1227,15 +1228,11 @@ static int
 wpi_resume(device_t dev)
 {
struct wpi_softc *sc = device_get_softc(dev);
-   struct ifnet *ifp = sc->sc_ifp;
+   struct ieee80211com *ic = sc->sc_ifp->if_l2com;
 
pci_write_config(dev, 0x41, 0, 1);
 
-   if (ifp->if_flags & IFF_UP) {
-   wpi_init(ifp->if_softc);
-   if (ifp->if_drv_flags & IFF_DRV_RUNNING)
-   wpi_start(ifp);
-   }
+   ieee80211_resume_all(ic);
return 0;
 }
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any

svn commit: r233388 - in head/gnu/usr.bin/binutils/as: . mips-freebsd

2012-03-23 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Fri Mar 23 19:37:45 2012
New Revision: 233388
URL: http://svn.freebsd.org/changeset/base/233388

Log:
  Make default ABI for as(1) to be the same as target platform.
  This change makes object files compiled with default flags by
  gcc and as compatible.

Modified:
  head/gnu/usr.bin/binutils/as/Makefile
  head/gnu/usr.bin/binutils/as/mips-freebsd/itbl-cpu.h

Modified: head/gnu/usr.bin/binutils/as/Makefile
==
--- head/gnu/usr.bin/binutils/as/Makefile   Fri Mar 23 19:32:30 2012
(r233387)
+++ head/gnu/usr.bin/binutils/as/Makefile   Fri Mar 23 19:37:45 2012
(r233388)
@@ -43,6 +43,13 @@ SRCS+=   app.c \
 
 .if ${TARGET_CPUARCH} == "mips"
 SRCS+= itbl-ops.c itbl-parse.y itbl-lex.l
+.if ${TARGET_ARCH:Mmips64*} != ""
+CFLAGS+=   -DMIPS_DEFAULT_ABI=N64_ABI -DMIPS_DEFAULT_64BIT=1
+.elif ${TARGET_ARCH:Mmipsn32*} != ""
+CFLAGS+=   -DMIPS_DEFAULT_ABI=N32_ABI
+.else
+MIPS_ABI_DEFAULT=ABI_32
+.endif
 .endif
 
 .if ${TARGET_ARCH} == "amd64"

Modified: head/gnu/usr.bin/binutils/as/mips-freebsd/itbl-cpu.h
==
--- head/gnu/usr.bin/binutils/as/mips-freebsd/itbl-cpu.hFri Mar 23 
19:32:30 2012(r233387)
+++ head/gnu/usr.bin/binutils/as/mips-freebsd/itbl-cpu.hFri Mar 23 
19:37:45 2012(r233388)
@@ -3,14 +3,17 @@
 #include "itbl-mips.h"
 
 /* Choose a default ABI for MIPS targets.  */
-/* XXX: Where should this be ? */
+#ifndefMIPS_DEFAULT_ABI
 #define MIPS_DEFAULT_ABI NO_ABI
+#endif
 
 /* Default CPU for MIPS targets.  */
 #define MIPS_CPU_STRING_DEFAULT "from-abi"
 
 /* Generate 64-bit code by default on MIPS targets.  */
+#ifndefMIPS_DEFAULT_64BIT
 #define MIPS_DEFAULT_64BIT 0
+#endif
 
 /* Allow use of E_MIPS_ABI_O32 on MIPS targets.  */
 #define USE_E_MIPS_ABI_O32 1
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r233389 - in head/sys: kern sys

2012-03-23 Thread Mikolaj Golub
Author: trociny
Date: Fri Mar 23 20:05:41 2012
New Revision: 233389
URL: http://svn.freebsd.org/changeset/base/233389

Log:
  Add a sysctl to set and retrieve binary osreldate of another process.
  
  Suggested by: kib
  Reviewed by:  kib
  MFC after:2 weeks

Modified:
  head/sys/kern/kern_proc.c
  head/sys/sys/sysctl.h

Modified: head/sys/kern/kern_proc.c
==
--- head/sys/kern/kern_proc.c   Fri Mar 23 19:37:45 2012(r233388)
+++ head/sys/kern/kern_proc.c   Fri Mar 23 20:05:41 2012(r233389)
@@ -2499,6 +2499,52 @@ sysctl_kern_proc_umask(SYSCTL_HANDLER_AR
return (error);
 }
 
+/*
+ * This sysctl allows a process to set and retrieve binary osreldate of
+ * another process.
+ */
+static int
+sysctl_kern_proc_osrel(SYSCTL_HANDLER_ARGS)
+{
+   int *name = (int *)arg1;
+   u_int namelen = arg2;
+   struct proc *p;
+   int flags, error, osrel;
+
+   if (namelen != 1)
+   return (EINVAL);
+
+   if (req->newptr != NULL && req->newlen != sizeof(osrel))
+   return (EINVAL);
+
+   flags = PGET_HOLD | PGET_NOTWEXIT;
+   if (req->newptr != NULL)
+   flags |= PGET_CANDEBUG;
+   else
+   flags |= PGET_CANSEE;
+   error = pget((pid_t)name[0], flags, &p);
+   if (error != 0)
+   return (error);
+
+   error = SYSCTL_OUT(req, &p->p_osrel, sizeof(p->p_osrel));
+   if (error != 0)
+   goto errout;
+
+   if (req->newptr != NULL) {
+   error = SYSCTL_IN(req, &osrel, sizeof(osrel));
+   if (error != 0)
+   goto errout;
+   if (osrel < 0) {
+   error = EINVAL;
+   goto errout;
+   }
+   p->p_osrel = osrel;
+   }
+errout:
+   PRELE(p);
+   return (error);
+}
+
 SYSCTL_NODE(_kern, KERN_PROC, proc, CTLFLAG_RD,  0, "Process table");
 
 SYSCTL_PROC(_kern_proc, KERN_PROC_ALL, all, CTLFLAG_RD|CTLTYPE_STRUCT|
@@ -2603,3 +2649,7 @@ static SYSCTL_NODE(_kern_proc, KERN_PROC
 
 static SYSCTL_NODE(_kern_proc, KERN_PROC_UMASK, umask, CTLFLAG_RD |
CTLFLAG_MPSAFE, sysctl_kern_proc_umask, "Process umask");
+
+static SYSCTL_NODE(_kern_proc, KERN_PROC_OSREL, osrel, CTLFLAG_RW |
+   CTLFLAG_ANYBODY | CTLFLAG_MPSAFE, sysctl_kern_proc_osrel,
+   "Process binary osreldate");

Modified: head/sys/sys/sysctl.h
==
--- head/sys/sys/sysctl.h   Fri Mar 23 19:37:45 2012(r233388)
+++ head/sys/sys/sysctl.h   Fri Mar 23 20:05:41 2012(r233389)
@@ -565,6 +565,7 @@ SYSCTL_ALLOWED_TYPES(UINT64, uint64_t *a
 #defineKERN_PROC_RLIMIT37  /* process resource limits */
 #defineKERN_PROC_PS_STRINGS38  /* get ps_strings location */
 #defineKERN_PROC_UMASK 39  /* process umask */
+#defineKERN_PROC_OSREL 40  /* osreldate for process binary 
*/
 
 /*
  * KERN_IPC identifiers
___
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: r233390 - head/usr.bin/procstat

2012-03-23 Thread Mikolaj Golub
Author: trociny
Date: Fri Mar 23 20:09:21 2012
New Revision: 233390
URL: http://svn.freebsd.org/changeset/base/233390

Log:
  When displaying binary information show also osreldate.
  
  Suggested by: kib
  MFC after:2 weeks

Modified:
  head/usr.bin/procstat/procstat.1
  head/usr.bin/procstat/procstat_bin.c

Modified: head/usr.bin/procstat/procstat.1
==
--- head/usr.bin/procstat/procstat.1Fri Mar 23 20:05:41 2012
(r233389)
+++ head/usr.bin/procstat/procstat.1Fri Mar 23 20:09:21 2012
(r233390)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd February 29, 2012
+.Dd March 23, 2012
 .Dt PROCSTAT 1
 .Os
 .Sh NAME
@@ -110,6 +110,8 @@ Display the process ID, command, and pat
 process ID
 .It COMM
 command
+.It OSREL
+osreldate for process binary
 .It PATH
 path to process binary (if available)
 .El

Modified: head/usr.bin/procstat/procstat_bin.c
==
--- head/usr.bin/procstat/procstat_bin.cFri Mar 23 20:05:41 2012
(r233389)
+++ head/usr.bin/procstat/procstat_bin.cFri Mar 23 20:09:21 2012
(r233390)
@@ -43,11 +43,11 @@ void
 procstat_bin(struct kinfo_proc *kipp)
 {
char pathname[PATH_MAX];
-   int error, name[4];
+   int error, osrel, name[4];
size_t len;
 
if (!hflag)
-   printf("%5s %-16s %-53s\n", "PID", "COMM", "PATH");
+   printf("%5s %-16s %8s %s\n", "PID", "COMM", "OSREL", "PATH");
 
name[0] = CTL_KERN;
name[1] = KERN_PROC;
@@ -65,7 +65,19 @@ procstat_bin(struct kinfo_proc *kipp)
if (len == 0 || strlen(pathname) == 0)
strcpy(pathname, "-");
 
+   name[2] = KERN_PROC_OSREL;
+
+   len = sizeof(osrel);
+   error = sysctl(name, 4, &osrel, &len, NULL, 0);
+   if (error < 0 && errno != ESRCH) {
+   warn("sysctl: kern.proc.osrel: %d", kipp->ki_pid);
+   return;
+   }
+   if (error < 0)
+   return;
+
printf("%5d ", kipp->ki_pid);
printf("%-16s ", kipp->ki_comm);
+   printf("%8d ", osrel);
printf("%s\n", pathname);
 }
___
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: r233391 - head/contrib/libstdc++/libsupc++

2012-03-23 Thread David Chisnall
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

Modified: head/contrib/libstdc++/libsupc++/typeinfo
==
--- head/contrib/libstdc++/libsupc++/typeinfo   Fri Mar 23 20:09:21 2012
(r233390)
+++ head/contrib/libstdc++/libsupc++/typeinfo   Fri Mar 23 20:10:56 2012
(r233391)
@@ -100,12 +100,6 @@ namespace std 
 bool operator!=(const type_info& __arg) const
 { return !operator==(__arg); }
 
-// Return true if this is a pointer type of some kind
-virtual bool __is_pointer_p() const;
-
-// Return true if this is a function type
-virtual bool __is_function_p() const;
-
 // Try and catch a thrown type. Store an adjusted pointer to the
 // caught type in THR_OBJ. If THR_TYPE is not a pointer type, then
 // THR_OBJ points to the thrown object. If THR_TYPE is a pointer
@@ -119,6 +113,12 @@ namespace std 
 virtual bool __do_upcast(const __cxxabiv1::__class_type_info *__target,
 void **__obj_ptr) const;
 
+// Return true if this is a pointer type of some kind
+virtual bool __is_pointer_p() const;
+
+// Return true if this is a function type
+virtual bool __is_function_p() const;
+
   protected:
 const char *__name;
 
___
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: r233392 - head/sbin/hastd

2012-03-23 Thread Mikolaj Golub
Author: trociny
Date: Fri Mar 23 20:18:48 2012
New Revision: 233392
URL: http://svn.freebsd.org/changeset/base/233392

Log:
  Fix typo.
  
  MFC after:3 days

Modified:
  head/sbin/hastd/nv.c

Modified: head/sbin/hastd/nv.c
==
--- head/sbin/hastd/nv.cFri Mar 23 20:10:56 2012(r233391)
+++ head/sbin/hastd/nv.cFri Mar 23 20:18:48 2012(r233392)
@@ -263,17 +263,17 @@ nv_validate(struct nv *nv, size_t *extra
case NV_TYPE_UINT8:
if (vsize == 0)
vsize = 1;
-   /* FALLTHOUGH */
+   /* FALLTHROUGH */
case NV_TYPE_INT16:
case NV_TYPE_UINT16:
if (vsize == 0)
vsize = 2;
-   /* FALLTHOUGH */
+   /* FALLTHROUGH */
case NV_TYPE_INT32:
case NV_TYPE_UINT32:
if (vsize == 0)
vsize = 4;
-   /* FALLTHOUGH */
+   /* FALLTHROUGH */
case NV_TYPE_INT64:
case NV_TYPE_UINT64:
if (vsize == 0)
@@ -290,12 +290,12 @@ nv_validate(struct nv *nv, size_t *extra
case NV_TYPE_UINT16_ARRAY:
if (vsize == 0)
vsize = 2;
-   /* FALLTHOUGH */
+   /* FALLTHROUGH */
case NV_TYPE_INT32_ARRAY:
case NV_TYPE_UINT32_ARRAY:
if (vsize == 0)
vsize = 4;
-   /* FALLTHOUGH */
+   /* FALLTHROUGH */
case NV_TYPE_INT64_ARRAY:
case NV_TYPE_UINT64_ARRAY:
if (vsize == 0)
@@ -906,14 +906,14 @@ nv_swap(struct nvhdr *nvh, bool tohost)
case NV_TYPE_UINT16_ARRAY:
if (vsize == 0)
vsize = 2;
-   /* FALLTHOUGH */
+   /* FALLTHROUGH */
case NV_TYPE_INT32:
case NV_TYPE_UINT32:
case NV_TYPE_INT32_ARRAY:
case NV_TYPE_UINT32_ARRAY:
if (vsize == 0)
vsize = 4;
-   /* FALLTHOUGH */
+   /* FALLTHROUGH */
case NV_TYPE_INT64:
case NV_TYPE_UINT64:
case NV_TYPE_INT64_ARRAY:
___
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-23 Thread Konstantin Belousov
On Fri, Mar 23, 2012 at 08:10:56PM +, 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.

No, you are not allowed to break ABI for symvered libraries, even between
major releases.


pgpU0KrKi2vrF.pgp
Description: PGP signature


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

2012-03-23 Thread Alexander Kabaev
On Fri, 23 Mar 2012 22:23:35 +0200
Konstantin Belousov  wrote:

> On Fri, Mar 23, 2012 at 08:10:56PM +, 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.
> 
> No, you are not allowed to break ABI for symvered libraries, even
> between major releases.

You are, if we are ditching the system library in favor on one in
ports. Not polite, but I do not see a polite way out of this. The
libraries from ports are effectively shipped with incompatible ABI in
this area for about 4 years now. Luckily for us, breakage does not seem
to be affecting great many applications, as they do not use the changed
interface directly themselves. libobjc2 is the only known at the moment
that is known to be affected.


-- 
Alexander Kabaev


signature.asc
Description: PGP signature


svn commit: r233397 - head/contrib/gcc/config/mips

2012-03-23 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Fri Mar 23 21:07:10 2012
New Revision: 233397
URL: http://svn.freebsd.org/changeset/base/233397

Log:
  Disable IRIX compatibility flags for DWARF code generator. IRIX-compatible
  DWARF code is not compatible with CTF tools

Modified:
  head/contrib/gcc/config/mips/freebsd.h

Modified: head/contrib/gcc/config/mips/freebsd.h
==
--- head/contrib/gcc/config/mips/freebsd.h  Fri Mar 23 20:58:27 2012
(r233396)
+++ head/contrib/gcc/config/mips/freebsd.h  Fri Mar 23 21:07:10 2012
(r233397)
@@ -351,4 +351,5 @@ Boston, MA 02110-1301, USA.  */
 #endif
 
 /[  Debugger stuff  ]*/
-
+#undef DBX_DEBUGGING_INFO
+#undef MIPS_DEBUGGING_INFO
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2012-03-23 Thread Konstantin Belousov
On Fri, Mar 23, 2012 at 04:49:22PM -0400, Alexander Kabaev wrote:
> On Fri, 23 Mar 2012 22:23:35 +0200
> Konstantin Belousov  wrote:
> 
> > On Fri, Mar 23, 2012 at 08:10:56PM +, 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.
> > 
> > No, you are not allowed to break ABI for symvered libraries, even
> > between major releases.
> 
> You are, if we are ditching the system library in favor on one in
> ports. Not polite, but I do not see a polite way out of this. The
> libraries from ports are effectively shipped with incompatible ABI in
> this area for about 4 years now. Luckily for us, breakage does not seem
> to be affecting great many applications, as they do not use the changed
> interface directly themselves. libobjc2 is the only known at the moment
> that is known to be affected.

The patch just committed made the base-shipped library incompatible
with the ports and manual libstdc++ builds. 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.

Also, I think that consumers that depend of the ABI of std::typeinfo can
be hacked to understand the layout of vtable. I doubt that there are
many users that utilize typeinfo.


pgp1ImUqHp5wc.pgp
Description: PGP signature


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

2012-03-23 Thread Jilles Tjoelker
On Fri, Mar 23, 2012 at 08:26:32AM +, Ed Schouten wrote:
> Author: ed
> Date: Fri Mar 23 08:26:31 2012
> New Revision: 233345
> URL: http://svn.freebsd.org/changeset/base/233345

> Log:
>   Make utmpx(3) thread safe if we support TLS.

>   Because the utmpx interface is generally not required to be thread-safe,
>   but it is nice to have, if easy to do so. Therefore don't make a mess
>   out of the code and only use it if __NO_TLS is not defined.

Hmm, I think this is a portability trap, at least as long it is
supported to have a platform with threading but without __NO_TLS.

Besides, I am not sure if this functionality is worth 12 or 20 bytes of
memory per thread because most applications do not use it. I think a
pthread_key_create() when the first thread calls an utmpx function
optimizes for the case where utmpx is not used or used by only one
thread.

A reason to make utmpx thread-safe could be that glibc does it or
popular applications (almost) need it.

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


svn commit: r233400 - head/sys/sys

2012-03-23 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Fri Mar 23 22:52:23 2012
New Revision: 233400
URL: http://svn.freebsd.org/changeset/base/233400

Log:
  Add define for MIPS.options

Modified:
  head/sys/sys/elf_common.h

Modified: head/sys/sys/elf_common.h
==
--- head/sys/sys/elf_common.h   Fri Mar 23 22:03:46 2012(r233399)
+++ head/sys/sys/elf_common.h   Fri Mar 23 22:52:23 2012(r233400)
@@ -296,6 +296,7 @@ typedef struct {
 #defineSHT_HIOS0x6fff  /* Last of OS specific 
semantics */
 #defineSHT_LOPROC  0x7000  /* reserved range for 
processor */
 #defineSHT_AMD64_UNWIND0x7001  /* unwind information */
+#defineSHT_MIPS_OPTIONS0x700d
 #defineSHT_MIPS_DWARF  0x701e  /* MIPS gcc uses 
MIPS_DWARF */
 #defineSHT_HIPROC  0x7fff  /* specific section 
header types */
 #defineSHT_LOUSER  0x8000  /* reserved range for 
application */
___
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: r233401 - head/lib/libelf

2012-03-23 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Fri Mar 23 22:55:37 2012
New Revision: 233401
URL: http://svn.freebsd.org/changeset/base/233401

Log:
  Add handler for MIPS.options section

Modified:
  head/lib/libelf/libelf_data.c

Modified: head/lib/libelf/libelf_data.c
==
--- head/lib/libelf/libelf_data.c   Fri Mar 23 22:52:23 2012
(r233400)
+++ head/lib/libelf/libelf_data.c   Fri Mar 23 22:55:37 2012
(r233401)
@@ -86,6 +86,8 @@ _libelf_xlate_shtype(uint32_t sht)
 #endif
case SHT_MIPS_DWARF:
/* FALLTHROUGH */
+   case SHT_MIPS_OPTIONS:
+   /* FALLTHROUGH */
case SHT_AMD64_UNWIND:  /* == SHT_IA_64_UNWIND */
return (ELF_T_BYTE);
default:
___
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: r233402 - head/lib/libproc

2012-03-23 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Fri Mar 23 23:07:02 2012
New Revision: 233402
URL: http://svn.freebsd.org/changeset/base/233402

Log:
  Make libproc compilable for MIPS

Modified:
  head/lib/libproc/proc_bkpt.c
  head/lib/libproc/proc_regs.c

Modified: head/lib/libproc/proc_bkpt.c
==
--- head/lib/libproc/proc_bkpt.cFri Mar 23 22:55:37 2012
(r233401)
+++ head/lib/libproc/proc_bkpt.cFri Mar 23 23:07:02 2012
(r233402)
@@ -44,6 +44,9 @@ __FBSDID("$FreeBSD$");
 #if defined(__i386__) || defined(__amd64__)
 #define BREAKPOINT_INSTR   0xcc/* int 0x3 */
 #defineBREAKPOINT_INSTR_SZ 1
+#elif defined(__mips__)
+#define BREAKPOINT_INSTR   0xd /* break */
+#defineBREAKPOINT_INSTR_SZ 4
 #else
 #error "Add support for your architecture"
 #endif

Modified: head/lib/libproc/proc_regs.c
==
--- head/lib/libproc/proc_regs.cFri Mar 23 22:55:37 2012
(r233401)
+++ head/lib/libproc/proc_regs.cFri Mar 23 23:07:02 2012
(r233402)
@@ -58,6 +58,8 @@ proc_regget(struct proc_handle *phdl, pr
*regvalue = regs.r_rip;
 #elif defined(__i386__)
*regvalue = regs.r_eip;
+#elif defined(__mips__)
+   *regvalue = regs.r_regs[PC];
 #endif
break;
case REG_SP:
@@ -65,6 +67,8 @@ proc_regget(struct proc_handle *phdl, pr
*regvalue = regs.r_rsp;
 #elif defined(__i386__)
*regvalue = regs.r_esp;
+#elif defined(__mips__)
+   *regvalue = regs.r_regs[SP];
 #endif
break;
default:
@@ -93,6 +97,8 @@ proc_regset(struct proc_handle *phdl, pr
regs.r_rip = regvalue;
 #elif defined(__i386__)
regs.r_eip = regvalue;
+#elif defined(__mips__)
+   regs.r_regs[PC] = regvalue;
 #endif
break;
case REG_SP:
@@ -100,6 +106,8 @@ proc_regset(struct proc_handle *phdl, pr
regs.r_rsp = regvalue;
 #elif defined(__i386__)
regs.r_esp = regvalue;
+#elif defined(__mips__)
+   regs.r_regs[PC] = regvalue;
 #endif
break;
default:
___
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-23 Thread David Chisnall
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...

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 :-(

David___
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: r233403 - head/sys/dev/mpt

2012-03-23 Thread Marius Strobl
Author: marius
Date: Sat Mar 24 00:30:17 2012
New Revision: 233403
URL: http://svn.freebsd.org/changeset/base/233403

Log:
  - Use the PCI ID macros from mpi_cnfg.h rather than duplicating them here.
Note that this driver additionally probes some device IDs for the most
part not know to other MPT drivers, if at all. So rename the macros not
present in mpi_cnfg.h to match the naming scheme in the latter and but
suffix them with a _FB in order to not cause conflicts.
  - Like mpt_set_config_regs(), comment out mpt_read_config_regs() as the
content of the registers read isn't actually used and both functions
aren't exactly up to date regarding the possible layouts of the BARs
(these function might be helpful for debugging though, so don't remove
them completely).
  - Use DEVMETHOD_END.
  - Use NULL rather than 0 for pointers.
  - Remove an unusual check for the softc being NULL.
  - Remove redundant zeroing of the softc.
  - Remove an overly banal and actually partly incorrect as well as partly
outdated comment regarding the allocation of the memory resource.
  
  MFC after:3 days

Modified:
  head/sys/dev/mpt/mpt.h
  head/sys/dev/mpt/mpt_pci.c

Modified: head/sys/dev/mpt/mpt.h
==
--- head/sys/dev/mpt/mpt.h  Fri Mar 23 23:07:02 2012(r233402)
+++ head/sys/dev/mpt/mpt.h  Sat Mar 24 00:30:17 2012(r233403)
@@ -716,7 +716,9 @@ struct mpt_softc {
int pci_msi_count;
struct resource *   pci_irq;/* Interrupt map for chip */
void *  ih; /* Interrupt handle */
+#if 0
struct mpt_pci_cfg  pci_cfg;/* saved PCI conf registers */
+#endif
 
/*
 * DMA Mapping Stuff

Modified: head/sys/dev/mpt/mpt_pci.c
==
--- head/sys/dev/mpt/mpt_pci.c  Fri Mar 23 23:07:02 2012(r233402)
+++ head/sys/dev/mpt/mpt_pci.c  Sat Mar 24 00:30:17 2012(r233403)
@@ -105,6 +105,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include 
+
 #if __FreeBSD_version < 70
 #definepci_msix_count(x)   0
 #definepci_msi_count(x)0
@@ -113,104 +115,36 @@ __FBSDID("$FreeBSD$");
 #definepci_release_msi(x)  do { ; } while (0)
 #endif
 
-#ifndefPCI_VENDOR_LSI
-#definePCI_VENDOR_LSI  0x1000
-#endif
-
-#ifndefPCI_PRODUCT_LSI_FC909
-#definePCI_PRODUCT_LSI_FC909   0x0620
-#endif
-
-#ifndefPCI_PRODUCT_LSI_FC909A
-#definePCI_PRODUCT_LSI_FC909A  0x0621
-#endif
-
-#ifndefPCI_PRODUCT_LSI_FC919
-#definePCI_PRODUCT_LSI_FC919   0x0624
-#endif
-
-#ifndefPCI_PRODUCT_LSI_FC919_LAN
-#definePCI_PRODUCT_LSI_FC919_LAN   0x0625
-#endif
-
-#ifndefPCI_PRODUCT_LSI_FC929
-#definePCI_PRODUCT_LSI_FC929   0x0622
-#endif
-
-#ifndefPCI_PRODUCT_LSI_FC929_LAN
-#definePCI_PRODUCT_LSI_FC929_LAN   0x0623
-#endif
-
-#ifndefPCI_PRODUCT_LSI_FC929X
-#definePCI_PRODUCT_LSI_FC929X  0x0626
-#endif
-
-#ifndefPCI_PRODUCT_LSI_FC929X_LAN
-#definePCI_PRODUCT_LSI_FC929X_LAN  0x0627
-#endif
-
-#ifndefPCI_PRODUCT_LSI_FC919X
-#definePCI_PRODUCT_LSI_FC919X  0x0628
-#endif
-
-#ifndefPCI_PRODUCT_LSI_FC919X_LAN
-#definePCI_PRODUCT_LSI_FC919X_LAN  0x0629
-#endif
-
-#ifndefPCI_PRODUCT_LSI_FC7X04X
-#definePCI_PRODUCT_LSI_FC7X04X 0x0640
-#endif
-
-#ifndefPCI_PRODUCT_LSI_FC646
-#definePCI_PRODUCT_LSI_FC646   0x0646
-#endif
-
-#ifndefPCI_PRODUCT_LSI_1030
-#definePCI_PRODUCT_LSI_10300x0030
-#endif
-
-#ifndefPCI_PRODUCT_LSI_1030ZC
-#definePCI_PRODUCT_LSI_1030ZC  0x0031
-#endif
-
-#ifndefPCI_PRODUCT_LSI_SAS1064
-#define PCI_PRODUCT_LSI_SAS10640x0050
-#endif
-
-#ifndef PCI_PRODUCT_LSI_SAS1064A
-#define PCI_PRODUCT_LSI_SAS1064A   0x005C
-#endif
-
-#ifndef PCI_PRODUCT_LSI_SAS1064E
-#define PCI_PRODUCT_LSI_SAS1064E   0x0056
-#endif
+/*
+ * XXX it seems no other MPT driver knows about the following chips.
+ */
 
-#ifndef PCI_PRODUCT_LSI_SAS1066
-#define PCI_PRODUCT_LSI_SAS10660x005E
+#ifndefMPI_MANUFACTPAGE_DEVICEID_FC909_FB
+#defineMPI_MANUFACTPAGE_DEVICEID_FC909_FB  0x0620
 #endif
 
-#ifndef PCI_PRODUCT_LSI_SAS1066E
-#define PCI_PRODUCT_LSI_SAS1066E   0x005A
+#ifndefMPI_MANUFACTPAGE_DEVICEID_FC919_LAN_FB
+#defineMPI_MANUFACTPAGE_DEVICEID_FC919_LAN_FB  0x0625
 #endif
 
-#ifndef PCI_PRODUCT_LSI_SAS1068
-#define PCI_PRODUCT_LSI_SAS10680x0054
+#ifndefMPI_MANUFACTPAGE_DEVICEID_FC929_LAN_FB
+#defineMPI_MANUFACTPAGE_DEVICEID_FC929_LAN_FB  0x0623
 #endif
 
-#ifndef PCI_PRODUCT_LSI_SAS

svn commit: r233404 - head/sys/dev/mpt

2012-03-23 Thread Marius Strobl
Author: marius
Date: Sat Mar 24 00:37:56 2012
New Revision: 233404
URL: http://svn.freebsd.org/changeset/base/233404

Log:
  As it turns out, mpi_cnfg.h already is included by mpt.h.

Modified:
  head/sys/dev/mpt/mpt_pci.c

Modified: head/sys/dev/mpt/mpt_pci.c
==
--- head/sys/dev/mpt/mpt_pci.c  Sat Mar 24 00:30:17 2012(r233403)
+++ head/sys/dev/mpt/mpt_pci.c  Sat Mar 24 00:37:56 2012(r233404)
@@ -105,8 +105,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 
-
 #if __FreeBSD_version < 70
 #definepci_msix_count(x)   0
 #definepci_msi_count(x)0
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r233405 - head/kerberos5/lib/libkafs5

2012-03-23 Thread Stanislav Sedov
Author: stas
Date: Sat Mar 24 00:42:38 2012
New Revision: 233405
URL: http://svn.freebsd.org/changeset/base/233405

Log:
  - Apply binutils workaround on mips.mips as well.  Though this TARGET_ARCH
is deprecated, tinderbox uses it.

Modified:
  head/kerberos5/lib/libkafs5/Makefile

Modified: head/kerberos5/lib/libkafs5/Makefile
==
--- head/kerberos5/lib/libkafs5/MakefileSat Mar 24 00:37:56 2012
(r233404)
+++ head/kerberos5/lib/libkafs5/MakefileSat Mar 24 00:42:38 2012
(r233405)
@@ -10,7 +10,8 @@ MAN=  kafs5.3
 # Linking with libkrb5 uncovers a bug in binutils.
 # See 
http://repo.or.cz/w/binutils.git/commit/ee05170bf71819c99cb5a36a44735c231ae03c56
 .
 #
-.if ${MACHINE_ARCH} != "mipsn32eb" && ${MACHINE_ARCH} != "mipsel" && 
${MACHINE_ARCH} != "mipseb"
+.if ${MACHINE_ARCH} != "mipsn32eb" && ${MACHINE_ARCH} != "mipsel" && \
+${MACHINE_ARCH} != "mipseb" && ${MACHINE_ARCH} != "mips"
 LDADD+=-lkrb5
 LDFLAGS=   -Wl,--no-undefined
 .endif
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r233406 - head/lib/libpam/modules/pam_krb5

2012-03-23 Thread Stanislav Sedov
Author: stas
Date: Sat Mar 24 01:02:03 2012
New Revision: 233406
URL: http://svn.freebsd.org/changeset/base/233406

Log:
  - Avoid using deprecated heimdal functions in pam_krb5.

Modified:
  head/lib/libpam/modules/pam_krb5/Makefile
  head/lib/libpam/modules/pam_krb5/pam_krb5.c

Modified: head/lib/libpam/modules/pam_krb5/Makefile
==
--- head/lib/libpam/modules/pam_krb5/Makefile   Sat Mar 24 00:42:38 2012
(r233405)
+++ head/lib/libpam/modules/pam_krb5/Makefile   Sat Mar 24 01:02:03 2012
(r233406)
@@ -32,8 +32,6 @@ CFLAGS+=-D_FREEFALL_CONFIG
 WARNS?=3
 .endif
 
-NO_WERROR= yes
-
 DPADD= ${LIBKRB5} ${LIBHX509} ${LIBASN1} ${LIBROKEN} ${LIBCOM_ERR} ${LIBCRYPT} 
${LIBCRYPTO}
 LDADD= -lkrb5 -lhx509 -lasn1 -lroken -lcom_err -lcrypt -lcrypto
 

Modified: head/lib/libpam/modules/pam_krb5/pam_krb5.c
==
--- head/lib/libpam/modules/pam_krb5/pam_krb5.c Sat Mar 24 00:42:38 2012
(r233405)
+++ head/lib/libpam/modules/pam_krb5/pam_krb5.c Sat Mar 24 01:02:03 2012
(r233406)
@@ -92,6 +92,13 @@ static void  compat_free_data_contents(kr
 #define PAM_OPT_NO_USER_CHECK  "no_user_check"
 #define PAM_OPT_REUSE_CCACHE   "reuse_ccache"
 
+#definePAM_LOG_KRB5_ERR(ctx, rv, fmt, ...) 
\
+   do {\
+   const char *krb5msg = krb5_get_error_message(ctx, rv);  \
+   PAM_LOG(fmt ": %s", ##__VA_ARGS__, krb5msg);\
+   krb5_free_error_message(ctx, krb5msg);  \
+   } while (0)
+
 /*
  * authentication management
  */
@@ -104,7 +111,7 @@ pam_sm_authenticate(pam_handle_t *pamh, 
krb5_creds creds;
krb5_principal princ;
krb5_ccache ccache;
-   krb5_get_init_creds_opt opts;
+   krb5_get_init_creds_opt *opts;
struct passwd *pwd;
int retval;
const void *ccache_data;
@@ -139,13 +146,6 @@ pam_sm_authenticate(pam_handle_t *pamh, 
 
PAM_LOG("Context initialised");
 
-   krb5_get_init_creds_opt_init(&opts);
-
-   if (openpam_get_option(pamh, PAM_OPT_FORWARDABLE))
-   krb5_get_init_creds_opt_set_forwardable(&opts, 1);
-
-   PAM_LOG("Credentials initialised");
-
krbret = krb5_cc_register(pam_context, &krb5_mcc_ops, FALSE);
if (krbret != 0 && krbret != KRB5_CC_TYPE_EXISTS) {
PAM_VERBOSE_ERROR("Kerberos 5 error");
@@ -166,8 +166,7 @@ pam_sm_authenticate(pam_handle_t *pamh, 
krbret = krb5_parse_name(pam_context, principal, &princ);
free(principal);
if (krbret != 0) {
-   PAM_LOG("Error krb5_parse_name(): %s",
-   krb5_get_err_text(pam_context, krbret));
+   PAM_LOG_KRB5_ERR(pam_context, krbret, "Error 
krb5_parse_name()");
PAM_VERBOSE_ERROR("Kerberos 5 error");
retval = PAM_SERVICE_ERR;
goto cleanup3;
@@ -179,8 +178,8 @@ pam_sm_authenticate(pam_handle_t *pamh, 
princ_name = NULL;
krbret = krb5_unparse_name(pam_context, princ, &princ_name);
if (krbret != 0) {
-   PAM_LOG("Error krb5_unparse_name(): %s",
-   krb5_get_err_text(pam_context, krbret));
+   PAM_LOG_KRB5_ERR(pam_context, krbret,
+   "Error krb5_unparse_name()");
PAM_VERBOSE_ERROR("Kerberos 5 error");
retval = PAM_SERVICE_ERR;
goto cleanup2;
@@ -206,8 +205,8 @@ pam_sm_authenticate(pam_handle_t *pamh, 
sizeof(luser), luser);
if (krbret != 0) {
PAM_VERBOSE_ERROR("Kerberos 5 error");
-   PAM_LOG("Error krb5_aname_to_localname(): %s",
-   krb5_get_err_text(pam_context, krbret));
+   PAM_LOG_KRB5_ERR(pam_context, krbret,
+   "Error krb5_aname_to_localname()");
retval = PAM_USER_UNKNOWN;
goto cleanup2;
}
@@ -228,14 +227,30 @@ pam_sm_authenticate(pam_handle_t *pamh, 
PAM_LOG("Done getpwnam()");
}
 
+   /* Initialize credentials request options. */
+   krbret = krb5_get_init_creds_opt_alloc(pam_context, &opts);
+   if (krbret != 0) {
+   PAM_LOG_KRB5_ERR(pam_context, krbret,
+   "Error krb5_get_init_creds_opt_alloc()");
+   PAM_VERBOSE_ERROR("Kerberos 5 error");
+   retval = PAM_SERVICE_ERR;
+   goto cleanup2;
+   }
+
+   if (openpam_get_option(pamh, PAM_OPT_FORWARDABLE))
+   krb5_get_init_creds_opt_set_forwardable(opts, 1);
+
+   PAM_LOG("Credential options initialised");
+
/* Get a TGT

svn commit: r233407 - head/cddl/contrib/opensolaris/tools/ctf/cvt

2012-03-23 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Sat Mar 24 01:47:33 2012
New Revision: 233407
URL: http://svn.freebsd.org/changeset/base/233407

Log:
  Maintain target's byte order for multi-byte fields in CTF structures.
  
  CTF format is not cross-platform by design, e.g. it is not guaranteed
  that data generated by ctfconvert/ctfmerge on one architecture will
  be successfuly read on another. CTF structures are saved/restored
  using naive approach. Roughly it looks like:
write(fd, &ctf_struct, sizeof(ctf_struct))
read(fd, &ctf_struct, sizeof(ctf_struct))
  
  By sheer luck memory layout of all type-related CTF structures is the same
  on amd64/i386/mips32/mips64. It's different on ARM though. sparc, ia64,
  powerpc, and powerpc64 were not tested. So in order to get file compatible
  with dtrace on ARM it should be compiled on ARM. Alternative solution would
  be to have "signatures" for every platform and ctfmerge should convert host's
  reperesentation of CTF structure to target's one using "signature" as 
template.
  
  This patch checks byte order of ELF files used for generating CTF record
  and makes sure that byte order of data written to resulting files is the same
  as target's byte order.

Modified:
  head/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c
  head/cddl/contrib/opensolaris/tools/ctf/cvt/ctfmerge.c
  head/cddl/contrib/opensolaris/tools/ctf/cvt/ctftools.h
  head/cddl/contrib/opensolaris/tools/ctf/cvt/output.c

Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c
==
--- head/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c   Sat Mar 24 01:02:03 
2012(r233406)
+++ head/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c   Sat Mar 24 01:47:33 
2012(r233407)
@@ -62,6 +62,18 @@ struct ctf_buf {
int ntholes;/* number of type holes */
 };
 
+/*
+ * Macros to reverse byte order
+ */
+#defineBSWAP_8(x)  ((x) & 0xff)
+#defineBSWAP_16(x) ((BSWAP_8(x) << 8) | BSWAP_8((x) >> 8))
+#defineBSWAP_32(x) ((BSWAP_16(x) << 16) | BSWAP_16((x) >> 16))
+
+#defineSWAP_16(x)  (x) = BSWAP_16(x)
+#defineSWAP_32(x)  (x) = BSWAP_32(x)
+
+static int target_requires_swap;
+
 /*PRINTFLIKE1*/
 static void
 parseterminate(const char *fmt, ...)
@@ -140,6 +152,11 @@ write_label(void *arg1, void *arg2)
ctl.ctl_label = strtab_insert(&b->ctb_strtab, le->le_name);
ctl.ctl_typeidx = le->le_idx;
 
+   if (target_requires_swap) {
+   SWAP_32(ctl.ctl_label);
+   SWAP_32(ctl.ctl_typeidx);
+   }
+
ctf_buf_write(b, &ctl, sizeof (ctl));
 
return (1);
@@ -152,6 +169,10 @@ write_objects(iidesc_t *idp, ctf_buf_t *
 
ctf_buf_write(b, &id, sizeof (id));
 
+   if (target_requires_swap) {
+   SWAP_16(id);
+   }
+
debug(3, "Wrote object %s (%d)\n", (idp ? idp->ii_name : "(null)"), id);
 }
 
@@ -180,10 +201,21 @@ write_functions(iidesc_t *idp, ctf_buf_t
 
fdata[0] = CTF_TYPE_INFO(CTF_K_FUNCTION, 1, nargs);
fdata[1] = idp->ii_dtype->t_id;
+
+   if (target_requires_swap) {
+   SWAP_16(fdata[0]);
+   SWAP_16(fdata[1]);
+   }
+
ctf_buf_write(b, fdata, sizeof (fdata));
 
for (i = 0; i < idp->ii_nargs; i++) {
id = idp->ii_args[i]->t_id;
+
+   if (target_requires_swap) {
+   SWAP_16(id);
+   }
+
ctf_buf_write(b, &id, sizeof (id));
}
 
@@ -208,11 +240,25 @@ write_sized_type_rec(ctf_buf_t *b, ctf_t
ctt->ctt_size = CTF_LSIZE_SENT;
ctt->ctt_lsizehi = CTF_SIZE_TO_LSIZE_HI(size);
ctt->ctt_lsizelo = CTF_SIZE_TO_LSIZE_LO(size);
+   if (target_requires_swap) {
+   SWAP_32(ctt->ctt_name);
+   SWAP_16(ctt->ctt_info);
+   SWAP_16(ctt->ctt_size);
+   SWAP_32(ctt->ctt_lsizehi);
+   SWAP_32(ctt->ctt_lsizelo);
+   }
ctf_buf_write(b, ctt, sizeof (*ctt));
} else {
ctf_stype_t *cts = (ctf_stype_t *)ctt;
 
cts->ctt_size = (ushort_t)size;
+
+   if (target_requires_swap) {
+   SWAP_32(cts->ctt_name);
+   SWAP_16(cts->ctt_info);
+   SWAP_16(cts->ctt_size);
+   }
+
ctf_buf_write(b, cts, sizeof (*cts));
}
 }
@@ -222,6 +268,12 @@ write_unsized_type_rec(ctf_buf_t *b, ctf
 {
ctf_stype_t *cts = (ctf_stype_t *)ctt;
 
+   if (target_requires_swap) {
+   SWAP_32(cts->ctt_name);
+   SWAP_16(cts->ctt_info);
+   SWAP_16(cts->ctt_size);
+   }
+
ctf_buf_write(b, cts, sizeof (*cts));
 }
 
@@ -296,6 +348,9 @@ write_type(void *arg1, void *arg2)
encoding = ip->intr_fformat;
 

svn commit: r233408 - in head/sys/cddl/contrib/opensolaris/uts: common/dtrace mips mips/dtrace mips/sys

2012-03-23 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Sat Mar 24 04:52:18 2012
New Revision: 233408
URL: http://svn.freebsd.org/changeset/base/233408

Log:
  Add MIPS support to cddl/contrib part:
  
  - header and stub .c file for fasttrap module. It's not supported on
  MIPS yet, but there is no way to disable support completely
  - Do as amd64 trying to limit allocated memory

Added:
  head/sys/cddl/contrib/opensolaris/uts/mips/
  head/sys/cddl/contrib/opensolaris/uts/mips/dtrace/
  head/sys/cddl/contrib/opensolaris/uts/mips/dtrace/fasttrap_isa.c   (contents, 
props changed)
  head/sys/cddl/contrib/opensolaris/uts/mips/sys/
  head/sys/cddl/contrib/opensolaris/uts/mips/sys/fasttrap_isa.h   (contents, 
props changed)
Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.cSat Mar 
24 01:47:33 2012(r233407)
+++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.cSat Mar 
24 04:52:18 2012(r233408)
@@ -235,7 +235,7 @@ static dtrace_dynvar_t  dtrace_dynhash_si
 static struct mtx  dtrace_unr_mtx;
 MTX_SYSINIT(dtrace_unr_mtx, &dtrace_unr_mtx, "Unique resource identifier", 
MTX_DEF);
 intdtrace_in_probe;/* non-zero if executing a probe */
-#if defined(__i386__) || defined(__amd64__)
+#if defined(__i386__) || defined(__amd64__) || defined(__mips__)
 uintptr_t  dtrace_in_probe_addr;   /* Address of invop when already in 
probe */
 #endif
 #endif
@@ -10659,7 +10659,7 @@ err:
 #else
int i;
 
-#if defined(__amd64__)
+#if defined(__amd64__) || defined(__mips__)
/*
 * FreeBSD isn't good at limiting the amount of memory we
 * ask to malloc, so let's place a limit here before trying

Added: head/sys/cddl/contrib/opensolaris/uts/mips/dtrace/fasttrap_isa.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/cddl/contrib/opensolaris/uts/mips/dtrace/fasttrap_isa.cSat Mar 
24 04:52:18 2012(r233408)
@@ -0,0 +1,30 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+/*
+ * XXX: Placeholder for MIPS fasttrap code
+ */

Added: head/sys/cddl/contrib/opensolaris/uts/mips/sys/fasttrap_isa.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/cddl/contrib/opensolaris/uts/mips/sys/fasttrap_isa.h   Sat Mar 
24 04:52:18 2012(r233408)
@@ -0,0 +1,48 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License, Version 1.0 only
+ * (the "License").  You may not use this file except in compliance
+ * with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#ifndef_FASTTRAP_ISA_H
+#define_FASTTRAP_ISA_H
+
+#pragma ident  "%Z%%M% %I% %E% SMI"
+
+#include 
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ *  XXXDTRACE: placehodler for MIPS fasttrap stuff
+ */
+
+typedefuint32_tfasttrap_instr_t;
+#defineFASTTRAP_SUNWDTRACE_SIZE64
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _FASTTRAP_ISA_H */
__

svn commit: r233409 - in head/sys/cddl/dev: dtrace/mips lockstat profile

2012-03-23 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Sat Mar 24 05:14:37 2012
New Revision: 233409
URL: http://svn.freebsd.org/changeset/base/233409

Log:
  Add device part of DTrace/MIPS code

Added:
  head/sys/cddl/dev/dtrace/mips/
  head/sys/cddl/dev/dtrace/mips/dtrace_asm.S   (contents, props changed)
  head/sys/cddl/dev/dtrace/mips/dtrace_isa.c   (contents, props changed)
  head/sys/cddl/dev/dtrace/mips/dtrace_subr.c   (contents, props changed)
  head/sys/cddl/dev/dtrace/mips/regset.h   (contents, props changed)
Modified:
  head/sys/cddl/dev/lockstat/lockstat.c
  head/sys/cddl/dev/profile/profile.c

Added: head/sys/cddl/dev/dtrace/mips/dtrace_asm.S
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/cddl/dev/dtrace/mips/dtrace_asm.S  Sat Mar 24 05:14:37 2012
(r233409)
@@ -0,0 +1,303 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License, Version 1.0 only
+ * (the "License").  You may not use this file except in compliance
+ * with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ *
+ * $FreeBSD$
+ */
+/*
+ * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#define _ASM
+#define _LOCORE
+#define LOCORE
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include "assym.s"
+
+.setnoreorder   # Noreorder is default style!
+
+/*
+ * Primitives
+ */
+
+.text
+
+/*
+void dtrace_membar_producer(void)
+*/
+LEAF(dtrace_membar_producer)
+   j   ra
+   nop
+END(dtrace_membar_producer)
+
+/*
+void dtrace_membar_consumer(void)
+*/
+LEAF(dtrace_membar_consumer)
+   j   ra
+   nop
+END(dtrace_membar_consumer)
+
+/*
+dtrace_icookie_t dtrace_interrupt_disable(void)
+*/
+LEAF(dtrace_interrupt_disable)
+   mfc0t0, MIPS_COP_0_STATUS
+   movev0, t0
+   and v0, v0, MIPS_SR_INT_IE
+   and t0, t0, ~MIPS_SR_INT_IE
+   mtc0t0, MIPS_COP_0_STATUS
+   j   ra
+   nop
+END(dtrace_interrupt_disable)
+
+/*
+void dtrace_interrupt_enable(dtrace_icookie_t cookie)
+*/
+LEAF(dtrace_interrupt_enable)
+   mfc0t0, MIPS_COP_0_STATUS
+   beqza0, not_enabled
+   or  t0, t0, MIPS_SR_INT_IE
+   mtc0t0, MIPS_COP_0_STATUS
+not_enabled:
+   j   ra
+   nop
+END(dtrace_interrupt_enable)
+
+/*
+uint32_t dtrace_cas32(uint32_t *target, uint32_t cmp, uint32_t new)
+*/
+LEAF(dtrace_cas32)
+1:
+   movet1, a2
+   ll  t0, 0(a0)
+   bne t0, a1, 2f
+   nop
+   sc  t1, 0(a0)
+   beqzt1, 1b
+   nop
+2: movev0, t0
+   j   ra
+   nop
+END(dtrace_cas32)
+
+/*
+void *
+dtrace_casptr(void *target, void *cmp, void *new)
+*/
+LEAF(dtrace_casptr)
+1:
+   movet1, a2
+   PTR_LL  t0, 0(a0)
+   bne t0, a1, 2f
+   nop
+   PTR_SC  t1, 0(a0)
+   beqzt1, 1b
+   nop
+2: movev0, t0
+   j   ra
+   nop
+END(dtrace_casptr)
+
+
+/*
+uintptr_t
+dtrace_fulword(void *addr)
+*/
+LEAF(dtrace_fulword)
+END(dtrace_fulword)
+
+/*
+uint8_t
+dtrace_fuword8_nocheck(void *addr)
+*/
+LEAF(dtrace_fuword8_nocheck)
+   lbu v0, 0(a0)
+   j   ra
+   nop
+END(dtrace_fuword8_nocheck)
+
+/*
+uint16_t
+dtrace_fuword16_nocheck(void *addr)
+*/
+LEAF(dtrace_fuword16_nocheck)
+   lhu v0, 0(a0)
+   j   ra
+   nop
+END(dtrace_fuword16_nocheck)
+
+/*
+uint32_t
+dtrace_fuword32_nocheck(void *addr)
+*/
+LEAF(dtrace_fuword32_nocheck)
+   lwu v0, 0(a0)
+   j   ra
+   nop
+END(dtrace_fuword32_nocheck)
+
+/*
+uint64_t
+dtrace_fuword64_nocheck(void *addr)
+*/
+LEAF(dtrace_fuword64_nocheck)
+#if defined(__mips_n64) || defined(__mips_n32)
+   ld  v0, 0(a0)
+#else
+   lw  v1,4(a0)
+   lw  v0,0(a0)
+#endif
+   j   ra
+   nop
+END(dtrace_fuword64_nocheck)
+
+/*
+XXX: unoptimized
+void
+dtrace_copy(uintptr_t src, uintptr_t dest, size_t size)
+*/
+LEAF(dtrace_copy)
+1:
+   beqza2, 2f
+   nop
+   lbu t0, 0(a0)
+   sb  t0, 0(a1)
+   daddu   a0, a0, 1
+   daddu   a1, a1, 1
+   dsubu   a2, a2, 1
+   j   1b
+   nop
+2:
+   j   ra
+   nop
+END(dtrace_copy)
+
+/*
+XXX: Unoptimized. Check for fla

svn commit: r233410 - head/sys/modules/dtrace

2012-03-23 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Sat Mar 24 05:15:14 2012
New Revision: 233410
URL: http://svn.freebsd.org/changeset/base/233410

Log:
  Make lockstat and profile modules x86-only

Modified:
  head/sys/modules/dtrace/Makefile

Modified: head/sys/modules/dtrace/Makefile
==
--- head/sys/modules/dtrace/MakefileSat Mar 24 05:14:37 2012
(r233409)
+++ head/sys/modules/dtrace/MakefileSat Mar 24 05:15:14 2012
(r233410)
@@ -9,14 +9,12 @@ SUBDIR=   dtmalloc\
dtrace  \
dtraceall   \
dtrace_test \
-   lockstat\
-   profile \
prototype   \
sdt \
systrace
 
 .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
-SUBDIR+=   fasttrap fbt systrace_linux32
+SUBDIR+=   fasttrap fbt lockstat profile systrace_linux32
 .endif
 .if ${MACHINE_CPUARCH} == "amd64"
 SUBDIR+=   systrace_freebsd32
___
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: r233411 - head/sys/modules/cyclic

2012-03-23 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Sat Mar 24 05:16:26 2012
New Revision: 233411
URL: http://svn.freebsd.org/changeset/base/233411

Log:
  Jusy use i386 version of cyclic_machdep.c on all supported architectures.
  It's generic enough to cover all of them.

Modified:
  head/sys/modules/cyclic/Makefile

Modified: head/sys/modules/cyclic/Makefile
==
--- head/sys/modules/cyclic/MakefileSat Mar 24 05:15:14 2012
(r233410)
+++ head/sys/modules/cyclic/MakefileSat Mar 24 05:16:26 2012
(r233411)
@@ -10,7 +10,7 @@ SRCS+=vnode_if.h
 CFLAGS+=   -I${.CURDIR}/../../cddl/compat/opensolaris  \
-I${.CURDIR}/../../cddl/contrib/opensolaris/uts/common  \
-I${.CURDIR}/../..  \
-   
-I${.CURDIR}/../../cddl/dev/cyclic/${MACHINE_CPUARCH:S/amd64/i386/}
+   -I${.CURDIR}/../../cddl/dev/cyclic/i386
 
 CFLAGS+=   -DDEBUG=1
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2012-03-23 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Sat Mar 24 05:17:38 2012
New Revision: 233412
URL: http://svn.freebsd.org/changeset/base/233412

Log:
  Add DTrace-related part to machine-dependent code:
  
  - DTrace trap handler
  - invop-related variables (unused on MIPS but still referenced from dtrace)

Modified:
  head/sys/mips/mips/exception.S
  head/sys/mips/mips/trap.c

Modified: head/sys/mips/mips/exception.S
==
--- head/sys/mips/mips/exception.S  Sat Mar 24 05:16:26 2012
(r233411)
+++ head/sys/mips/mips/exception.S  Sat Mar 24 05:17:38 2012
(r233412)
@@ -55,6 +55,7 @@
  */
 
 #include "opt_ddb.h"
+#include "opt_kdtrace.h"
 #include 
 #include 
 #include 
@@ -65,6 +66,26 @@
 
.setnoreorder   # Noreorder is default style!
 
+#ifdef KDTRACE_HOOKS
+   .data
+   .globl  dtrace_invop_jump_addr
+   .align  4
+   .type   dtrace_invop_jump_addr, @object
+.size  dtrace_invop_jump_addr, 8
+dtrace_invop_jump_addr:
+   .word   0
+   .word   0
+   .globl  dtrace_invop_calltrap_addr
+   .align  4
+   .type   dtrace_invop_calltrap_addr, @object
+.size  dtrace_invop_calltrap_addr, 8
+dtrace_invop_calltrap_addr:
+   .word   0
+   .word   0
+
+   .text
+#endif
+
 /*
  * Reasonable limit
  */

Modified: head/sys/mips/mips/trap.c
==
--- head/sys/mips/mips/trap.c   Sat Mar 24 05:16:26 2012(r233411)
+++ head/sys/mips/mips/trap.c   Sat Mar 24 05:17:38 2012(r233412)
@@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$");
 #include "opt_ddb.h"
 #include "opt_global.h"
 #include "opt_ktrace.h"
+#include "opt_kdtrace.h"
 
 #defineNO_REG_DEFS 1   /* Prevent asm.h from including 
regdef.h */
 #include 
@@ -93,6 +94,33 @@ __FBSDID("$FreeBSD$");
 #include 
 #endif
 
+#ifdef KDTRACE_HOOKS
+#include 
+
+/*
+ * This is a hook which is initialised by the dtrace module
+ * to handle traps which might occur during DTrace probe
+ * execution.
+ */
+dtrace_trap_func_t dtrace_trap_func;
+
+dtrace_doubletrap_func_t   dtrace_doubletrap_func;
+
+/*
+ * This is a hook which is initialised by the systrace module
+ * when it is loaded. This keeps the DTrace syscall provider
+ * implementation opaque. 
+ */
+systrace_probe_func_t  systrace_probe_func;
+
+/*
+ * These hooks are necessary for the pid, usdt and fasttrap providers.
+ */
+dtrace_fasttrap_probe_ptr_tdtrace_fasttrap_probe_ptr;
+dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr;
+dtrace_return_probe_ptr_t  dtrace_return_probe_ptr;
+#endif
+
 #ifdef TRAP_DEBUG
 int trap_debug = 0;
 SYSCTL_INT(_machdep, OID_AUTO, trap_debug, CTLFLAG_RW,
@@ -529,6 +557,29 @@ trap(struct trapframe *trapframe)
}
}
 #endif
+
+#ifdef KDTRACE_HOOKS
+   /*
+* A trap can occur while DTrace executes a probe. Before
+* executing the probe, DTrace blocks re-scheduling and sets
+* a flag in it's per-cpu flags to indicate that it doesn't
+* want to fault. On returning from the probe, the no-fault
+* flag is cleared and finally re-scheduling is enabled.
+*
+* If the DTrace kernel module has registered a trap handler,
+* call it and if it returns non-zero, assume that it has
+* handled the trap and modified the trap frame so that this
+* function can return normally.
+*/
+   /*
+* XXXDTRACE: add fasttrap and pid  probes handlers here (if ever)
+*/
+   if (!usermode) {
+   if (dtrace_trap_func != NULL && (*dtrace_trap_func)(trapframe, 
type))
+   return (trapframe->pc);
+   }
+#endif
+
switch (type) {
case T_MCHECK:
 #ifdef DDB
@@ -633,6 +684,9 @@ dofault:
PROC_LOCK(p);
--p->p_lock;
PROC_UNLOCK(p);
+   /*
+* XXXDTRACE: add dtrace_doubletrap_func here?
+*/
 #ifdef VMFAULT_TRACE
printf("vm_fault(%p (pmap %p), %p (%p), %x, %d) -> %x 
at pc %p\n",
map, &vm->vm_pmap, (void *)va, (void 
*)(intptr_t)trapframe->badvaddr,
___
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: r233413 - head/lib

2012-03-23 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Sat Mar 24 05:18:27 2012
New Revision: 233413
URL: http://svn.freebsd.org/changeset/base/233413

Log:
  Build libproc and librtld_db for MIPS

Modified:
  head/lib/Makefile

Modified: head/lib/Makefile
==
--- head/lib/Makefile   Sat Mar 24 05:17:38 2012(r233412)
+++ head/lib/Makefile   Sat Mar 24 05:18:27 2012(r233413)
@@ -197,6 +197,11 @@ _libefi=   libefi
 _libsmb=   libsmb
 .endif
 
+.if ${MACHINE_CPUARCH} == "mips"
+_libproc=  libproc
+_librtld_db=   librtld_db
+.endif
+
 .if ${MACHINE_CPUARCH} == "powerpc"
 _libsmb=   libsmb
 .endif
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r233414 - head/cddl/contrib/opensolaris/lib/libdtrace/mips

2012-03-23 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Sat Mar 24 05:27:39 2012
New Revision: 233414
URL: http://svn.freebsd.org/changeset/base/233414

Log:
  Add stub file for pid probe. It's required although pid probe is not supported
  on MIPS yet

Added:
  head/cddl/contrib/opensolaris/lib/libdtrace/mips/
  head/cddl/contrib/opensolaris/lib/libdtrace/mips/dt_isadep.c   (contents, 
props changed)

Added: head/cddl/contrib/opensolaris/lib/libdtrace/mips/dt_isadep.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/mips/dt_isadep.cSat Mar 
24 05:27:39 2012(r233414)
@@ -0,0 +1,75 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License, Version 1.0 only
+ * (the "License").  You may not use this file except in compliance
+ * with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident  "%Z%%M% %I% %E% SMI"
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+/*ARGSUSED*/
+int
+dt_pid_create_entry_probe(struct ps_prochandle *P, dtrace_hdl_t *dtp,
+fasttrap_probe_spec_t *ftp, const GElf_Sym *symp)
+{
+
+   dt_dprintf("%s: unimplemented\n", __func__);
+   return (DT_PROC_ERR);
+}
+
+int
+dt_pid_create_return_probe(struct ps_prochandle *P, dtrace_hdl_t *dtp,
+fasttrap_probe_spec_t *ftp, const GElf_Sym *symp, uint64_t *stret)
+{
+
+   dt_dprintf("%s: unimplemented\n", __func__);
+   return (DT_PROC_ERR);
+}
+
+/*ARGSUSED*/
+int
+dt_pid_create_offset_probe(struct ps_prochandle *P, dtrace_hdl_t *dtp,
+fasttrap_probe_spec_t *ftp, const GElf_Sym *symp, ulong_t off)
+{
+
+   dt_dprintf("%s: unimplemented\n", __func__);
+   return (DT_PROC_ERR);
+}
+
+/*ARGSUSED*/
+int
+dt_pid_create_glob_offset_probes(struct ps_prochandle *P, dtrace_hdl_t *dtp,
+fasttrap_probe_spec_t *ftp, const GElf_Sym *symp, const char *pattern)
+{
+
+   dt_dprintf("%s: unimplemented\n", __func__);
+   return (DT_PROC_ERR);
+}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r233415 - in head/cddl: lib lib/libdtrace usr.sbin

2012-03-23 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Sat Mar 24 05:29:07 2012
New Revision: 233415
URL: http://svn.freebsd.org/changeset/base/233415

Log:
  Enable build of DTrace-related userland parts for MIPS

Modified:
  head/cddl/lib/Makefile
  head/cddl/lib/libdtrace/Makefile
  head/cddl/usr.sbin/Makefile

Modified: head/cddl/lib/Makefile
==
--- head/cddl/lib/Makefile  Sat Mar 24 05:27:39 2012(r233414)
+++ head/cddl/lib/Makefile  Sat Mar 24 05:29:07 2012(r233415)
@@ -19,7 +19,7 @@ _libzpool=libzpool
 .endif
 .endif
 
-.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" ||  
${MACHINE_CPUARCH} == "mips"
 _drti= drti
 _libdtrace=libdtrace
 .endif

Modified: head/cddl/lib/libdtrace/Makefile
==
--- head/cddl/lib/libdtrace/MakefileSat Mar 24 05:27:39 2012
(r233414)
+++ head/cddl/lib/libdtrace/MakefileSat Mar 24 05:29:07 2012
(r233415)
@@ -42,8 +42,7 @@ SRCS= dt_aggregate.c \
dt_subr.c \
dt_work.c \
dt_xlator.c \
-   gmatch.c \
-   dis_tables.c
+   gmatch.c
 
 DSRCS= errno.d \
psinfo.d\
@@ -70,12 +69,17 @@ CFLAGS+=-I${OPENSOLARIS_SYS_DISTDIR}/ut
 .elif ${MACHINE_CPUARCH} == "sparc64"
 CFLAGS+=   -I${OPENSOLARIS_SYS_DISTDIR}/uts/sparc
 .PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/sparc
+.elif ${MACHINE_CPUARCH} == "mips"
+CFLAGS+=   -I${OPENSOLARIS_SYS_DISTDIR}/uts/mips
+.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/mips
+.PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/mips
 .else
 # temporary hack
 CFLAGS+=   -I${OPENSOLARIS_SYS_DISTDIR}/uts/intel
 .endif
 
 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
+SRCS+= dis_tables.c
 DSRCS+=regs_x86.d
 .endif
 

Modified: head/cddl/usr.sbin/Makefile
==
--- head/cddl/usr.sbin/Makefile Sat Mar 24 05:27:39 2012(r233414)
+++ head/cddl/usr.sbin/Makefile Sat Mar 24 05:29:07 2012(r233415)
@@ -19,4 +19,8 @@ _dtruss=  dtruss
 _lockstat= lockstat
 .endif
 
+.if ${MACHINE_CPUARCH} == "mips"
+_dtrace=   dtrace
+.endif
+
 .include 
___
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: r233416 - head

2012-03-23 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Sat Mar 24 05:30:13 2012
New Revision: 233416
URL: http://svn.freebsd.org/changeset/base/233416

Log:
  Build CTF tools as a part of toolchain for cross-compilation case

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Sat Mar 24 05:29:07 2012(r233415)
+++ head/Makefile.inc1  Sat Mar 24 05:30:13 2012(r233416)
@@ -1047,9 +1047,11 @@ _clang_tblgen= \
usr.bin/clang/clang-tblgen
 .endif
 
+# dtrace tools are required for older bootstrap env and cross-build
 .if ${MK_CDDL} != "no" && \
-${BOOTSTRAPPING} < 800038 && \
-!(${BOOTSTRAPPING} >= 700112 && ${BOOTSTRAPPING} < 79)
+((${BOOTSTRAPPING} < 800038 && \
+  !(${BOOTSTRAPPING} >= 700112 && ${BOOTSTRAPPING} < 79)) \
+  || (${MACHINE} != ${TARGET} || ${MACHINE_ARCH} != ${TARGET_ARCH}))
 _dtrace_tools= cddl/usr.bin/sgsmsg cddl/lib/libctf lib/libelf \
 lib/libdwarf cddl/usr.bin/ctfconvert cddl/usr.bin/ctfmerge
 .endif
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r233417 - head/sys/mips/cavium

2012-03-23 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Sat Mar 24 06:28:15 2012
New Revision: 233417
URL: http://svn.freebsd.org/changeset/base/233417

Log:
  Remap PMC interrupt for all cores

Modified:
  head/sys/mips/cavium/octeon_irq.h
  head/sys/mips/cavium/octeon_machdep.c
  head/sys/mips/cavium/octeon_pmc.c

Modified: head/sys/mips/cavium/octeon_irq.h
==
--- head/sys/mips/cavium/octeon_irq.h   Sat Mar 24 05:30:13 2012
(r233416)
+++ head/sys/mips/cavium/octeon_irq.h   Sat Mar 24 06:28:15 2012
(r233417)
@@ -176,4 +176,6 @@ typedef enum
 /* Interrupts 129 - 135 are reserved */
 } octeon_irq_t;
 
+#defineOCTEON_PMC_IRQ  OCTEON_IRQ_4
+
 #endif

Modified: head/sys/mips/cavium/octeon_machdep.c
==
--- head/sys/mips/cavium/octeon_machdep.c   Sat Mar 24 05:30:13 2012
(r233416)
+++ head/sys/mips/cavium/octeon_machdep.c   Sat Mar 24 06:28:15 2012
(r233417)
@@ -260,6 +260,8 @@ octeon_debug_symbol(void)
 void
 octeon_ciu_reset(void)
 {
+   uint64_t cvmctl;
+
/* Disable all CIU interrupts by default */
cvmx_write_csr(CVMX_CIU_INTX_EN0(cvmx_get_core_num()*2), 0);
cvmx_write_csr(CVMX_CIU_INTX_EN0(cvmx_get_core_num()*2+1), 0);
@@ -272,6 +274,14 @@ octeon_ciu_reset(void)
   (1ull << (OCTEON_IRQ_MBOX0 - 8)) |
   (1ull << (OCTEON_IRQ_MBOX1 - 8)));
 #endif
+
+   /* 
+* Move the Performance Counter interrupt to OCTEON_PMC_IRQ
+*/
+   cvmctl = mips_rd_cvmctl();
+   cvmctl &= ~(7 << 7);
+   cvmctl |= (OCTEON_PMC_IRQ + 2) << 7;
+   mips_wr_cvmctl(cvmctl);
 }
 
 static void

Modified: head/sys/mips/cavium/octeon_pmc.c
==
--- head/sys/mips/cavium/octeon_pmc.c   Sat Mar 24 05:30:13 2012
(r233416)
+++ head/sys/mips/cavium/octeon_pmc.c   Sat Mar 24 06:28:15 2012
(r233417)
@@ -57,8 +57,6 @@ static intocteon_pmc_probe(device_t);
 static int octeon_pmc_attach(device_t);
 static int octeon_pmc_intr(void *);
 
-#defineOCTEON_PMC_IRQ  4
-
 static void
 octeon_pmc_identify(driver_t *drv, device_t parent)
 {
@@ -82,7 +80,6 @@ octeon_pmc_attach(device_t dev)
struct octeon_pmc_softc *sc;
int error;
int rid;
-   uint64_t cvmctl;
 
sc = device_get_softc(dev);
 
@@ -103,14 +100,6 @@ octeon_pmc_attach(device_t dev)
return (error);
}
 
-   /* 
-* Move the Performance Counter interrupt to OCTEON_PMC_IRQ
-*/
-   cvmctl = mips_rd_cvmctl();
-   cvmctl &= ~(7 << 7);
-   cvmctl |= (OCTEON_PMC_IRQ + 2) << 7;
-   mips_wr_cvmctl(cvmctl);
-
return (0);
 }
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r233418 - head/sbin/route

2012-03-23 Thread Joel Dahl
Author: joel (doc committer)
Date: Sat Mar 24 06:40:41 2012
New Revision: 233418
URL: http://svn.freebsd.org/changeset/base/233418

Log:
  Document the show alias and add an EXAMPLES section.

Modified:
  head/sbin/route/route.8

Modified: head/sbin/route/route.8
==
--- head/sbin/route/route.8 Sat Mar 24 06:28:15 2012(r233417)
+++ head/sbin/route/route.8 Sat Mar 24 06:40:41 2012(r233418)
@@ -28,7 +28,7 @@
 .\" @(#)route.88.3 (Berkeley) 3/19/94
 .\" $FreeBSD$
 .\"
-.Dd October 2, 2005
+.Dd March 24, 2012
 .Dt ROUTE 8
 .Os
 .Sh NAME
@@ -107,6 +107,10 @@ Lookup and display the route for a desti
 .It Cm monitor
 Continuously report any changes to the routing information base,
 routing lookup misses, or suspected network partitionings.
+.It Cm show
+Another name for the
+.Cm get
+command.
 .El
 .Pp
 The monitor command has the syntax:
@@ -344,6 +348,37 @@ As such, only the super-user may modify
 the routing tables.
 .Sh EXIT STATUS
 .Ex -std
+.Sh EXAMPLES
+Add a default route to the network routing table.
+This will send all packets for destinations not available in the routing table
+to the default gateway at 192.168.1.1:
+.Pp
+.Dl route add -net 0.0.0.0/0 192.168.1.1
+.Pp
+A shorter version of adding a default route can also be written as:
+.Pp
+.Dl route add default 192.168.1.1
+.Pp
+Add a static route to the 172.16.10.0/24 network via the 172.16.1.1 gateway:
+.Pp
+.Dl route add -net 172.16.10.0/24 172.16.1.1
+.Pp
+Change the gateway of an already established static route in the routing table:
+.Pp
+.Dl route change -net 172.16.10.0/24 172.16.1.2
+.Pp
+Display the route for a destination network:
+.Pp
+.Dl route show 172.16.10.0
+.Pp
+Delete a static route from the routing table:
+.Pp
+.Dl route delete -net 172.16.10.0/24 172.16.1.2
+.Pp
+Remove all routes from the routing table:
+.Pp
+.Dl route flush
+.Pp
 .Sh DIAGNOSTICS
 .Bl -diag
 .It "add [host \&| network ] %s: gateway %s flags %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"