Re: svn commit: r233290 - head/sys/amd64/amd64

2012-03-22 Thread Sergey Kandaurov
On 22 March 2012 08:40, Alan Cox a...@freebsd.org wrote:
 Author: alc
 Date: Thu Mar 22 04:40:22 2012
 New Revision: 233290
 URL: http://svn.freebsd.org/changeset/base/233290

 Log:
  Change pv_entry_count to a long.  During the lifetime of FreeBSD 10.x,
  physical memory sizes at the high-end will likely reach a point that
  the number of pv entries could overflow an int.

  Submitted by: kib

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


While there, maybe also do something with these semi-debug-ish
vm.pmap.pc_chunk_(allocs|frees) like change them to [u_]long too, move
under debug or just drop them? While they can be useful for someone,
pc_chunk_(allocs|frees) have also an int and quite quickly overflow.
Though e.g. vm.pmap.pv_entry_(allocs|frees) have a long.

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


svn commit: r233293 - stable/9

2012-03-22 Thread Sergey Kandaurov
Author: pluknet
Date: Thu Mar 22 08:38:13 2012
New Revision: 233293
URL: http://svn.freebsd.org/changeset/base/233293

Log:
  MFC r233010:
   Remove TARGET_ARCH conditionals for COMPAT_FREEBSD32.

Modified:
  stable/9/ObsoleteFiles.inc   (contents, props changed)

Modified: stable/9/ObsoleteFiles.inc
==
--- stable/9/ObsoleteFiles.inc  Thu Mar 22 07:34:15 2012(r233292)
+++ stable/9/ObsoleteFiles.inc  Thu Mar 22 08:38:13 2012(r233293)
@@ -54,7 +54,6 @@ OLD_LIBS+=usr/lib/libdwarf.so.2
 OLD_LIBS+=usr/lib/libopie.so.6
 OLD_LIBS+=usr/lib/librtld_db.so.1
 OLD_LIBS+=usr/lib/libtacplus.so.4
-.if ${TARGET_ARCH} == amd64
 OLD_LIBS+=usr/lib32/libcam.so.5
 OLD_LIBS+=usr/lib32/libpcap.so.7
 OLD_LIBS+=usr/lib32/libufs.so.5
@@ -63,7 +62,6 @@ OLD_LIBS+=usr/lib32/libdwarf.so.2
 OLD_LIBS+=usr/lib32/libopie.so.6
 OLD_LIBS+=usr/lib32/librtld_db.so.1
 OLD_LIBS+=usr/lib32/libtacplus.so.4
-.endif
 # 20110718: no longer useful in the age of rc.d
 OLD_FILES+=usr/sbin/named.reconfig
 OLD_FILES+=usr/sbin/named.reload
@@ -92,17 +90,13 @@ OLD_FILES+=usr/lib/libpkg.a
 OLD_FILES+=usr/lib/libpkg.so
 OLD_LIBS+=usr/lib/libpkg.so.0
 OLD_FILES+=usr/lib/libpkg_p.a
-.if ${TARGET_ARCH} == amd64
 OLD_FILES+=usr/lib32/libpkg.a
 OLD_FILES+=usr/lib32/libpkg.so
 OLD_LIBS+=usr/lib32/libpkg.so.0
 OLD_FILES+=usr/lib32/libpkg_p.a
-.endif
 # 20110517: libsbuf version bump
 OLD_LIBS+=lib/libsbuf.so.5
-.if ${TARGET_ARCH} == amd64
 OLD_LIBS+=usr/lib32/libsbuf.so.5
-.endif
 # 20110502: new clang import which bumps version from 2.9 to 3.0
 OLD_FILES+=usr/include/clang/2.9/emmintrin.h
 OLD_FILES+=usr/include/clang/2.9/mm_malloc.h
@@ -131,12 +125,10 @@ OLD_FILES+=usr/lib/libobjc_p.a
 OLD_FILES+=usr/libexec/cc1obj
 OLD_LIBS+=usr/lib/libobjc.so.4
 OLD_DIRS+=usr/include/objc
-.if ${TARGET_ARCH} == amd64
 OLD_FILES+=usr/lib32/libobjc.a
 OLD_FILES+=usr/lib32/libobjc.so
 OLD_FILES+=usr/lib32/libobjc_p.a
 OLD_LIBS+=usr/lib32/libobjc.so.4
-.endif
 # 20110331: firmware.img created at build time
 OLD_FILES+=usr/share/examples/kld/firmware/fwimage/firmware.img
 # 20110224: sticky.8 - sticky.7
@@ -258,9 +250,7 @@ OLD_FILES+=usr/include/machine/intr.h
 .endif
 # 20100514: library version bump for versioned symbols for liblzma
 OLD_LIBS+=usr/lib/liblzma.so.0
-.if ${TARGET_ARCH} == amd64
 OLD_LIBS+=usr/lib32/liblzma.so.0
-.endif
 # 20100511: move GCC-specific headers to /usr/include/gcc
 .if ${TARGET_ARCH} == amd64 || ${TARGET_ARCH} == i386
 OLD_FILES+=usr/include/emmintrin.h
@@ -301,9 +291,7 @@ OLD_FILES+=usr/share/info/cpio.info.gz
 OLD_FILES+=usr/share/man/man1/gcpio.1.gz
 # 20100322: libz update
 OLD_LIBS+=lib/libz.so.5
-.if ${TARGET_ARCH} == amd64
 OLD_LIBS+=usr/lib32/libz.so.5
-.endif
 # 20100314: removal of regexp.h
 OLD_FILES+=usr/include/regexp.h
 OLD_FILES+=usr/share/man/man3/regexp.3.gz
@@ -352,9 +340,7 @@ OLD_FILES+=usr/share/man/man5/lastlog.5.
 OLD_FILES+=usr/share/man/man5/utmp.5.gz
 OLD_FILES+=usr/share/man/man5/wtmp.5.gz
 OLD_LIBS+=lib/libutil.so.8
-.if ${TARGET_ARCH} == amd64
 OLB_LIBS+=usr/lib32/libutil.so.8
-.endif
 # 20100105: new userland semaphore implementation
 OLD_FILES+=usr/include/sys/semaphore.h
 # 20100103: ntptrace(8) removed
@@ -562,7 +548,6 @@ OLD_LIBS+=usr/lib/snmp_hostres.so.5
 OLD_LIBS+=usr/lib/snmp_mibII.so.5
 OLD_LIBS+=usr/lib/snmp_netgraph.so.5
 OLD_LIBS+=usr/lib/snmp_pf.so.5
-.if ${TARGET_ARCH} == amd64
 OLD_LIBS+=usr/lib32/libalias.so.6
 OLD_LIBS+=usr/lib32/libarchive.so.4
 OLD_LIBS+=usr/lib32/libauditd.so.4
@@ -663,7 +648,6 @@ OLD_LIBS+=usr/lib32/pam_self.so.4
 OLD_LIBS+=usr/lib32/pam_ssh.so.4
 OLD_LIBS+=usr/lib32/pam_tacplus.so.4
 OLD_LIBS+=usr/lib32/pam_unix.so.4
-.endif
 # 20090718: the gdm pam.d file is no longer required.
 OLD_FILES+=etc/pam.d/gdm
 # 20090713: vimage container structs removed.
@@ -848,9 +832,7 @@ OLD_FILES+=usr/share/man/man8/sliplogin.
 OLD_FILES+=usr/share/man/man8/slstat.8.gz
 # 20090321: libpcap upgraded to 1.0.0
 OLD_LIBS+=lib/libpcap.so.5
-.if ${TARGET_ARCH} == amd64
 OLD_LIBS+=usr/lib32/libpcap.so.5
-.endif
 # 20090319: uscanner(4) has been removed
 OLD_FILES+=usr/share/man/man4/uscanner.4.gz
 # 20090313: k8temp(4) renamed to amdtemp(4)
@@ -862,17 +844,13 @@ OLD_FILES+=usr/lib/libusb20.so
 OLD_FILES+=usr/lib/libusb20_p.a
 OLD_FILES+=usr/include/libusb20_compat01.h
 OLD_FILES+=usr/include/libusb20_compat10.h
-.if ${TARGET_ARCH} == amd64
 OLD_LIBS+=usr/lib32/libusb20.so.1
 OLD_FILES+=usr/lib32/libusb20.a
 OLD_FILES+=usr/lib32/libusb20.so
 OLD_FILES+=usr/lib32/libusb20_p.a
-.endif
 # 20090226: libmp(3) functions renamed
 OLD_LIBS+=usr/lib/libmp.so.6
-.if ${TARGET_ARCH} == amd64
 OLD_LIBS+=usr/lib32/libmp.so.6
-.endif
 # 20090223: changeover of USB stacks
 OLD_FILES+=usr/include/dev/usb2/include/ufm2_ioctl.h
 OLD_FILES+=usr/include/dev/usb2/include/urio2_ioctl.h
@@ -1175,9 +1153,7 @@ OLD_LIBS+=usr/lib/libkadm5srv.so.9
 OLD_LIBS+=usr/lib/libkafs5.so.9
 OLD_LIBS+=usr/lib/libkrb5.so.9
 OLD_LIBS+=usr/lib/libroken.so.9
-.if 

svn commit: r233295 - head/sys/kern

2012-03-22 Thread Andrey V. Elsukov
Author: ae
Date: Thu Mar 22 09:29:07 2012
New Revision: 233295
URL: http://svn.freebsd.org/changeset/base/233295

Log:
  Correct debug message.

Modified:
  head/sys/kern/kern_linker.c

Modified: head/sys/kern/kern_linker.c
==
--- head/sys/kern/kern_linker.c Thu Mar 22 08:48:42 2012(r233294)
+++ head/sys/kern/kern_linker.c Thu Mar 22 09:29:07 2012(r233295)
@@ -312,7 +312,7 @@ linker_file_unregister_sysctls(linker_fi
 {
struct sysctl_oid **start, **stop, **oidp;
 
-   KLD_DPF(FILE, (linker_file_unregister_sysctls: registering SYSCTLs
+   KLD_DPF(FILE, (linker_file_unregister_sysctls: unregistering SYSCTLs
 for %s\n, lf-filename));
 
if (linker_file_lookup_set(lf, sysctl_set, start, stop, NULL) != 0)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r233249 - head/sys/amd64/acpica

2012-03-22 Thread Andriy Gapon
on 21/03/2012 21:02 Jung-uk Kim said the following:
 On Wednesday 21 March 2012 01:57 pm, Andriy Gapon wrote:
 on 21/03/2012 19:41 Jung-uk Kim said the following:
 I am well aware of the problem.  In fact, that's why I had to
 merge ACPICA 20120320 rather quickly, which added a new flag to
 not execute _GTS method.  Both _GTS and _BFS are turned off by
 default.  You can control them with a new tunable
 debug.acpi.sleep_flags if you want.

 But the bug still has to be fixed, right?
 Even if it takes a non-default sysctl value to give the bug a
 chance.
 
 Ideally, yes.  However, I am not so sure if we can call it a bug 
 because AcpiEnterSleepState() must be called with interrupt disabled 
 and there is no way to change that API without breaking other OSes.  
 We can only work around it locally or persuade upstream to find a 
 better way to do this in ACPICA itself.  Either way, it will be 
 pretty hackish. :-(

I see.  Thank you.
Maybe the code could be somehow tricked into using M_NOWAIT in this context...

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


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

2012-03-22 Thread Sergey Kandaurov
Author: pluknet
Date: Thu Mar 22 09:42:27 2012
New Revision: 233296
URL: http://svn.freebsd.org/changeset/base/233296

Log:
  Prevent fs_file NULL pointer dereference in fixfsfile() uncovered after r1.5
  when passing damaged user-supplied fstab file data.
  
  MFC after:1 week

Modified:
  head/lib/libc/gen/fstab.c

Modified: head/lib/libc/gen/fstab.c
==
--- head/lib/libc/gen/fstab.c   Thu Mar 22 09:29:07 2012(r233295)
+++ head/lib/libc/gen/fstab.c   Thu Mar 22 09:42:27 2012(r233296)
@@ -91,7 +91,7 @@ fixfsfile()
struct stat sb;
struct statfs sf;
 
-   if (strcmp(_fs_fstab.fs_file, /) != 0)
+   if (_fs_fstab.fs_file != NULL strcmp(_fs_fstab.fs_file, /) != 0)
return;
if (statfs(/, sf) != 0)
return;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r233297 - stable/9/contrib/libstdc++/include/bits

2012-03-22 Thread Dimitry Andric
Author: dim
Date: Thu Mar 22 09:47:10 2012
New Revision: 233297
URL: http://svn.freebsd.org/changeset/base/233297

Log:
  MFC r233193:
  
  Add explicit braces to avoid dangling else in stl_tree.h.  This silences
  the following warning produced by clang trunk:
  
In file included from /usr/src/sbin/devd/devd.cc:91:
In file included from /usr/obj/usr/src/tmp/usr/include/c++/4.2/map:64:
/usr/obj/usr/src/tmp/usr/include/c++/4.2/bits/stl_tree.h:987:2: error: add 
explicit braces to avoid dangling else [-Werror,-Wdangling-else]
  else
  ^

Modified:
  stable/9/contrib/libstdc++/include/bits/stl_tree.h
Directory Properties:
  stable/9/contrib/libstdc++/   (props changed)

Modified: stable/9/contrib/libstdc++/include/bits/stl_tree.h
==
--- stable/9/contrib/libstdc++/include/bits/stl_tree.h  Thu Mar 22 09:42:27 
2012(r233296)
+++ stable/9/contrib/libstdc++/include/bits/stl_tree.h  Thu Mar 22 09:47:10 
2012(r233297)
@@ -982,10 +982,12 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
}
   iterator __j = iterator(__y);
   if (__comp)
-   if (__j == begin())
- return pairiterator,bool(_M_insert(__x, __y, __v), true);
-   else
- --__j;
+   {
+ if (__j == begin())
+   return pairiterator,bool(_M_insert(__x, __y, __v), true);
+ else
+   --__j;
+   }
   if (_M_impl._M_key_compare(_S_key(__j._M_node), _KeyOfValue()(__v)))
return pairiterator, bool(_M_insert(__x, __y, __v), true);
   return pairiterator, bool(__j, false);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r233298 - head/usr.bin/vmstat

2012-03-22 Thread Sergey Kandaurov
Author: pluknet
Date: Thu Mar 22 09:47:14 2012
New Revision: 233298
URL: http://svn.freebsd.org/changeset/base/233298

Log:
  Garbage collect defunct nlist(3) symbols.
  
  MFC after:1 week

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

Modified: head/usr.bin/vmstat/vmstat.c
==
--- head/usr.bin/vmstat/vmstat.cThu Mar 22 09:47:10 2012
(r233297)
+++ head/usr.bin/vmstat/vmstat.cThu Mar 22 09:47:14 2012
(r233298)
@@ -81,26 +81,20 @@ static char da[] = da;
 static struct nlist namelist[] = {
 #define X_SUM  0
{ _cnt },
-#defineX_BOOTTIME  1
-   { _boottime },
-#define X_HZ   2
+#define X_HZ   1
{ _hz },
-#define X_STATHZ   3
+#define X_STATHZ   2
{ _stathz },
-#define X_NCHSTATS 4
+#define X_NCHSTATS 3
{ _nchstats },
-#defineX_INTRNAMES 5
+#defineX_INTRNAMES 4
{ _intrnames },
-#defineX_SINTRNAMES6
+#defineX_SINTRNAMES5
{ _sintrnames },
-#defineX_INTRCNT   7
+#defineX_INTRCNT   6
{ _intrcnt },
-#defineX_SINTRCNT  8
+#defineX_SINTRCNT  7
{ _sintrcnt },
-#defineX_KMEMSTATS 9
-   { _kmemstatistics },
-#defineX_KMEMZONES 10
-   { _kmemzones },
 #ifdef notyet
 #defineX_DEFICIT   XXX
{ _deficit },
@@ -112,7 +106,7 @@ static struct nlist namelist[] = {
{ _xstats },
 #define X_END  XXX
 #else
-#define X_END  11
+#define X_END  8
 #endif
{  },
 };
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r233299 - stable/9/usr.sbin/dconschat

2012-03-22 Thread Dimitry Andric
Author: dim
Date: Thu Mar 22 09:50:16 2012
New Revision: 233299
URL: http://svn.freebsd.org/changeset/base/233299

Log:
  MFC r233195:
  
  Fix the following warning from clang trunk:
  
  usr.sbin/dconschat/dconschat.c:163:65: error: format specifies type 'size_t' 
(aka 'unsigned int') but the argument has type 'off_t' (aka 'long long') 
[-Werror,-Wformat]
snprintf(buf, PAGE_SIZE, \r\n[dconschat reset 
target(addr=0x%zx)...]\r\n, dc-reset);
 ~~^
~
 %llx
  
  Silence this by casting dc-reset to intmax_t, and using the appropriate
  length modifier.  While here, wrap the line to a 80 character margin.

Modified:
  stable/9/usr.sbin/dconschat/dconschat.c

Modified: stable/9/usr.sbin/dconschat/dconschat.c
==
--- stable/9/usr.sbin/dconschat/dconschat.c Thu Mar 22 09:47:14 2012
(r233298)
+++ stable/9/usr.sbin/dconschat/dconschat.c Thu Mar 22 09:50:16 2012
(r233299)
@@ -42,6 +42,7 @@
 #include unistd.h
 #include fcntl.h
 #include signal.h
+#include stdint.h
 #include stdio.h
 #include stdlib.h
 #include termios.h
@@ -160,7 +161,9 @@ dconschat_reset_target(struct dcons_stat
if (dc-reset == 0)
return;
 
-   snprintf(buf, PAGE_SIZE, \r\n[dconschat reset 
target(addr=0x%zx)...]\r\n, dc-reset);
+   snprintf(buf, PAGE_SIZE,
+   \r\n[dconschat reset target(addr=0x%jx)...]\r\n,
+   (intmax_t)dc-reset);
write(p-outfd, buf, strlen(buf));
bzero(buf[0], PAGE_SIZE);
dwrite(dc, (void *)buf, PAGE_SIZE, dc-reset);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


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

2012-03-22 Thread Sergey Kandaurov
Author: pluknet
Date: Thu Mar 22 09:51:31 2012
New Revision: 233300
URL: http://svn.freebsd.org/changeset/base/233300

Log:
  Fix style. Somehow I managed to lost a space when copypaste.
  
  Pointed out by:   stefanf

Modified:
  head/lib/libc/gen/fstab.c

Modified: head/lib/libc/gen/fstab.c
==
--- head/lib/libc/gen/fstab.c   Thu Mar 22 09:50:16 2012(r233299)
+++ head/lib/libc/gen/fstab.c   Thu Mar 22 09:51:31 2012(r233300)
@@ -91,7 +91,7 @@ fixfsfile()
struct stat sb;
struct statfs sf;
 
-   if (_fs_fstab.fs_file != NULL strcmp(_fs_fstab.fs_file, /) != 0)
+   if (_fs_fstab.fs_file != NULL  strcmp(_fs_fstab.fs_file, /) != 0)
return;
if (statfs(/, sf) != 0)
return;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r233302 - head/lib/libpam/modules/pam_ksu

2012-03-22 Thread Stanislav Sedov
Author: stas
Date: Thu Mar 22 11:18:14 2012
New Revision: 233302
URL: http://svn.freebsd.org/changeset/base/233302

Log:
  - Avoid use of deprecated KRB5 functions.

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

Modified: head/lib/libpam/modules/pam_ksu/Makefile
==
--- head/lib/libpam/modules/pam_ksu/MakefileThu Mar 22 10:26:53 2012
(r233301)
+++ head/lib/libpam/modules/pam_ksu/MakefileThu Mar 22 11:18:14 2012
(r233302)
@@ -31,6 +31,4 @@ MAN=  pam_ksu.8
 DPADD= ${LIBKRB5} ${LIBHX509} ${LIBASN1} ${LIBROKEN} ${LIBCOM_ERR} ${LIBCRYPT} 
${LIBCRYPTO}
 LDADD= -lkrb5 -lhx509 -lasn1 -lroken -lcom_err -lcrypt -lcrypto
 
-NO_WERROR= yes
-
 .include bsd.lib.mk

Modified: head/lib/libpam/modules/pam_ksu/pam_ksu.c
==
--- head/lib/libpam/modules/pam_ksu/pam_ksu.c   Thu Mar 22 10:26:53 2012
(r233301)
+++ head/lib/libpam/modules/pam_ksu/pam_ksu.c   Thu Mar 22 11:18:14 2012
(r233302)
@@ -70,8 +70,9 @@ pam_sm_authenticate(pam_handle_t *pamh, 
PAM_LOG(Got ruser: %s, (const char *)ruser);
rv = krb5_init_context(context);
if (rv != 0) {
-   PAM_LOG(krb5_init_context failed: %s,
-   krb5_get_err_text(context, rv));
+   const char *msg = krb5_get_error_message(context, rv);
+   PAM_LOG(krb5_init_context failed: %s, msg);
+   krb5_free_error_message(context, msg);
return (PAM_SERVICE_ERR);
}
rv = get_su_principal(context, user, ruser, su_principal_name, 
su_principal);
@@ -112,7 +113,7 @@ auth_krb5(pam_handle_t *pamh, krb5_conte
 krb5_principal su_principal)
 {
krb5_creds   creds;
-   krb5_get_init_creds_opt gic_opt;
+   krb5_get_init_creds_opt *gic_opt;
krb5_verify_init_creds_opt vic_opt;
const char  *pass;
char*prompt;
@@ -120,7 +121,6 @@ auth_krb5(pam_handle_t *pamh, krb5_conte
int  pamret;
 
prompt = NULL;
-   krb5_get_init_creds_opt_init(gic_opt);
krb5_verify_init_creds_opt_init(vic_opt);
if (su_principal_name != NULL)
(void)asprintf(prompt, Password for %s:, su_principal_name);
@@ -133,11 +133,20 @@ auth_krb5(pam_handle_t *pamh, krb5_conte
free(prompt);
if (pamret != PAM_SUCCESS)
return (pamret);
+   rv = krb5_get_init_creds_opt_alloc(context, gic_opt);
+   if (rv != 0) {
+   const char *msg = krb5_get_error_message(context, rv);
+   PAM_LOG(krb5_get_init_creds_opt_alloc: %s, msg);
+   krb5_free_error_message(context, msg);
+   return (PAM_AUTH_ERR);
+   }
rv = krb5_get_init_creds_password(context, creds, su_principal,
-   pass, NULL, NULL, 0, NULL, gic_opt);
+   pass, NULL, NULL, 0, NULL, gic_opt);
+   krb5_get_init_creds_opt_free(context, gic_opt);
if (rv != 0) {
-   PAM_LOG(krb5_get_init_creds_password: %s,
-   krb5_get_err_text(context, rv));
+   const char *msg = krb5_get_error_message(context, rv);
+   PAM_LOG(krb5_get_init_creds_password: %s, msg);
+   krb5_free_error_message(context, msg);
return (PAM_AUTH_ERR);
}
krb5_verify_init_creds_opt_set_ap_req_nofail(vic_opt, 1);
@@ -145,8 +154,9 @@ auth_krb5(pam_handle_t *pamh, krb5_conte
vic_opt);
krb5_free_cred_contents(context, creds);
if (rv != 0) {
-   PAM_LOG(krb5_verify_init_creds: %s,
-  krb5_get_err_text(context, rv));
+   const char *msg = krb5_get_error_message(context, rv);
+   PAM_LOG(krb5_verify_init_creds: %s, msg);
+   krb5_free_error_message(context, msg);
return (PAM_AUTH_ERR);
}
return (PAM_SUCCESS);
@@ -220,8 +230,9 @@ get_su_principal(krb5_context context, c
rv = krb5_unparse_name(context, default_principal, principal_name);
krb5_free_principal(context, default_principal);
if (rv != 0) {
-   PAM_LOG(krb5_unparse_name: %s,
-   krb5_get_err_text(context, rv));
+   const char *msg = krb5_get_error_message(context, rv);
+   PAM_LOG(krb5_unparse_name: %s, msg);
+   krb5_free_error_message(context, msg);
return (rv);
}
PAM_LOG(Default principal name: %s, principal_name);
@@ -243,8 +254,9 @@ get_su_principal(krb5_context context, c
return (errno);
rv = krb5_parse_name(context, *su_principal_name, default_principal);
if (rv != 0) {
-   PAM_LOG(krb5_parse_name `%s': %s, *su_principal_name,
-   krb5_get_err_text(context, rv));
+   

svn commit: r233303 - stable/8/share/man/man9

2012-03-22 Thread Sergey Kandaurov
Author: pluknet
Date: Thu Mar 22 11:43:54 2012
New Revision: 233303
URL: http://svn.freebsd.org/changeset/base/233303

Log:
  MFC r210525:
  
   Missing IFCAP_* macro descriptions in ifnet(9).
  
  PR:   docs/148952
  Submitted by: Lars Hartmann l...@chaotika.org

Modified:
  stable/8/share/man/man9/ifnet.9
Directory Properties:
  stable/8/share/man/man9/   (props changed)

Modified: stable/8/share/man/man9/ifnet.9
==
--- stable/8/share/man/man9/ifnet.9 Thu Mar 22 11:18:14 2012
(r233302)
+++ stable/8/share/man/man9/ifnet.9 Thu Mar 22 11:43:54 2012
(r233303)
@@ -600,6 +600,31 @@ longer than permitted by the Ethernet sp
 .It Dv IFCAP_JUMBO_MTU
 This Ethernet interface can transmit and receive frames up to
 9000 bytes long.
+.It Dv IFCAP_TSO4
+This Ethernet interface supports TCP Segmentation offloading.
+.It Dv IFCAP_TSO6
+This Ethernet interface supports TCP6 Segmentation offloading.
+.It Dv IFCAP_TSO
+A shorthand for 
+.Pq Dv IFCAP_TSO4 | IFCAP_TSO6 .
+.It Dv IFCAP_TOE4
+This Ethernet interface supports TCP offloading.
+.It Dv IFCAP_TOE6
+This Ethernet interface supports TCP6 offloading.
+.It Dv ICAP_TOE
+A Shorthand for 
+.Pq Dv IFCAP_TOE4 | IFCAP_TOE6 .
+.It Dv IFCAP_WOL_UCAST
+This Ethernet interface supports waking up on any Unicast packet.
+.It Dv IFCAP_WOL_MCAST
+This Ethernet interface supports waking up on any Multicast packet.
+.It Dv IFCAP_WOL_MAGIC
+This Ethernet interface supports waking up on any Magic packet such
+as those sent by
+.Xr wake 8 .
+.It Dv IFCAP_WOL
+A shorthand for
+.Pq Dv IFCAP_WOL_UCAST | IFCAP_WOL_MCAST | IFCAP_WOL_MAGIC .
 .El
 .Pp
 The ability of advanced network interfaces to offload certain
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r233304 - stable/7/share/man/man9

2012-03-22 Thread Sergey Kandaurov
Author: pluknet
Date: Thu Mar 22 11:47:06 2012
New Revision: 233304
URL: http://svn.freebsd.org/changeset/base/233304

Log:
  MFC r210525:
  
   Missing IFCAP_* macro descriptions in ifnet(9).
  
  PR:   docs/148952
  Submitted by: Lars Hartmann l...@chaotika.org

Modified:
  stable/7/share/man/man9/ifnet.9
Directory Properties:
  stable/7/share/man/man9/   (props changed)

Modified: stable/7/share/man/man9/ifnet.9
==
--- stable/7/share/man/man9/ifnet.9 Thu Mar 22 11:43:54 2012
(r233303)
+++ stable/7/share/man/man9/ifnet.9 Thu Mar 22 11:47:06 2012
(r233304)
@@ -572,6 +572,31 @@ longer than permitted by the Ethernet sp
 .It Dv IFCAP_JUMBO_MTU
 This Ethernet interface can transmit and receive frames up to
 9000 bytes long.
+.It Dv IFCAP_TSO4
+This Ethernet interface supports TCP Segmentation offloading.
+.It Dv IFCAP_TSO6
+This Ethernet interface supports TCP6 Segmentation offloading.
+.It Dv IFCAP_TSO
+A shorthand for 
+.Pq Dv IFCAP_TSO4 | IFCAP_TSO6 .
+.It Dv IFCAP_TOE4
+This Ethernet interface supports TCP offloading.
+.It Dv IFCAP_TOE6
+This Ethernet interface supports TCP6 offloading.
+.It Dv ICAP_TOE
+A Shorthand for 
+.Pq Dv IFCAP_TOE4 | IFCAP_TOE6 .
+.It Dv IFCAP_WOL_UCAST
+This Ethernet interface supports waking up on any Unicast packet.
+.It Dv IFCAP_WOL_MCAST
+This Ethernet interface supports waking up on any Multicast packet.
+.It Dv IFCAP_WOL_MAGIC
+This Ethernet interface supports waking up on any Magic packet such
+as those sent by
+.Xr wake 8 .
+.It Dv IFCAP_WOL
+A shorthand for
+.Pq Dv IFCAP_WOL_UCAST | IFCAP_WOL_MCAST | IFCAP_WOL_MAGIC .
 .El
 .Pp
 The ability of advanced network interfaces to offload certain
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r233305 - head/sys/x86/acpica

2012-03-22 Thread John Baldwin
Author: jhb
Date: Thu Mar 22 12:23:32 2012
New Revision: 233305
URL: http://svn.freebsd.org/changeset/base/233305

Log:
  Mark the 'lapics' and 'ioapics' arrays here static since they are
  private to this file.  The 'lapics' array was actually shadowing a
  completely different 'lapics' array that is private to local_apic.c.
  
  Reported by:  bde
  MFC after:2 weeks

Modified:
  head/sys/x86/acpica/madt.c

Modified: head/sys/x86/acpica/madt.c
==
--- head/sys/x86/acpica/madt.c  Thu Mar 22 11:47:06 2012(r233304)
+++ head/sys/x86/acpica/madt.c  Thu Mar 22 12:23:32 2012(r233305)
@@ -53,12 +53,12 @@ __FBSDID($FreeBSD$);
 struct ioapic_info {
void *io_apic;
UINT32 io_vector;
-} ioapics[MAX_APIC_ID + 1];
+} static ioapics[MAX_APIC_ID + 1];
 
 struct lapic_info {
u_int la_enabled:1;
u_int la_acpi_id:8;
-} lapics[MAX_APIC_ID + 1];
+} static lapics[MAX_APIC_ID + 1];
 
 static int madt_found_sci_override;
 static ACPI_TABLE_MADT *madt;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r233305 - head/sys/x86/acpica

2012-03-22 Thread Bruce Evans

On Thu, 22 Mar 2012, John Baldwin wrote:


Log:
 Mark the 'lapics' and 'ioapics' arrays here static since they are
 private to this file.  The 'lapics' array was actually shadowing a
 completely different 'lapics' array that is private to local_apic.c.

 Reported by:   bde
 MFC after: 2 weeks

Modified:
 head/sys/x86/acpica/madt.c

Modified: head/sys/x86/acpica/madt.c
==
--- head/sys/x86/acpica/madt.c  Thu Mar 22 11:47:06 2012(r233304)
+++ head/sys/x86/acpica/madt.c  Thu Mar 22 12:23:32 2012(r233305)
@@ -53,12 +53,12 @@ __FBSDID($FreeBSD$);
struct ioapic_info {
void *io_apic;
UINT32 io_vector;
-} ioapics[MAX_APIC_ID + 1];
+} static ioapics[MAX_APIC_ID + 1];

struct lapic_info {
u_int la_enabled:1;
u_int la_acpi_id:8;
-} lapics[MAX_APIC_ID + 1];
+} static lapics[MAX_APIC_ID + 1];

static int madt_found_sci_override;
static ACPI_TABLE_MADT *madt;


Thanks, but that's any even weirder style.  It's in between
int static foo; and int static unsigned foo; for weirdness.

Normal style gives:

%%%
struct lapic_info {
u_int   la_enabled:1;
u_int   la_acpi_id:8;
};

static struct lapic_info lapics[MAX_APIC_ID + 1];
%%%

etc.  This also fixes some indentation.

The struct tag for struct ioapic_info is not used outside of its
declaration, so a non-separate type declaration would be more reasonable
for it (since this gives the only way to omit the tag:

static struct {
void*io_apic;
u_int   io_vector;
} ioapics[MAX_APIC_ID + 1];

This also translates UINT32 from windosspeak.  There is no need for
uint32_t since this is x86, and other places use u_int.

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


Re: svn commit: r233249 - head/sys/amd64/acpica

2012-03-22 Thread John Baldwin
On Thursday, March 22, 2012 5:32:59 am Andriy Gapon wrote:
 on 21/03/2012 21:02 Jung-uk Kim said the following:
  On Wednesday 21 March 2012 01:57 pm, Andriy Gapon wrote:
  on 21/03/2012 19:41 Jung-uk Kim said the following:
  I am well aware of the problem.  In fact, that's why I had to
  merge ACPICA 20120320 rather quickly, which added a new flag to
  not execute _GTS method.  Both _GTS and _BFS are turned off by
  default.  You can control them with a new tunable
  debug.acpi.sleep_flags if you want.
 
  But the bug still has to be fixed, right?
  Even if it takes a non-default sysctl value to give the bug a
  chance.
  
  Ideally, yes.  However, I am not so sure if we can call it a bug 
  because AcpiEnterSleepState() must be called with interrupt disabled 
  and there is no way to change that API without breaking other OSes.  
  We can only work around it locally or persuade upstream to find a 
  better way to do this in ACPICA itself.  Either way, it will be 
  pretty hackish. :-(
 
 I see.  Thank you.
 Maybe the code could be somehow tricked into using M_NOWAIT in this 
context...

That still wouldn't be good enough.  We don't want to try to acquire any 
regular mutexes either (we can't safely block to let the lock owner run, or 
the lock owner might be a suspended thread on another CPU, etc.).  The only 
proper way to fix this would be to use pre-allocated storage in this 
particular case, but given that Windows doesn't invoke these methods on 
suspend/resume, it's doubtful that we will ever need to do so.

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


svn commit: r233306 - head/libexec/rtld-elf

2012-03-22 Thread Konstantin Belousov
Author: kib
Date: Thu Mar 22 14:11:10 2012
New Revision: 233306
URL: http://svn.freebsd.org/changeset/base/233306

Log:
  Remove the fragments which are not needed on FreeBSD.  The caltech
  malloc hardly would ever be updated.
  
  Reviewed by:  bde, kan
  MFC after:2 weeks

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

Modified: head/libexec/rtld-elf/malloc.c
==
--- head/libexec/rtld-elf/malloc.c  Thu Mar 22 12:23:32 2012
(r233305)
+++ head/libexec/rtld-elf/malloc.c  Thu Mar 22 14:11:10 2012
(r233306)
@@ -59,15 +59,6 @@ static char *rcsid = $FreeBSD$;
 #include sys/param.h
 #include sys/mman.h
 #include rtld_printf.h
-#ifndef BSD
-#define MAP_COPY   MAP_PRIVATE
-#define MAP_FILE   0
-#define MAP_ANON   0
-#endif
-
-#ifndef BSD/* Need do better than this */
-#define NEED_DEV_ZERO  1
-#endif
 
 static void morecore();
 static int findbucket();
@@ -492,12 +483,6 @@ intn;
int fd = -1;
int offset;
 
-#ifdef NEED_DEV_ZERO
-   fd = open(_PATH_DEVZERO, O_RDWR, 0);
-   if (fd == -1)
-   perror(_PATH_DEVZERO);
-#endif
-
if (pagepool_end - pagepool_start  pagesz) {
caddr_t addr = (caddr_t)
(((long)pagepool_start + pagesz - 1)  ~(pagesz - 1));
@@ -517,8 +502,5 @@ int n;
pagepool_end = pagepool_start + n * pagesz;
pagepool_start += offset;
 
-#ifdef NEED_DEV_ZERO
-   close(fd);
-#endif
return n;
 }
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r233249 - head/sys/amd64/acpica

2012-03-22 Thread Konstantin Belousov
On Thu, Mar 22, 2012 at 07:48:49AM -0400, John Baldwin wrote:
 On Thursday, March 22, 2012 5:32:59 am Andriy Gapon wrote:
  on 21/03/2012 21:02 Jung-uk Kim said the following:
   On Wednesday 21 March 2012 01:57 pm, Andriy Gapon wrote:
   on 21/03/2012 19:41 Jung-uk Kim said the following:
   I am well aware of the problem.  In fact, that's why I had to
   merge ACPICA 20120320 rather quickly, which added a new flag to
   not execute _GTS method.  Both _GTS and _BFS are turned off by
   default.  You can control them with a new tunable
   debug.acpi.sleep_flags if you want.
  
   But the bug still has to be fixed, right?
   Even if it takes a non-default sysctl value to give the bug a
   chance.
   
   Ideally, yes.  However, I am not so sure if we can call it a bug 
   because AcpiEnterSleepState() must be called with interrupt disabled 
   and there is no way to change that API without breaking other OSes.  
   We can only work around it locally or persuade upstream to find a 
   better way to do this in ACPICA itself.  Either way, it will be 
   pretty hackish. :-(
  
  I see.  Thank you.
  Maybe the code could be somehow tricked into using M_NOWAIT in this 
 context...
 
 That still wouldn't be good enough.  We don't want to try to acquire any 
 regular mutexes either (we can't safely block to let the lock owner run, or 
 the lock owner might be a suspended thread on another CPU, etc.).  The only 
 proper way to fix this would be to use pre-allocated storage in this 
 particular case, but given that Windows doesn't invoke these methods on 
 suspend/resume, it's doubtful that we will ever need to do so.
I already noted this to Jung-uk, I think that current suspend handling
is (somewhat) wrong. We shall not stop other CPUs for suspension when
they are executing some random kernel code. Rather, CPUs should be safely
stopped at the kernel-user boundary, or at sleep point, or at designated
suspend point like idle loop.

We already are engaged into somewhat doubtful actions like restoring of %cr2,
since we might, for instance, preemt page fault handler with suspend IPI.


pgpHCfrQRo5un.pgp
Description: PGP signature


svn commit: r233307 - in head/libexec/rtld-elf: . ia64 powerpc64

2012-03-22 Thread Konstantin Belousov
Author: kib
Date: Thu Mar 22 14:20:51 2012
New Revision: 233307
URL: http://svn.freebsd.org/changeset/base/233307

Log:
  Use xmalloc() instead of malloc() in the places where malloc() calls
  are assumed to not fail.
  
  Make the xcalloc() calling conventions follow the calloc(3) calling
  conventions and replace unchecked calls to calloc() with calls to
  xcalloc().
  
  Remove redundand declarations from xmalloc.c, which are already
  present in rtld.h.
  
  Reviewed by:  kan
  Discussed with:   bde
  MFC after:2 weeks

Modified:
  head/libexec/rtld-elf/ia64/reloc.c
  head/libexec/rtld-elf/powerpc64/reloc.c
  head/libexec/rtld-elf/rtld.c
  head/libexec/rtld-elf/rtld.h
  head/libexec/rtld-elf/xmalloc.c

Modified: head/libexec/rtld-elf/ia64/reloc.c
==
--- head/libexec/rtld-elf/ia64/reloc.c  Thu Mar 22 14:11:10 2012
(r233306)
+++ head/libexec/rtld-elf/ia64/reloc.c  Thu Mar 22 14:20:51 2012
(r233307)
@@ -87,7 +87,7 @@ alloc_fptr(Elf_Addr target, Elf_Addr gp)
struct fptr* fptr;
 
if (next_fptr == last_fptr) {
-   current_chunk = malloc(sizeof(struct fptr_chunk));
+   current_chunk = xmalloc(sizeof(struct fptr_chunk));
next_fptr = current_chunk-fptrs[0];
last_fptr = current_chunk-fptrs[FPTR_CHUNK_SIZE];
}
@@ -116,9 +116,7 @@ alloc_fptrs(Obj_Entry *obj, bool mapped)
if (fptrs == MAP_FAILED)
fptrs = NULL;
} else {
-   fptrs = malloc(fbytes);
-   if (fptrs != NULL)
-   memset(fptrs, 0, fbytes);
+   fptrs = xcalloc(1, fbytes);
}
 
/*

Modified: head/libexec/rtld-elf/powerpc64/reloc.c
==
--- head/libexec/rtld-elf/powerpc64/reloc.c Thu Mar 22 14:11:10 2012
(r233306)
+++ head/libexec/rtld-elf/powerpc64/reloc.c Thu Mar 22 14:20:51 2012
(r233307)
@@ -338,7 +338,7 @@ reloc_plt_object(Obj_Entry *obj, const E
reloff = rela - obj-pltrela;
 
if (obj-priv == NULL)
-   obj-priv = malloc(obj-pltrelasize);
+   obj-priv = xmalloc(obj-pltrelasize);
glink = obj-priv + reloff*sizeof(Elf_Addr)*2;
 
dbg( reloc_plt_object: where=%p,reloff=%lx,glink=%p, (void *)where, 
reloff, glink);

Modified: head/libexec/rtld-elf/rtld.c
==
--- head/libexec/rtld-elf/rtld.cThu Mar 22 14:11:10 2012
(r233306)
+++ head/libexec/rtld-elf/rtld.cThu Mar 22 14:20:51 2012
(r233307)
@@ -3733,7 +3733,7 @@ tls_get_addr_slow(Elf_Addr **dtvp, int i
 /* Check dtv generation in case new modules have arrived */
 if (dtv[0] != tls_dtv_generation) {
wlock_acquire(rtld_bind_lock, lockstate);
-   newdtv = calloc(1, (tls_max_index + 2) * sizeof(Elf_Addr));
+   newdtv = xcalloc(tls_max_index + 2, sizeof(Elf_Addr));
to_copy = dtv[1];
if (to_copy  tls_max_index)
to_copy = tls_max_index;
@@ -3788,7 +3788,7 @@ allocate_tls(Obj_Entry *objs, void *oldt
return (oldtcb);
 
 assert(tcbsize = TLS_TCB_SIZE);
-tcb = calloc(1, tls_static_space - TLS_TCB_SIZE + tcbsize);
+tcb = xcalloc(1, tls_static_space - TLS_TCB_SIZE + tcbsize);
 tls = (Elf_Addr **)(tcb + tcbsize - TLS_TCB_SIZE);
 
 if (oldtcb != NULL) {
@@ -3804,7 +3804,7 @@ allocate_tls(Obj_Entry *objs, void *oldt
}
}
 } else {
-   dtv = calloc(tls_max_index + 2, sizeof(Elf_Addr));
+   dtv = xcalloc(tls_max_index + 2, sizeof(Elf_Addr));
tls[0] = dtv;
dtv[0] = tls_dtv_generation;
dtv[1] = tls_max_index;
@@ -3868,8 +3868,8 @@ allocate_tls(Obj_Entry *objs, void *oldt
 size = round(tls_static_space, tcbalign);
 
 assert(tcbsize = 2*sizeof(Elf_Addr));
-tls = calloc(1, size + tcbsize);
-dtv = calloc(1, (tls_max_index + 2) * sizeof(Elf_Addr));
+tls = xcalloc(1, size + tcbsize);
+dtv = xcalloc(tls_max_index + 2, sizeof(Elf_Addr));
 
 segbase = (Elf_Addr)(tls + size);
 ((Elf_Addr*)segbase)[0] = segbase;
@@ -4209,7 +4209,7 @@ rtld_verify_object_versions(Obj_Entry *o
  * way.
  */
 obj-vernum = maxvernum + 1;
-obj-vertab = calloc(obj-vernum, sizeof(Ver_Entry));
+obj-vertab = xcalloc(obj-vernum, sizeof(Ver_Entry));
 
 vd = obj-verdef;
 while (vd != NULL) {

Modified: head/libexec/rtld-elf/rtld.h
==
--- head/libexec/rtld-elf/rtld.hThu Mar 22 14:11:10 2012
(r233306)
+++ head/libexec/rtld-elf/rtld.hThu Mar 22 14:20:51 2012
(r233307)
@@ -58,7 +58,7 @@
 #endif
 
 #define NEW(type)  ((type *) xmalloc(sizeof(type)))
-#define CNEW(type) ((type *) xcalloc(sizeof(type)))
+#define CNEW(type)  

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

2012-03-22 Thread Jayachandran C.
Author: jchandra
Date: Thu Mar 22 15:14:10 2012
New Revision: 233308
URL: http://svn.freebsd.org/changeset/base/233308

Log:
  Fix return type of mips pmap_kextract()
  
  The return type should be vm_paddr_t, not vm_offset_t.

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

Modified: head/sys/mips/mips/pmap.c
==
--- head/sys/mips/mips/pmap.c   Thu Mar 22 14:20:51 2012(r233307)
+++ head/sys/mips/mips/pmap.c   Thu Mar 22 15:14:10 2012(r233308)
@@ -3209,7 +3209,7 @@ pmap_emulate_modified(pmap_t pmap, vm_of
  * Extract the physical page address associated
  * virtual address.
  */
- /* PMAP_INLINE */ vm_offset_t
+vm_paddr_t
 pmap_kextract(vm_offset_t va)
 {
int mapped;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r233310 - in head/sys: amd64/conf i386/conf

2012-03-22 Thread Joel Dahl
Author: joel (doc committer)
Date: Thu Mar 22 16:19:04 2012
New Revision: 233310
URL: http://svn.freebsd.org/changeset/base/233310

Log:
  Add snd_cmi, snd_csa and snd_emu10kx to GENERIC on i386 and amd64.
  
  The GPL infected parts which were blocking the inclusion of snd_csa
  and snd_emu10kx in GENERIC have recently been removed from the tree.
  I'm also adding snd_cmi to GENERIC, which I originally intended to
  add when we enabled sound support by default.
  
  Discussed with:   jhb, pfg, Yuriy Tsibizov yuriy.tsibi...@gfk.ru
  Approved by:  jhb

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

Modified: head/sys/amd64/conf/GENERIC
==
--- head/sys/amd64/conf/GENERIC Thu Mar 22 15:21:09 2012(r233309)
+++ head/sys/amd64/conf/GENERIC Thu Mar 22 16:19:04 2012(r233310)
@@ -316,6 +316,9 @@ device  dcons_crom  # Configuration ROM f
 
 # Sound support
 device sound   # Generic sound driver (required)
+device snd_cmi # CMedia CMI8338/CMI8738
+device snd_csa # Crystal Semiconductor CS461x/428x
+device snd_emu10kx # Creative SoundBlaster Live! and Audigy
 device snd_es137x  # Ensoniq AudioPCI ES137x
 device snd_hda # Intel High Definition Audio
 device snd_ich # Intel, NVidia and other ICH AC'97 Audio

Modified: head/sys/i386/conf/GENERIC
==
--- head/sys/i386/conf/GENERIC  Thu Mar 22 15:21:09 2012(r233309)
+++ head/sys/i386/conf/GENERIC  Thu Mar 22 16:19:04 2012(r233310)
@@ -329,6 +329,9 @@ device  dcons_crom  # Configuration ROM f
 
 # Sound support
 device sound   # Generic sound driver (required)
+device snd_cmi # CMedia CMI8338/CMI8738
+device snd_csa # Crystal Semiconductor CS461x/428x
+device snd_emu10kx # Creative SoundBlaster Live! and Audigy
 device snd_es137x  # Ensoniq AudioPCI ES137x
 device snd_hda # Intel High Definition Audio
 device snd_ich # Intel, NVidia and other ICH AC'97 Audio
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r233311 - head/sys/netinet

2012-03-22 Thread Michael Tuexen
Author: tuexen
Date: Thu Mar 22 16:22:16 2012
New Revision: 233311
URL: http://svn.freebsd.org/changeset/base/233311

Log:
  Small cleanup of the code. No functional change (in FreeBSD kernel).
  
  MFC after: 1 week.

Modified:
  head/sys/netinet/sctputil.c

Modified: head/sys/netinet/sctputil.c
==
--- head/sys/netinet/sctputil.c Thu Mar 22 16:19:04 2012(r233310)
+++ head/sys/netinet/sctputil.c Thu Mar 22 16:22:16 2012(r233311)
@@ -5443,28 +5443,31 @@ found_one:
}
 #endif
if (fromlen  from) {
-   struct sockaddr *to;
-
+   cp_len = min((size_t)fromlen, 
(size_t)control-whoFrom-ro._l_addr.sa.sa_len);
+   switch (control-whoFrom-ro._l_addr.sa.sa_family) {
+#ifdef INET6
+   case AF_INET6:
+   ((struct sockaddr_in6 *)from)-sin6_port = 
control-port_from;
+   break;
+#endif
 #ifdef INET
-   cp_len = min((size_t)fromlen, 
(size_t)control-whoFrom-ro._l_addr.sin.sin_len);
-   memcpy(from, control-whoFrom-ro._l_addr, cp_len);
-   ((struct sockaddr_in *)from)-sin_port = control-port_from;
-#else
-   /* No AF_INET use AF_INET6 */
-   cp_len = min((size_t)fromlen, 
(size_t)control-whoFrom-ro._l_addr.sin6.sin6_len);
-   memcpy(from, control-whoFrom-ro._l_addr, cp_len);
-   ((struct sockaddr_in6 *)from)-sin6_port = control-port_from;
+   case AF_INET:
+   ((struct sockaddr_in *)from)-sin_port = 
control-port_from;
+   break;
 #endif
+   default:
+   break;
+   }
+   memcpy(from, control-whoFrom-ro._l_addr, cp_len);
 
-   to = from;
 #if defined(INET)  defined(INET6)
if ((sctp_is_feature_on(inp, SCTP_PCB_FLAGS_NEEDS_MAPPED_V4)) 
-   (to-sa_family == AF_INET) 
+   (from-sa_family == AF_INET) 
((size_t)fromlen = sizeof(struct sockaddr_in6))) {
struct sockaddr_in *sin;
struct sockaddr_in6 sin6;
 
-   sin = (struct sockaddr_in *)to;
+   sin = (struct sockaddr_in *)from;
bzero(sin6, sizeof(sin6));
sin6.sin6_family = AF_INET6;
sin6.sin6_len = sizeof(struct sockaddr_in6);
@@ -5473,15 +5476,15 @@ found_one:
sin6.sin6_addr.s6_addr32[3],
sizeof(sin6.sin6_addr.s6_addr32[3]));
sin6.sin6_port = sin-sin_port;
-   memcpy(from, (caddr_t)sin6, sizeof(sin6));
+   memcpy(from, sin6, sizeof(struct sockaddr_in6));
}
 #endif
 #if defined(INET6)
{
-   struct sockaddr_in6 lsa6, *to6;
+   struct sockaddr_in6 lsa6, *from6;
 
-   to6 = (struct sockaddr_in6 *)to;
-   sctp_recover_scope_mac(to6, (lsa6));
+   from6 = (struct sockaddr_in6 *)from;
+   sctp_recover_scope_mac(from6, (lsa6));
}
 #endif
}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r233312 - head/share/man/man4

2012-03-22 Thread Joel Dahl
Author: joel (doc committer)
Date: Thu Mar 22 16:24:50 2012
New Revision: 233312
URL: http://svn.freebsd.org/changeset/base/233312

Log:
  Update snd_cmi, snd_csa and snd_emu10kx status.

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

Modified: head/share/man/man4/pcm.4
==
--- head/share/man/man4/pcm.4   Thu Mar 22 16:22:16 2012(r233311)
+++ head/share/man/man4/pcm.4   Thu Mar 22 16:24:50 2012(r233312)
@@ -25,7 +25,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd January 22, 2012
+.Dd March 22, 2012
 .Dt SOUND 4
 .Os
 .Sh NAME
@@ -85,11 +85,11 @@ The following bridge device drivers are 
 .It
 .Xr snd_audiocs 4 (enabled by default on sparc64)
 .It
-.Xr snd_cmi 4
+.Xr snd_cmi 4 (enabled by default on amd64, i386) 
 .It
 .Xr snd_cs4281 4
 .It
-.Xr snd_csa 4
+.Xr snd_csa 4 (enabled by default on amd64, i386)
 .It
 .Xr snd_davbus 4 (enabled by default on powerpc)
 .It
@@ -97,7 +97,7 @@ The following bridge device drivers are 
 .It
 .Xr snd_emu10k1 4
 .It
-.Xr snd_emu10kx 4
+.Xr snd_emu10kx 4 (enabled by default on amd64, i386)
 .It
 .Xr snd_envy24 4
 .It
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r233290 - head/sys/amd64/amd64

2012-03-22 Thread Alan Cox

On 03/22/2012 03:12, Sergey Kandaurov wrote:

On 22 March 2012 08:40, Alan Coxa...@freebsd.org  wrote:

Author: alc
Date: Thu Mar 22 04:40:22 2012
New Revision: 233290
URL: http://svn.freebsd.org/changeset/base/233290

Log:
  Change pv_entry_count to a long.  During the lifetime of FreeBSD 10.x,
  physical memory sizes at the high-end will likely reach a point that
  the number of pv entries could overflow an int.

  Submitted by: kib

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


While there, maybe also do something with these semi-debug-ish
vm.pmap.pc_chunk_(allocs|frees) like change them to [u_]long too, move
under debug or just drop them? While they can be useful for someone,
pc_chunk_(allocs|frees) have also an int and quite quickly overflow.
Though e.g. vm.pmap.pv_entry_(allocs|frees) have a long.



Yes, in the next month or two I'm going to be making some changes to the 
way that pmap_collect() works.  I will be eliminating a couple of the 
counters as part of those changes.  I will deal with the rest of the 
counters at the same time.


Alan

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


svn commit: r233313 - in head: share/man/man4 sys/dev/acpica

2012-03-22 Thread Jung-uk Kim
Author: jkim
Date: Thu Mar 22 17:01:25 2012
New Revision: 233313
URL: http://svn.freebsd.org/changeset/base/233313

Log:
  Add ACPI_LV_REPAIR debug level, available since ACPICA 20091214 (r200553).
  
  MFC after:3 days

Modified:
  head/share/man/man4/acpi.4
  head/sys/dev/acpica/acpi.c

Modified: head/share/man/man4/acpi.4
==
--- head/share/man/man4/acpi.4  Thu Mar 22 16:24:50 2012(r233312)
+++ head/share/man/man4/acpi.4  Thu Mar 22 17:01:25 2012(r233313)
@@ -25,7 +25,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd March 20, 2012
+.Dd March 22, 2012
 .Dt ACPI 4
 .Os
 .Sh NAME
@@ -491,6 +491,8 @@ Initialization progress
 Stores to objects
 .It Li ACPI_LV_INFO
 General information and progress
+.It Li ACPI_LV_REPAIR
+Repair a common problem with predefined methods
 .It Li ACPI_LV_ALL_EXCEPTIONS
 All the previous levels
 .It Li ACPI_LV_PARSE

Modified: head/sys/dev/acpica/acpi.c
==
--- head/sys/dev/acpica/acpi.c  Thu Mar 22 16:24:50 2012(r233312)
+++ head/sys/dev/acpica/acpi.c  Thu Mar 22 17:01:25 2012(r233313)
@@ -3540,6 +3540,7 @@ static struct debugtag dbg_level[] = {
 {ACPI_LV_INIT,   ACPI_LV_INIT},
 {ACPI_LV_DEBUG_OBJECT,   ACPI_LV_DEBUG_OBJECT},
 {ACPI_LV_INFO,   ACPI_LV_INFO},
+{ACPI_LV_REPAIR, ACPI_LV_REPAIR},
 {ACPI_LV_ALL_EXCEPTIONS, ACPI_LV_ALL_EXCEPTIONS},
 
 /* Trace verbosity level 1 [Standard Trace Level] */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r233314 - stable/8/usr.sbin/usbdump

2012-03-22 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Mar 22 17:02:05 2012
New Revision: 233314
URL: http://svn.freebsd.org/changeset/base/233314

Log:
  MFC r233037 and r233039:
  Fix cross-platform issue about the file-format in which
  usbdump stores data.

Modified:
  stable/8/usr.sbin/usbdump/usbdump.c   (contents, props changed)
Directory Properties:
  stable/8/usr.sbin/usbdump/   (props changed)

Modified: stable/8/usr.sbin/usbdump/usbdump.c
==
--- stable/8/usr.sbin/usbdump/usbdump.c Thu Mar 22 17:01:25 2012
(r233313)
+++ stable/8/usr.sbin/usbdump/usbdump.c Thu Mar 22 17:02:05 2012
(r233314)
@@ -70,9 +70,23 @@ struct usbcap_filehdr {
uint8_t reserved[26];
 } __packed;
 
+#defineHEADER_ALIGN(x,a) (((x) + (a) - 1)  ~((a) - 1))
+
+struct header_32 {
+   /* capture timestamp */
+   uint32_t ts_sec;
+   uint32_t ts_usec;
+   /* data length and alignment information */
+   uint32_t caplen;
+   uint32_t datalen;
+   uint8_t hdrlen;
+   uint8_t align;
+} __packed;
+
 static int doexit = 0;
 static int pkt_captured = 0;
 static int verbose = 0;
+static int uf_minor;
 static const char *i_arg = usbus0;
 static const char *r_arg = NULL;
 static const char *w_arg = NULL;
@@ -283,7 +297,7 @@ hexdump(const uint8_t *region, uint32_t 
 }
 
 static void
-print_apacket(const struct bpf_hdr *hdr, const uint8_t *ptr, int ptr_len)
+print_apacket(const struct header_32 *hdr, const uint8_t *ptr, int ptr_len)
 {
struct tm *tm;
struct usbpf_pkthdr up_temp;
@@ -318,8 +332,8 @@ print_apacket(const struct bpf_hdr *hdr,
up-up_packet_count = le32toh(up-up_packet_count);
up-up_endpoint = le32toh(up-up_endpoint);
 
-   tv.tv_sec = hdr-bh_tstamp.tv_sec;
-   tv.tv_usec = hdr-bh_tstamp.tv_usec;
+   tv.tv_sec = hdr-ts_sec;
+   tv.tv_usec = hdr-ts_usec;
tm = localtime(tv.tv_sec);
 
len = strftime(buf, sizeof(buf), %H:%M:%S, tm);
@@ -384,19 +398,73 @@ print_apacket(const struct bpf_hdr *hdr,
 }
 
 static void
-print_packets(uint8_t *data, const int datalen)
+fix_packets(uint8_t *data, const int datalen)
 {
-   const struct bpf_hdr *hdr;
+   struct header_32 temp;
uint8_t *ptr;
uint8_t *next;
+   uint32_t hdrlen;
+   uint32_t caplen;
 
for (ptr = data; ptr  (data + datalen); ptr = next) {
+
+   const struct bpf_hdr *hdr;
+
hdr = (const struct bpf_hdr *)ptr;
-   next = ptr + BPF_WORDALIGN(hdr-bh_hdrlen + hdr-bh_caplen);
 
-   if (w_arg == NULL) {
-   print_apacket(hdr, ptr +
-   hdr-bh_hdrlen, hdr-bh_caplen);
+   temp.ts_sec = htole32(hdr-bh_tstamp.tv_sec);
+   temp.ts_usec = htole32(hdr-bh_tstamp.tv_usec);
+   temp.caplen = htole32(hdr-bh_caplen);
+   temp.datalen = htole32(hdr-bh_datalen);
+   temp.hdrlen = hdr-bh_hdrlen;
+   temp.align = BPF_WORDALIGN(1);
+
+   hdrlen = hdr-bh_hdrlen;
+   caplen = hdr-bh_caplen;
+
+   if ((hdrlen = sizeof(temp))  (hdrlen = 255) 
+   ((ptr + hdrlen) = (data + datalen))) {
+   memcpy(ptr, temp, sizeof(temp));
+   memset(ptr + sizeof(temp), 0, hdrlen - sizeof(temp));
+   } else {
+   err(EXIT_FAILURE, Invalid header length %d, hdrlen);
+   }
+
+   next = ptr + BPF_WORDALIGN(hdrlen + caplen);
+
+   if (next = ptr)
+   err(EXIT_FAILURE, Invalid length);
+   }
+}
+
+static void
+print_packets(uint8_t *data, const int datalen)
+{
+   struct header_32 temp;
+   uint8_t *ptr;
+   uint8_t *next;
+
+   for (ptr = data; ptr  (data + datalen); ptr = next) {
+
+   const struct header_32 *hdr32;
+
+   hdr32 = (const struct header_32 *)ptr;
+
+   temp.ts_sec = le32toh(hdr32-ts_sec);
+   temp.ts_usec = le32toh(hdr32-ts_usec);
+   temp.caplen = le32toh(hdr32-caplen);
+   temp.datalen = le32toh(hdr32-datalen);
+   temp.hdrlen = hdr32-hdrlen;
+   temp.align = hdr32-align;
+
+   next = ptr + HEADER_ALIGN(temp.hdrlen + temp.caplen, 
temp.align);
+
+   if (next = ptr)
+   err(EXIT_FAILURE, Invalid length);
+
+   if (w_arg == NULL || r_arg != NULL) {
+   print_apacket(temp, ptr +
+   temp.hdrlen, temp.caplen);
}
pkt_captured++;
}
@@ -437,6 +505,9 @@ read_file(struct usbcap *p)
err(EXIT_FAILURE, Could not read complete 
USB data payload);
}
+   if (uf_minor == 2)
+   fix_packets(data, datalen);
+

svn commit: r233315 - stable/9/usr.sbin/usbdump

2012-03-22 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Mar 22 17:04:49 2012
New Revision: 233315
URL: http://svn.freebsd.org/changeset/base/233315

Log:
  MFC r233037 and r233039:
  Fix cross-platform issue about the file-format in which
  usbdump stores data.

Modified:
  stable/9/usr.sbin/usbdump/usbdump.c
Directory Properties:
  stable/9/usr.sbin/usbdump/   (props changed)

Modified: stable/9/usr.sbin/usbdump/usbdump.c
==
--- stable/9/usr.sbin/usbdump/usbdump.c Thu Mar 22 17:02:05 2012
(r233314)
+++ stable/9/usr.sbin/usbdump/usbdump.c Thu Mar 22 17:04:49 2012
(r233315)
@@ -92,9 +92,23 @@ struct usbcap_filehdr {
uint8_t reserved[26];
 } __packed;
 
+#defineHEADER_ALIGN(x,a) (((x) + (a) - 1)  ~((a) - 1))
+
+struct header_32 {
+   /* capture timestamp */
+   uint32_t ts_sec;
+   uint32_t ts_usec;
+   /* data length and alignment information */
+   uint32_t caplen;
+   uint32_t datalen;
+   uint8_t hdrlen;
+   uint8_t align;
+} __packed;
+
 static int doexit = 0;
 static int pkt_captured = 0;
 static int verbose = 0;
+static int uf_minor;
 static const char *i_arg = usbus0;
 static const char *r_arg = NULL;
 static const char *w_arg = NULL;
@@ -413,7 +427,7 @@ hexdump(const uint8_t *region, uint32_t 
 }
 
 static void
-print_apacket(const struct bpf_hdr *hdr, const uint8_t *ptr, int ptr_len)
+print_apacket(const struct header_32 *hdr, const uint8_t *ptr, int ptr_len)
 {
struct tm *tm;
struct usbpf_pkthdr up_temp;
@@ -448,8 +462,8 @@ print_apacket(const struct bpf_hdr *hdr,
up-up_packet_count = le32toh(up-up_packet_count);
up-up_endpoint = le32toh(up-up_endpoint);
 
-   tv.tv_sec = hdr-bh_tstamp.tv_sec;
-   tv.tv_usec = hdr-bh_tstamp.tv_usec;
+   tv.tv_sec = hdr-ts_sec;
+   tv.tv_usec = hdr-ts_usec;
tm = localtime(tv.tv_sec);
 
len = strftime(buf, sizeof(buf), %H:%M:%S, tm);
@@ -514,19 +528,73 @@ print_apacket(const struct bpf_hdr *hdr,
 }
 
 static void
-print_packets(uint8_t *data, const int datalen)
+fix_packets(uint8_t *data, const int datalen)
 {
-   const struct bpf_hdr *hdr;
+   struct header_32 temp;
uint8_t *ptr;
uint8_t *next;
+   uint32_t hdrlen;
+   uint32_t caplen;
 
for (ptr = data; ptr  (data + datalen); ptr = next) {
+
+   const struct bpf_hdr *hdr;
+
hdr = (const struct bpf_hdr *)ptr;
-   next = ptr + BPF_WORDALIGN(hdr-bh_hdrlen + hdr-bh_caplen);
 
-   if (w_arg == NULL) {
-   print_apacket(hdr, ptr +
-   hdr-bh_hdrlen, hdr-bh_caplen);
+   temp.ts_sec = htole32(hdr-bh_tstamp.tv_sec);
+   temp.ts_usec = htole32(hdr-bh_tstamp.tv_usec);
+   temp.caplen = htole32(hdr-bh_caplen);
+   temp.datalen = htole32(hdr-bh_datalen);
+   temp.hdrlen = hdr-bh_hdrlen;
+   temp.align = BPF_WORDALIGN(1);
+
+   hdrlen = hdr-bh_hdrlen;
+   caplen = hdr-bh_caplen;
+
+   if ((hdrlen = sizeof(temp))  (hdrlen = 255) 
+   ((ptr + hdrlen) = (data + datalen))) {
+   memcpy(ptr, temp, sizeof(temp));
+   memset(ptr + sizeof(temp), 0, hdrlen - sizeof(temp));
+   } else {
+   err(EXIT_FAILURE, Invalid header length %d, hdrlen);
+   }
+
+   next = ptr + BPF_WORDALIGN(hdrlen + caplen);
+
+   if (next = ptr)
+   err(EXIT_FAILURE, Invalid length);
+   }
+}
+
+static void
+print_packets(uint8_t *data, const int datalen)
+{
+   struct header_32 temp;
+   uint8_t *ptr;
+   uint8_t *next;
+
+   for (ptr = data; ptr  (data + datalen); ptr = next) {
+
+   const struct header_32 *hdr32;
+
+   hdr32 = (const struct header_32 *)ptr;
+
+   temp.ts_sec = le32toh(hdr32-ts_sec);
+   temp.ts_usec = le32toh(hdr32-ts_usec);
+   temp.caplen = le32toh(hdr32-caplen);
+   temp.datalen = le32toh(hdr32-datalen);
+   temp.hdrlen = hdr32-hdrlen;
+   temp.align = hdr32-align;
+
+   next = ptr + HEADER_ALIGN(temp.hdrlen + temp.caplen, 
temp.align);
+
+   if (next = ptr)
+   err(EXIT_FAILURE, Invalid length);
+
+   if (w_arg == NULL || r_arg != NULL) {
+   print_apacket(temp, ptr +
+   temp.hdrlen, temp.caplen);
}
pkt_captured++;
}
@@ -567,6 +635,9 @@ read_file(struct usbcap *p)
err(EXIT_FAILURE, Could not read complete 
USB data payload);
}
+   if (uf_minor == 2)
+   fix_packets(data, datalen);
+
print_packets(data, datalen);
 

svn commit: r233316 - head/sys/sys

2012-03-22 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Thu Mar 22 17:36:53 2012
New Revision: 233316
URL: http://svn.freebsd.org/changeset/base/233316

Log:
  Fix PMC syscall on 64-bit big endian systems.
  
  Sycall argument is pointer to array of register_t values. Casting it to
  pointer to structure with fields of size smaller then register_t we rely
  on compiler-dependent memory layout of structure.
  
  Tested on: mips64 and amd64 systems

Modified:
  head/sys/sys/pmc.h

Modified: head/sys/sys/pmc.h
==
--- head/sys/sys/pmc.h  Thu Mar 22 17:04:49 2012(r233315)
+++ head/sys/sys/pmc.h  Thu Mar 22 17:36:53 2012(r233316)
@@ -589,7 +589,7 @@ struct pmc_op_getmsr {
  */
 
 struct pmc_syscall_args {
-   uint32_tpmop_code;  /* one of PMC_OP_* */
+   register_t  pmop_code;  /* one of PMC_OP_* */
void*pmop_data; /* syscall parameter */
 };
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r233317 - head/usr.sbin/pmcstat

2012-03-22 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Thu Mar 22 17:44:36 2012
New Revision: 233317
URL: http://svn.freebsd.org/changeset/base/233317

Log:
  Fix base vaddr detection for ELF binaries. PT_LOAD with offset 0 is not
  mandatory for ELF binaries so we'll use the segment with offset less then
  alignment and align it appropriately (which covers pt_offset == 0 case)

Modified:
  head/usr.sbin/pmcstat/pmcstat_log.c

Modified: head/usr.sbin/pmcstat/pmcstat_log.c
==
--- head/usr.sbin/pmcstat/pmcstat_log.c Thu Mar 22 17:36:53 2012
(r233316)
+++ head/usr.sbin/pmcstat/pmcstat_log.c Thu Mar 22 17:44:36 2012
(r233317)
@@ -697,8 +697,8 @@ pmcstat_image_get_elf_params(struct pmcs
ph.p_offset);
break;
case PT_LOAD:
-   if (ph.p_offset == 0)
-   image-pi_vaddr = ph.p_vaddr;
+   if ((ph.p_offset  (-ph.p_align)) == 0)
+   image-pi_vaddr = ph.p_vaddr  
(-ph.p_align);
break;
}
}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r233318 - in head/sys/mips: atheros mips

2012-03-22 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Thu Mar 22 17:47:52 2012
New Revision: 233318
URL: http://svn.freebsd.org/changeset/base/233318

Log:
  Move PMC hook invocation to cpu_intr. The idea is the same as with ast()
  call but there is no reason to implement it in assembler.

Modified:
  head/sys/mips/atheros/apb.c
  head/sys/mips/mips/intr_machdep.c

Modified: head/sys/mips/atheros/apb.c
==
--- head/sys/mips/atheros/apb.c Thu Mar 22 17:44:36 2012(r233317)
+++ head/sys/mips/atheros/apb.c Thu Mar 22 17:47:52 2012(r233318)
@@ -348,7 +348,6 @@ apb_filter(void *arg)
uint32_t reg, irq;
struct thread *td;
struct trapframe *tf;
-   register_t s;
 
reg = ATH_READ_REG(AR71XX_MISC_INTR_STATUS);
for (irq = 0; irq  APB_NIRQS; irq++) {
@@ -373,28 +372,12 @@ apb_filter(void *arg)
td = PCPU_GET(curthread);
tf = td-td_intr_frame;
 
-   s = intr_disable();
+   if (pmc_intr)
+   (*pmc_intr)(PCPU_GET(cpuid), 
tf);
+

mips_intrcnt_inc(sc-sc_intr_counter[irq]);
 
-   if (pmc_intr) {
-   /*
-* Make sure at least one of 
counters 
-* generated this interrupt
-*/
-   if 
(!(*pmc_intr)(PCPU_GET(cpuid), tf)) {
-   intr_restore(s);
-   continue;
-   }
-   }
-
-   intr_restore(s);
-
-   if (pmc_hook  (td-td_pflags  
TDP_CALLCHAIN))
-   pmc_hook(PCPU_GET(curthread),
-   PMC_FN_USER_CALLCHAIN, 
tf);
-   
continue;
-
}
/* Ignore timer interrupts */
if (irq != 0)

Modified: head/sys/mips/mips/intr_machdep.c
==
--- head/sys/mips/mips/intr_machdep.c   Thu Mar 22 17:44:36 2012
(r233317)
+++ head/sys/mips/mips/intr_machdep.c   Thu Mar 22 17:47:52 2012
(r233318)
@@ -29,10 +29,14 @@
 #include sys/cdefs.h
 __FBSDID($FreeBSD$);
 
+#include opt_hwpmc_hooks.h
+
 #include sys/param.h
 #include sys/systm.h
 #include sys/bus.h
 #include sys/interrupt.h
+#include sys/pmc.h
+#include sys/pmckern.h
 
 #include machine/clock.h
 #include machine/cpu.h
@@ -266,4 +270,9 @@ cpu_intr(struct trapframe *tf)
KASSERT(i == 0, (all interrupts handled));
 
critical_exit();
+
+#ifdef HWPMC_HOOKS
+   if (pmc_hook  (PCPU_GET(curthread)-td_pflags  TDP_CALLCHAIN))
+   pmc_hook(PCPU_GET(curthread), PMC_FN_USER_CALLCHAIN, tf);
+#endif
 }
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r233319 - in head/sys: conf dev/hwpmc mips/atheros mips/include

2012-03-22 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Thu Mar 22 18:01:23 2012
New Revision: 233319
URL: http://svn.freebsd.org/changeset/base/233319

Log:
  Rework MIPS PMC code:
  
  - Replace MIPS24K-specific code with more generic framework that will
  make adding new CPU support easier
  - Add MIPS24K support for new framework
  - Limit backtrace depth to 1 for stability reasons and add option
  HWPMC_MIPS_BACKTRACE to override this limitation

Deleted:
  head/sys/dev/hwpmc/hwpmc_mips24k.h
Modified:
  head/sys/conf/files.mips
  head/sys/conf/options
  head/sys/dev/hwpmc/hwpmc_mips.c
  head/sys/dev/hwpmc/hwpmc_mips24k.c
  head/sys/mips/atheros/files.ar71xx
  head/sys/mips/include/pmc_mdep.h

Modified: head/sys/conf/files.mips
==
--- head/sys/conf/files.mipsThu Mar 22 17:47:52 2012(r233318)
+++ head/sys/conf/files.mipsThu Mar 22 18:01:23 2012(r233319)
@@ -107,7 +107,6 @@ dev/siba/siba_pcib.coptionalsiba pci
 #mips/sentry5/siba_mips.c  optional siba # not yet
 
 dev/hwpmc/hwpmc_mips.c optional hwpmc
-dev/hwpmc/hwpmc_mips24k.c  optional hwpmc
 
 dev/rt/if_rt.c optionalrt
 dev/nvram2env/nvram2env.c  optionalnvram2env

Modified: head/sys/conf/options
==
--- head/sys/conf/options   Thu Mar 22 17:47:52 2012(r233318)
+++ head/sys/conf/options   Thu Mar 22 18:01:23 2012(r233319)
@@ -829,6 +829,7 @@ DCONS_FORCE_GDB opt_dcons.h
 
 # HWPMC options
 HWPMC_HOOKS
+HWPMC_MIPS_BACKTRACE   opt_hwpmc_hooks.h
 
 # XBOX options for FreeBSD/i386, but some files are MI
 XBOX   opt_xbox.h

Modified: head/sys/dev/hwpmc/hwpmc_mips.c
==
--- head/sys/dev/hwpmc/hwpmc_mips.c Thu Mar 22 17:47:52 2012
(r233318)
+++ head/sys/dev/hwpmc/hwpmc_mips.c Thu Mar 22 18:01:23 2012
(r233319)
@@ -28,8 +28,11 @@
 #include sys/cdefs.h
 __FBSDID($FreeBSD$);
 
+#include opt_hwpmc_hooks.h
+
 #include sys/param.h
 #include sys/pmc.h
+#include sys/pmckern.h
 #include sys/systm.h
 
 #include machine/pmc_mdep.h
@@ -37,6 +40,17 @@ __FBSDID($FreeBSD$);
 #include machine/mips_opcode.h
 #include machine/vmparam.h
 
+int mips_npmcs;
+
+/*
+ * Per-processor information.
+ */
+struct mips_cpu {
+   struct pmc_hw   *pc_mipspmcs;
+};
+
+static struct mips_cpu **mips_pcpu;
+
 #if defined(__mips_n64)
 #  define  MIPS_IS_VALID_KERNELADDR(reg)   reg)  3) == 0)  \
((vm_offset_t)(reg) = 
MIPS_XKPHYS_START))
@@ -53,6 +67,413 @@ __FBSDID($FreeBSD$);
 #defineMAX_PROLOGUE_SIZE 0x100
 
 static int
+mips_allocate_pmc(int cpu, int ri, struct pmc *pm,
+  const struct pmc_op_pmcallocate *a)
+{
+   enum pmc_event pe;
+   uint32_t caps, config, counter;
+   uint32_t event;
+   int i;
+
+   KASSERT(cpu = 0  cpu  pmc_cpu_max(),
+   ([mips,%d] illegal CPU value %d, __LINE__, cpu));
+   KASSERT(ri = 0  ri  mips_npmcs,
+   ([mips,%d] illegal row index %d, __LINE__, ri));
+
+   caps = a-pm_caps;
+   if (a-pm_class != mips_pmc_spec.ps_cpuclass)
+   return (EINVAL);
+   pe = a-pm_ev;
+   counter = MIPS_CTR_ALL;
+   event = 0;
+   for (i = 0; i  mips_event_codes_size; i++) {
+   if (mips_event_codes[i].pe_ev == pe) {
+   event = mips_event_codes[i].pe_code;
+   counter =  mips_event_codes[i].pe_counter;
+   break;
+   }
+   }
+
+   if (i == mips_event_codes_size)
+   return (EINVAL);
+
+   if ((counter != MIPS_CTR_ALL)  (counter != ri))
+   return (EINVAL);
+
+   config = mips_get_perfctl(cpu, ri, event, caps);
+
+   pm-pm_md.pm_mips_evsel = config;
+
+   PMCDBG(MDP,ALL,2,mips-allocate ri=%d - config=0x%x, ri, config);
+
+   return 0;
+}
+
+
+static int
+mips_read_pmc(int cpu, int ri, pmc_value_t *v)
+{
+   struct pmc *pm;
+   pmc_value_t tmp;
+
+   KASSERT(cpu = 0  cpu  pmc_cpu_max(),
+   ([mips,%d] illegal CPU value %d, __LINE__, cpu));
+   KASSERT(ri = 0  ri  mips_npmcs,
+   ([mips,%d] illegal row index %d, __LINE__, ri));
+
+   pm  = mips_pcpu[cpu]-pc_mipspmcs[ri].phw_pmc;
+   tmp = mips_pmcn_read(ri);
+   PMCDBG(MDP,REA,2,mips-read id=%d - %jd, ri, tmp);
+
+   if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm)))
+   *v = tmp - (1UL  (mips_pmc_spec.ps_counter_width - 1));
+   else
+   *v = tmp;
+
+   return 0;
+}
+
+static int
+mips_write_pmc(int cpu, int ri, pmc_value_t v)
+{
+   struct pmc *pm;
+
+   KASSERT(cpu = 0  cpu  pmc_cpu_max(),
+   ([mips,%d] illegal CPU value %d, __LINE__, cpu));
+   KASSERT(ri = 0  ri  mips_npmcs,
+   

svn commit: r233320 - head/lib/libpmc

2012-03-22 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Thu Mar 22 18:07:44 2012
New Revision: 233320
URL: http://svn.freebsd.org/changeset/base/233320

Log:
  Make reusable part of code have mips prefix, not mips24

Modified:
  head/lib/libpmc/libpmc.c

Modified: head/lib/libpmc/libpmc.c
==
--- head/lib/libpmc/libpmc.cThu Mar 22 18:01:23 2012(r233319)
+++ head/lib/libpmc/libpmc.cThu Mar 22 18:07:44 2012(r233320)
@@ -79,7 +79,7 @@ static int xscale_allocate_pmc(enum pmc_
 #endif
 
 #if defined(__mips__)
-static int mips24k_allocate_pmc(enum pmc_event _pe, char* ctrspec,
+static int mips_allocate_pmc(enum pmc_event _pe, char* ctrspec,
 struct pmc_op_pmcallocate *_pmc_config);
 #endif /* __mips__ */
 
@@ -279,7 +279,7 @@ PMC_CLASS_TABLE_DESC(xscale, XSCALE, xsc
 #endif
 
 #if defined(__mips__)
-PMC_CLASS_TABLE_DESC(mips24k, MIPS24K, mips24k, mips24k);
+PMC_CLASS_TABLE_DESC(mips24k, MIPS24K, mips24k, mips);
 #endif /* __mips__ */
 
 #if defined(__powerpc__)
@@ -2208,12 +2208,12 @@ static struct pmc_event_alias mips24k_al
EV_ALIAS(NULL, NULL)
 };
 
-#defineMIPS24K_KW_OS   os
-#defineMIPS24K_KW_USR  usr
-#defineMIPS24K_KW_ANYTHREADanythread
+#defineMIPS_KW_OS  os
+#defineMIPS_KW_USR usr
+#defineMIPS_KW_ANYTHREAD   anythread
 
 static int
-mips24k_allocate_pmc(enum pmc_event pe, char *ctrspec __unused,
+mips_allocate_pmc(enum pmc_event pe, char *ctrspec __unused,
  struct pmc_op_pmcallocate *pmc_config __unused)
 {
char *p;
@@ -2223,11 +2223,11 @@ mips24k_allocate_pmc(enum pmc_event pe, 
pmc_config-pm_caps |= (PMC_CAP_READ | PMC_CAP_WRITE);

while ((p = strsep(ctrspec, ,)) != NULL) {
-   if (KWMATCH(p, MIPS24K_KW_OS))
+   if (KWMATCH(p, MIPS_KW_OS))
pmc_config-pm_caps |= PMC_CAP_SYSTEM;
-   else if (KWMATCH(p, MIPS24K_KW_USR))
+   else if (KWMATCH(p, MIPS_KW_USR))
pmc_config-pm_caps |= PMC_CAP_USER;
-   else if (KWMATCH(p, MIPS24K_KW_ANYTHREAD))
+   else if (KWMATCH(p, MIPS_KW_ANYTHREAD))
pmc_config-pm_caps |= (PMC_CAP_USER | PMC_CAP_SYSTEM);
else
return (-1);
@@ -2235,6 +2235,7 @@ mips24k_allocate_pmc(enum pmc_event pe, 
 
return (0);
 }
+
 #endif /* __mips__ */
 
 #if defined(__powerpc__)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r233321 - head/lib/libpmc

2012-03-22 Thread Joseph Koshy
Author: jkoshy
Date: Thu Mar 22 19:04:22 2012
New Revision: 233321
URL: http://svn.freebsd.org/changeset/base/233321

Log:
  Correct a function prototype.
  
  Submitted by: Anders Magnusson ragge at ludd.ltu.se, via joel

Modified:
  head/lib/libpmc/pmc.h

Modified: head/lib/libpmc/pmc.h
==
--- head/lib/libpmc/pmc.h   Thu Mar 22 18:07:44 2012(r233320)
+++ head/lib/libpmc/pmc.h   Thu Mar 22 19:04:22 2012(r233321)
@@ -98,7 +98,7 @@ int   pmc_npmc(int _cpu);
 intpmc_cpuinfo(const struct pmc_cpuinfo **_cpu_info);
 intpmc_pmcinfo(int _cpu, struct pmc_pmcinfo **_pmc_info);
 
-const char *pmc_name_of_capability(uint32_t _c);
+const char *pmc_name_of_capability(enum pmc_caps _c);
 const char *pmc_name_of_class(enum pmc_class _pc);
 const char *pmc_name_of_cputype(enum pmc_cputype _cp);
 const char *pmc_name_of_disposition(enum pmc_disp _pd);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r233249 - head/sys/amd64/acpica

2012-03-22 Thread Jung-uk Kim
On Thursday 22 March 2012 07:48 am, John Baldwin wrote:
 On Thursday, March 22, 2012 5:32:59 am Andriy Gapon wrote:
  on 21/03/2012 21:02 Jung-uk Kim said the following:
   On Wednesday 21 March 2012 01:57 pm, Andriy Gapon wrote:
   on 21/03/2012 19:41 Jung-uk Kim said the following:
   I am well aware of the problem.  In fact, that's why I had to
   merge ACPICA 20120320 rather quickly, which added a new flag
   to not execute _GTS method.  Both _GTS and _BFS are turned
   off by default.  You can control them with a new tunable
   debug.acpi.sleep_flags if you want.
  
   But the bug still has to be fixed, right?
   Even if it takes a non-default sysctl value to give the bug a
   chance.
  
   Ideally, yes.  However, I am not so sure if we can call it a
   bug because AcpiEnterSleepState() must be called with
   interrupt disabled and there is no way to change that API
   without breaking other OSes. We can only work around it locally
   or persuade upstream to find a better way to do this in ACPICA
   itself.  Either way, it will be pretty hackish. :-(
 
  I see.  Thank you.
  Maybe the code could be somehow tricked into using M_NOWAIT in
  this

 context...

 That still wouldn't be good enough.  We don't want to try to
 acquire any regular mutexes either (we can't safely block to let
 the lock owner run, or the lock owner might be a suspended thread
 on another CPU, etc.).  The only proper way to fix this would be to
 use pre-allocated storage in this particular case, but given that
 Windows doesn't invoke these methods on suspend/resume, it's
 doubtful that we will ever need to do so.

FYI, I filed an upstream PR to track this issue:

http://acpica.org/bugzilla/show_bug.cgi?id=950

Jung-uk Kim
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r233249 - head/sys/amd64/acpica

2012-03-22 Thread Jung-uk Kim
On Thursday 22 March 2012 10:14 am, Konstantin Belousov wrote:
 On Thu, Mar 22, 2012 at 07:48:49AM -0400, John Baldwin wrote:
  On Thursday, March 22, 2012 5:32:59 am Andriy Gapon wrote:
   on 21/03/2012 21:02 Jung-uk Kim said the following:
On Wednesday 21 March 2012 01:57 pm, Andriy Gapon wrote:
on 21/03/2012 19:41 Jung-uk Kim said the following:
I am well aware of the problem.  In fact, that's why I had
to merge ACPICA 20120320 rather quickly, which added a new
flag to not execute _GTS method.  Both _GTS and _BFS are
turned off by default.  You can control them with a new
tunable
debug.acpi.sleep_flags if you want.
   
But the bug still has to be fixed, right?
Even if it takes a non-default sysctl value to give the bug
a chance.
   
Ideally, yes.  However, I am not so sure if we can call it a
bug because AcpiEnterSleepState() must be called with
interrupt disabled and there is no way to change that API
without breaking other OSes. We can only work around it
locally or persuade upstream to find a better way to do this
in ACPICA itself.  Either way, it will be pretty hackish. :-(
  
   I see.  Thank you.
   Maybe the code could be somehow tricked into using M_NOWAIT in
   this
 
  context...
 
  That still wouldn't be good enough.  We don't want to try to
  acquire any regular mutexes either (we can't safely block to let
  the lock owner run, or the lock owner might be a suspended thread
  on another CPU, etc.).  The only proper way to fix this would be
  to use pre-allocated storage in this particular case, but given
  that Windows doesn't invoke these methods on suspend/resume, it's
  doubtful that we will ever need to do so.

 I already noted this to Jung-uk, I think that current suspend
 handling is (somewhat) wrong. We shall not stop other CPUs for
 suspension when they are executing some random kernel code. Rather,
 CPUs should be safely stopped at the kernel-user boundary, or at
 sleep point, or at designated suspend point like idle loop.

 We already are engaged into somewhat doubtful actions like
 restoring of %cr2, since we might, for instance, preemt page fault
 handler with suspend IPI.

And as I noted to you, a proper fix isn't trivial and I need help in 
this area. :-(

Jung-uk Kim
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r233322 - stable/9/sys/fs/ext2fs

2012-03-22 Thread Pedro F. Giffuni
Author: pfg
Date: Thu Mar 22 20:31:52 2012
New Revision: 233322
URL: http://svn.freebsd.org/changeset/base/233322

Log:
  MFC:  232703
  
  Add support for ns timestamps and birthtime to the ext2/3 driver.
  
  When using big inodes there is sufficient space in ext3 to
  keep extra resolution and birthtime (creation) timestamps.
  We now support the extra timestamps silently when the inode
  is big enough.
  
  Reviewed by:  bde
  Approved by:  jhb (mentor)

Modified:
  stable/9/sys/fs/ext2fs/ext2_alloc.c
  stable/9/sys/fs/ext2fs/ext2_dinode.h
  stable/9/sys/fs/ext2fs/ext2_inode_cnv.c
  stable/9/sys/fs/ext2fs/ext2_vfsops.c
  stable/9/sys/fs/ext2fs/ext2_vnops.c
  stable/9/sys/fs/ext2fs/ext2fs.h
  stable/9/sys/fs/ext2fs/inode.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/fs/   (props changed)

Modified: stable/9/sys/fs/ext2fs/ext2_alloc.c
==
--- stable/9/sys/fs/ext2fs/ext2_alloc.c Thu Mar 22 19:04:22 2012
(r233321)
+++ stable/9/sys/fs/ext2fs/ext2_alloc.c Thu Mar 22 20:31:52 2012
(r233322)
@@ -344,6 +344,7 @@ ext2_valloc(pvp, mode, cred, vpp)
struct ucred *cred;
struct vnode **vpp;
 {
+   struct timespec ts;
struct inode *pip;
struct m_ext2fs *fs;
struct inode *ip;
@@ -385,14 +386,14 @@ ext2_valloc(pvp, mode, cred, vpp)
}
ip = VTOI(*vpp);
 
-   /* 
- the question is whether using VGET was such good idea at all -
- Linux doesn't read the old inode in when it's allocating a
- new one. I will set at least i_size  i_blocks the zero. 
-   */ 
-   ip-i_mode = 0;
+   /*
+* The question is whether using VGET was such good idea at all:
+* Linux doesn't read the old inode in when it is allocating a
+* new one. I will set at least i_size and i_blocks to zero.
+*/
ip-i_size = 0;
ip-i_blocks = 0;
+   ip-i_mode = 0;
ip-i_flags = 0;
 /* now we want to make sure that the block pointers are zeroed out */
 for (i = 0; i  NDADDR; i++)
@@ -406,6 +407,11 @@ ext2_valloc(pvp, mode, cred, vpp)
 */
if (ip-i_gen == 0 || ++ip-i_gen == 0)
ip-i_gen = random() / 2 + 1;
+
+   vfs_timestamp(ts);
+   ip-i_birthtime = ts.tv_sec;
+   ip-i_birthnsec = ts.tv_nsec;
+
 /*
 printf(ext2_valloc: allocated inode %d\n, ino);
 */

Modified: stable/9/sys/fs/ext2fs/ext2_dinode.h
==
--- stable/9/sys/fs/ext2fs/ext2_dinode.hThu Mar 22 19:04:22 2012
(r233321)
+++ stable/9/sys/fs/ext2fs/ext2_dinode.hThu Mar 22 20:31:52 2012
(r233322)
@@ -61,6 +61,16 @@
 #define EXT2_NODUMP0x0040  /* do not dump file */
 #define EXT2_NOATIME   0x0080  /* do not update atime */
 
+/*
+ * Definitions for nanosecond timestamps.
+ * Ext3 inode versioning, 2006-12-13.
+ */
+#define EXT3_EPOCH_BITS2
+#define EXT3_EPOCH_MASK((1  EXT3_EPOCH_BITS) - 1)
+#define EXT3_NSEC_MASK (~0UL  EXT3_EPOCH_BITS)
+
+#define E2DI_HAS_XTIME(ip) (EXT2_INODE_SIZE((ip)-i_e2fs)  \
+   E2FS_REV0_INODE_SIZE)
 
 /*
  * Structure of an inode on the disk
@@ -77,7 +87,7 @@ struct ext2fs_dinode {
uint16_te2di_nlink; /*  26: File link count */
uint32_te2di_nblock;/*  28: Blocks count */
uint32_te2di_flags; /*  32: Status flags (chflags) */
-   uint32_te2di_linux_reserved1; /* 36 */
+   uint32_te2di_version;   /*  36: Low 32 bits inode version */
uint32_te2di_blocks[EXT2_N_BLOCKS]; /* 40: disk blocks */
uint32_te2di_gen;   /* 100: generation number */
uint32_te2di_facl;  /* 104: file ACL (not implemented) */
@@ -91,6 +101,12 @@ struct ext2fs_dinode {
uint32_te2di_linux_reserved3; /* 124 */
uint16_te2di_extra_isize;
uint16_te2di_pad1;
+   uint32_te2di_ctime_extra; /* Extra change time */
+   uint32_te2di_mtime_extra; /* Extra modification time */
+   uint32_te2di_atime_extra; /* Extra access time */
+   uint32_te2di_crtime;  /* Creation (birth)time */
+   uint32_te2di_crtime_extra; /* Extra creation (birth)time */
+   uint32_te2di_version_hi;  /* High 30 bits of inode version */
 };
 
 #endif /* !_FS_EXT2FS_EXT2_DINODE_H_ */

Modified: stable/9/sys/fs/ext2fs/ext2_inode_cnv.c
==
--- stable/9/sys/fs/ext2fs/ext2_inode_cnv.c Thu Mar 22 19:04:22 2012
(r233321)
+++ stable/9/sys/fs/ext2fs/ext2_inode_cnv.c Thu Mar 22 20:31:52 2012
(r233322)
@@ -36,6 +36,9 @@
 #include fs/ext2fs/ext2_extern.h
 #include fs/ext2fs/ext2_dinode.h
 
+#define 

svn commit: r233323 - head/sys/boot/fdt

2012-03-22 Thread Rafal Jaworowski
Author: raj
Date: Thu Mar 22 20:34:26 2012
New Revision: 233323
URL: http://svn.freebsd.org/changeset/base/233323

Log:
  Improve FDT handling in loader(8) and make it more robust.
  
  o Fix buffer overflows when using a long property body in node paths.
  o Fix loop end condition when iterating through the symbol table.
  o Better error handling during node modification, better problem reporting.
  o Eliminate build time warnings.
  
  Submitted by: Lukasz Wojcik
  Obtained from:Semihalf
  MFC after:1 week

Modified:
  head/sys/boot/fdt/fdt_loader_cmd.c

Modified: head/sys/boot/fdt/fdt_loader_cmd.c
==
--- head/sys/boot/fdt/fdt_loader_cmd.c  Thu Mar 22 20:31:52 2012
(r233322)
+++ head/sys/boot/fdt/fdt_loader_cmd.c  Thu Mar 22 20:34:26 2012
(r233323)
@@ -57,8 +57,6 @@ __FBSDID($FreeBSD$);
 #define STR(number) #number
 #define STRINGIFY(number) STR(number)
 
-#define MIN(num1, num2)(((num1)  (num2)) ? (num1):(num2))
-
 #define COPYOUT(s,d,l) archsw.arch_copyout((vm_offset_t)(s), d, l)
 
 #define FDT_STATIC_DTB_SYMBOL  fdt_static_dtb
@@ -110,9 +108,11 @@ fdt_find_static_dtb(void)
Elf_Sym *symtab;
Elf_Dyn *dyn;
char *strtab, *strp;
-   int i;
+   int i, sym_count;
 
-   esym = strtab = symtab = 0;
+   symtab = NULL;
+   dyntab = esym = 0;
+   strtab = strp = NULL;
 
offs = __elfN(relocation_offset);
 
@@ -129,6 +129,7 @@ fdt_find_static_dtb(void)
if (md == NULL)
return (0);
COPYOUT(md-md_data, dyntab, sizeof(dyntab));
+
dyntab += offs;
 
/* Locate STRTAB and DYNTAB */
@@ -152,6 +153,8 @@ fdt_find_static_dtb(void)
return (0);
}
 
+   sym_count = (int)((Elf_Sym *)esym - symtab) / sizeof(Elf_Sym);
+
/*
 * The most efficent way to find a symbol would be to calculate a
 * hash, find proper bucket and chain, and thus find a symbol.
@@ -162,7 +165,7 @@ fdt_find_static_dtb(void)
 * we are eliminating symbols type of which is not STT_NOTYPE, or(and)
 * those which binding attribute is not STB_GLOBAL.
 */
-   for (i = 0; (vm_offset_t)(symtab + i)  esym; i++) {
+   for (i = 0; i  sym_count; i++) {
COPYOUT(symtab + i, sym, sizeof(sym));
if (ELF_ST_BIND(sym.st_info) != STB_GLOBAL ||
ELF_ST_TYPE(sym.st_info) != STT_NOTYPE)
@@ -190,7 +193,7 @@ fdt_setup_fdtp()
 */
bfp = file_findfile(NULL, dtb);
if (bfp == NULL) {
-   if ((fdtp = (struct fdt_head *)fdt_find_static_dtb()) == 0) {
+   if ((fdtp = (struct fdt_header *)fdt_find_static_dtb()) == 0) {
command_errmsg = no device tree blob found!;
return (CMD_ERROR);
}
@@ -842,32 +845,41 @@ fdt_isprint(const void *data, int len, i
 static int
 fdt_data_str(const void *data, int len, int count, char **buf)
 {
-   char tmp[80], *b;
+   char *b, *tmp;
const char *d;
-   int i, l;
+   int buf_len, i, l;
 
/*
 * Calculate the length for the string and allocate memory.
 *
-* Note len already includes at least one terminator.
+* Note that 'len' already includes at least one terminator.
 */
-   l = len;
+   buf_len = len;
if (count  1) {
/*
 * Each token had already a terminator buried in 'len', but we
 * only need one eventually, don't count space for these.
 */
-   l -= count - 1;
+   buf_len -= count - 1;
 
/* Each consecutive token requires a ,  separator. */
-   l += count * 2;
+   buf_len += count * 2;
}
-   /* Space for surrounding double quotes. */
-   l += count * 2;
 
-   b = (char *)malloc(l);
+   /* Add some space for surrounding double quotes. */
+   buf_len += count * 2;
+
+   /* Note that string being put in 'tmp' may be as big as 'buf_len'. */
+   b = (char *)malloc(buf_len);
+   tmp = (char *)malloc(buf_len);
if (b == NULL)
-   return (1);
+   goto error;
+
+   if (tmp == NULL) {
+   free(b);
+   goto error;
+   }
+
b[0] = '\0';
 
/*
@@ -887,13 +899,17 @@ fdt_data_str(const void *data, int len, 
} while (i  len);
*buf = b;
 
+   free(tmp);
+
return (0);
+error:
+   return (1);
 }
 
 static int
 fdt_data_cell(const void *data, int len, char **buf)
 {
-   char tmp[80], *b;
+   char *b, *tmp;
const uint32_t *c;
int count, i, l;
 
@@ -916,8 +932,14 @@ fdt_data_cell(const void *data, int len,
l += 3;
 
b = (char *)malloc(l);
+   tmp = (char *)malloc(l);
if (b == NULL)
-   return (1);
+  

svn commit: r233324 - in stable/9/sys: i386/conf nfsclient

2012-03-22 Thread John Baldwin
Author: jhb
Date: Thu Mar 22 20:51:35 2012
New Revision: 233324
URL: http://svn.freebsd.org/changeset/base/233324

Log:
  MFC 232116:
  Adjust the nfs_skip_wcc_data_onerr setting so that it does not block
  post-op attributes for ENOENT errors now that the name caching logic
  depends on working post-op attributes.

Modified:
  stable/9/sys/nfsclient/nfs_krpc.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)
  stable/9/sys/fs/   (props changed)
  stable/9/sys/fs/ntfs/   (props changed)
  stable/9/sys/i386/conf/XENHVM   (props changed)

Modified: stable/9/sys/nfsclient/nfs_krpc.c
==
--- stable/9/sys/nfsclient/nfs_krpc.c   Thu Mar 22 20:34:26 2012
(r233323)
+++ stable/9/sys/nfsclient/nfs_krpc.c   Thu Mar 22 20:51:35 2012
(r233324)
@@ -603,13 +603,15 @@ tryagain:
if (error == ESTALE)
nfs_purgecache(vp);
/*
-* Skip wcc data on NFS errors for now.  NetApp filers
-* return corrupt postop attrs in the wcc data for NFS
-* err EROFS.  Not sure if they could return corrupt
-* postop attrs for others errors.
+* Skip wcc data on non-ENOENT NFS errors for now.
+* NetApp filers return corrupt postop attrs in the
+* wcc data for NFS err EROFS.  Not sure if they could
+* return corrupt postop attrs for others errors.
+* Blocking ENOENT post-op attributes breaks negative
+* name caching, so always allow it through.
 */
if ((nmp-nm_flag  NFSMNT_NFSV3) 
-   !nfs_skip_wcc_data_onerr) {
+   (!nfs_skip_wcc_data_onerr || error == ENOENT)) {
*mrp = mrep;
*mdp = md;
*dposp = dpos;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r233325 - in stable/8/sys: i386/conf nfsclient

2012-03-22 Thread John Baldwin
Author: jhb
Date: Thu Mar 22 20:52:00 2012
New Revision: 233325
URL: http://svn.freebsd.org/changeset/base/233325

Log:
  MFC 232116:
  Adjust the nfs_skip_wcc_data_onerr setting so that it does not block
  post-op attributes for ENOENT errors now that the name caching logic
  depends on working post-op attributes.

Modified:
  stable/8/sys/nfsclient/nfs_krpc.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/boot/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/e1000/   (props changed)
  stable/8/sys/i386/conf/XENHVM   (props changed)

Modified: stable/8/sys/nfsclient/nfs_krpc.c
==
--- stable/8/sys/nfsclient/nfs_krpc.c   Thu Mar 22 20:51:35 2012
(r233324)
+++ stable/8/sys/nfsclient/nfs_krpc.c   Thu Mar 22 20:52:00 2012
(r233325)
@@ -603,13 +603,15 @@ tryagain:
if (error == ESTALE)
nfs_purgecache(vp);
/*
-* Skip wcc data on NFS errors for now.  NetApp filers
-* return corrupt postop attrs in the wcc data for NFS
-* err EROFS.  Not sure if they could return corrupt
-* postop attrs for others errors.
+* Skip wcc data on non-ENOENT NFS errors for now.
+* NetApp filers return corrupt postop attrs in the
+* wcc data for NFS err EROFS.  Not sure if they could
+* return corrupt postop attrs for others errors.
+* Blocking ENOENT post-op attributes breaks negative
+* name caching, so always allow it through.
 */
if ((nmp-nm_flag  NFSMNT_NFSV3) 
-   !nfs_skip_wcc_data_onerr) {
+   (!nfs_skip_wcc_data_onerr || error == ENOENT)) {
*mrp = mrep;
*mdp = md;
*dposp = dpos;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r233326 - in stable/9: sbin/mount_nfs sys/fs/nfsclient sys/i386/conf sys/nfsclient

2012-03-22 Thread John Baldwin
Author: jhb
Date: Thu Mar 22 21:07:54 2012
New Revision: 233326
URL: http://svn.freebsd.org/changeset/base/233326

Log:
  MFC 230547:
  Add a timeout on positive name cache entries in the NFS client.  That is,
  we will only trust a positive name cache entry for a specified amount of
  time before falling back to a LOOKUP RPC, even if the ctime for the file
  handle matches the cached copy in the name cache entry.  The timeout is
  configured via a new 'nametimeo' mount option and defaults to 60 seconds.
  It may be set to zero to disable positive name caching entirely.

Modified:
  stable/9/sbin/mount_nfs/mount_nfs.8
  stable/9/sys/fs/nfsclient/nfs_clvfsops.c
  stable/9/sys/fs/nfsclient/nfs_clvnops.c
  stable/9/sys/fs/nfsclient/nfsmount.h
  stable/9/sys/nfsclient/nfs_vfsops.c
  stable/9/sys/nfsclient/nfs_vnops.c
  stable/9/sys/nfsclient/nfsmount.h
Directory Properties:
  stable/9/sbin/mount_nfs/   (props changed)
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)
  stable/9/sys/fs/   (props changed)
  stable/9/sys/fs/ntfs/   (props changed)
  stable/9/sys/i386/conf/XENHVM   (props changed)

Modified: stable/9/sbin/mount_nfs/mount_nfs.8
==
--- stable/9/sbin/mount_nfs/mount_nfs.8 Thu Mar 22 20:52:00 2012
(r233325)
+++ stable/9/sbin/mount_nfs/mount_nfs.8 Thu Mar 22 21:07:54 2012
(r233326)
@@ -157,6 +157,10 @@ Force the mount protocol to use UDP tran
 (Necessary for some old
 .Bx
 servers.)
+.It Cm nametimeo Ns = Ns Aq Ar value
+Override the default of NFS_DEFAULT_NAMETIMEO for the timeout (in seconds)
+for positive name cache entries.
+If this is set to 0 it disables positive name caching for the mount point.
 .It Cm negnametimeo Ns = Ns Aq Ar value
 Override the default of NFS_DEFAULT_NEGNAMETIMEO for the timeout (in seconds)
 for negative name cache entries. If this is set to 0 it disables negative

Modified: stable/9/sys/fs/nfsclient/nfs_clvfsops.c
==
--- stable/9/sys/fs/nfsclient/nfs_clvfsops.cThu Mar 22 20:52:00 2012
(r233325)
+++ stable/9/sys/fs/nfsclient/nfs_clvfsops.cThu Mar 22 21:07:54 2012
(r233326)
@@ -104,7 +104,7 @@ static void nfs_decode_args(struct mount
 static int mountnfs(struct nfs_args *, struct mount *,
struct sockaddr *, char *, u_char *, int, u_char *, int,
u_char *, int, struct vnode **, struct ucred *,
-   struct thread *, int);
+   struct thread *, int, int);
 static voidnfs_getnlminfo(struct vnode *, uint8_t *, size_t *,
struct sockaddr_storage *, int *, off_t *,
struct timeval *);
@@ -520,7 +520,8 @@ nfs_mountdiskless(char *path,
dirlen = 0;
nam = sodupsockaddr((struct sockaddr *)sin, M_WAITOK);
if ((error = mountnfs(args, mp, nam, path, NULL, 0, dirpath, dirlen,
-   NULL, 0, vpp, td-td_ucred, td, NFS_DEFAULT_NEGNAMETIMEO)) != 0) {
+   NULL, 0, vpp, td-td_ucred, td, NFS_DEFAULT_NAMETIMEO, 
+   NFS_DEFAULT_NEGNAMETIMEO)) != 0) {
printf(nfs_mountroot: mount %s on /: %d\n, path, error);
return (error);
}
@@ -715,7 +716,7 @@ static const char *nfs_opts[] = { from
 retrans, acregmin, acregmax, acdirmin, acdirmax, resvport,
 readahead, hostname, timeout, addr, fh, nfsv3, sec,
 principal, nfsv4, gssname, allgssname, dirpath,
-negnametimeo, nocto, wcommitsize,
+nametimeo, negnametimeo, nocto, wcommitsize,
 NULL };
 
 /*
@@ -760,6 +761,7 @@ nfs_mount(struct mount *mp)
char hst[MNAMELEN];
u_char nfh[NFSX_FHMAX], krbname[100], dirpath[100], srvkrbname[100];
char *opt, *name, *secname;
+   int nametimeo = NFS_DEFAULT_NAMETIMEO;
int negnametimeo = NFS_DEFAULT_NEGNAMETIMEO;
int dirlen, has_nfs_args_opt, krbnamelen, srvkrbnamelen;
size_t hstlen;
@@ -968,6 +970,14 @@ nfs_mount(struct mount *mp)
}
args.flags |= NFSMNT_TIMEO;
}
+   if (vfs_getopt(mp-mnt_optnew, nametimeo, (void **)opt, NULL) == 0) {
+   ret = sscanf(opt, %d, nametimeo);
+   if (ret != 1 || nametimeo  0) {
+   vfs_mount_error(mp, illegal nametimeo: %s, opt);

svn commit: r233327 - in stable/8: sbin/mount_nfs sys/fs/nfsclient sys/i386/conf sys/nfsclient

2012-03-22 Thread John Baldwin
Author: jhb
Date: Thu Mar 22 21:08:14 2012
New Revision: 233327
URL: http://svn.freebsd.org/changeset/base/233327

Log:
  MFC 230547:
  Add a timeout on positive name cache entries in the NFS client.  That is,
  we will only trust a positive name cache entry for a specified amount of
  time before falling back to a LOOKUP RPC, even if the ctime for the file
  handle matches the cached copy in the name cache entry.  The timeout is
  configured via a new 'nametimeo' mount option and defaults to 60 seconds.
  It may be set to zero to disable positive name caching entirely.

Modified:
  stable/8/sbin/mount_nfs/mount_nfs.8
  stable/8/sys/fs/nfsclient/nfs_clvfsops.c
  stable/8/sys/fs/nfsclient/nfs_clvnops.c
  stable/8/sys/fs/nfsclient/nfsmount.h
  stable/8/sys/nfsclient/nfs_vfsops.c
  stable/8/sys/nfsclient/nfs_vnops.c
  stable/8/sys/nfsclient/nfsmount.h
Directory Properties:
  stable/8/sbin/mount_nfs/   (props changed)
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/boot/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/e1000/   (props changed)
  stable/8/sys/i386/conf/XENHVM   (props changed)

Modified: stable/8/sbin/mount_nfs/mount_nfs.8
==
--- stable/8/sbin/mount_nfs/mount_nfs.8 Thu Mar 22 21:07:54 2012
(r233326)
+++ stable/8/sbin/mount_nfs/mount_nfs.8 Thu Mar 22 21:08:14 2012
(r233327)
@@ -151,6 +151,10 @@ Force the mount protocol to use UDP tran
 (Necessary for some old
 .Bx
 servers.)
+.It Cm nametimeo Ns = Ns Aq Ar value
+Override the default of NFS_DEFAULT_NAMETIMEO for the timeout (in seconds)
+for positive name cache entries.
+If this is set to 0 it disables positive name caching for the mount point.
 .It Cm negnametimeo Ns = Ns Aq Ar value
 Override the default of NFS_DEFAULT_NEGNAMETIMEO for the timeout (in seconds)
 for negative name cache entries. If this is set to 0 it disables negative

Modified: stable/8/sys/fs/nfsclient/nfs_clvfsops.c
==
--- stable/8/sys/fs/nfsclient/nfs_clvfsops.cThu Mar 22 21:07:54 2012
(r233326)
+++ stable/8/sys/fs/nfsclient/nfs_clvfsops.cThu Mar 22 21:08:14 2012
(r233327)
@@ -104,7 +104,7 @@ static void nfs_decode_args(struct mount
 static int mountnfs(struct nfs_args *, struct mount *,
struct sockaddr *, char *, u_char *, int, u_char *, int,
u_char *, int, struct vnode **, struct ucred *,
-   struct thread *, int);
+   struct thread *, int, int);
 static voidnfs_getnlminfo(struct vnode *, uint8_t *, size_t *,
struct sockaddr_storage *, int *, off_t *,
struct timeval *);
@@ -516,7 +516,8 @@ nfs_mountdiskless(char *path,
dirlen = 0;
nam = sodupsockaddr((struct sockaddr *)sin, M_WAITOK);
if ((error = mountnfs(args, mp, nam, path, NULL, 0, dirpath, dirlen,
-   NULL, 0, vpp, td-td_ucred, td, NFS_DEFAULT_NEGNAMETIMEO)) != 0) {
+   NULL, 0, vpp, td-td_ucred, td, NFS_DEFAULT_NAMETIMEO, 
+   NFS_DEFAULT_NEGNAMETIMEO)) != 0) {
printf(nfs_mountroot: mount %s on /: %d\n, path, error);
return (error);
}
@@ -711,7 +712,7 @@ static const char *nfs_opts[] = { from
 retrans, acregmin, acregmax, acdirmin, acdirmax, resvport,
 readahead, hostname, timeout, addr, fh, nfsv3, sec,
 principal, nfsv4, gssname, allgssname, dirpath,
-negnametimeo, nocto, wcommitsize,
+nametimeo, negnametimeo, nocto, wcommitsize,
 NULL };
 
 /*
@@ -756,6 +757,7 @@ nfs_mount(struct mount *mp)
char hst[MNAMELEN];
u_char nfh[NFSX_FHMAX], krbname[100], dirpath[100], srvkrbname[100];
char *opt, *name, *secname;
+   int nametimeo = NFS_DEFAULT_NAMETIMEO;
int negnametimeo = NFS_DEFAULT_NEGNAMETIMEO;
int dirlen, has_nfs_args_opt, krbnamelen, srvkrbnamelen;
size_t hstlen;
@@ -964,6 +966,14 @@ nfs_mount(struct mount *mp)
}
args.flags |= NFSMNT_TIMEO;
}
+   if (vfs_getopt(mp-mnt_optnew, nametimeo, (void **)opt, NULL) == 0) {
+   ret = sscanf(opt, %d, nametimeo);
+   if (ret != 1 || nametimeo  0) {
+   vfs_mount_error(mp, illegal nametimeo: %s, opt);
+   error = EINVAL;
+   goto out;
+   }
+   }
if (vfs_getopt(mp-mnt_optnew, negnametimeo, (void **)opt, NULL)
== 0) {
ret = sscanf(opt, %d, negnametimeo);
@@ -1118,7 +1128,7 @@ nfs_mount(struct mount *mp)
args.fh = nfh;
error = mountnfs(args, mp, nam, hst, krbname, krbnamelen, dirpath,
dirlen, srvkrbname, 

svn commit: r233328 - head/sbin/ifconfig

2012-03-22 Thread Adrian Chadd
Author: adrian
Date: Thu Mar 22 21:22:58 2012
New Revision: 233328
URL: http://svn.freebsd.org/changeset/base/233328

Log:
  Fix an incorrect parameter usage here.
  
  Submitted by: montha...@gmail.com

Modified:
  head/sbin/ifconfig/ifieee80211.c

Modified: head/sbin/ifconfig/ifieee80211.c
==
--- head/sbin/ifconfig/ifieee80211.cThu Mar 22 21:08:14 2012
(r233327)
+++ head/sbin/ifconfig/ifieee80211.cThu Mar 22 21:22:58 2012
(r233328)
@@ -1879,7 +1879,7 @@ DECL_CMD_FUNC(set80211meshttl, val, d)
 static
 DECL_CMD_FUNC(set80211meshforward, val, d)
 {
-   set80211(s, IEEE80211_IOC_MESH_FWRD, atoi(val), 0, NULL);
+   set80211(s, IEEE80211_IOC_MESH_FWRD, d, 0, NULL);
 }
 
 static
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r233329 - head/sys/dev/ath/ath_hal/ar5416

2012-03-22 Thread Adrian Chadd
Author: adrian
Date: Thu Mar 22 21:47:14 2012
New Revision: 233329
URL: http://svn.freebsd.org/changeset/base/233329

Log:
  Sprinkle some style(9) things around.

Modified:
  head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
==
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c  Thu Mar 22 21:22:58 
2012(r233328)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c  Thu Mar 22 21:47:14 
2012(r233329)
@@ -689,7 +689,8 @@ ar5416InitUserSettings(struct ath_hal *a
 
/* Restore user-specified settings */
if (ahp-ah_miscMode != 0)
-   OS_REG_WRITE(ah, AR_MISC_MODE, OS_REG_READ(ah, AR_MISC_MODE) | 
ahp-ah_miscMode);
+   OS_REG_WRITE(ah, AR_MISC_MODE, OS_REG_READ(ah, AR_MISC_MODE)
+   | ahp-ah_miscMode);
if (ahp-ah_sifstime != (u_int) -1)
ar5212SetSifsTime(ah, ahp-ah_sifstime);
if (ahp-ah_slottime != (u_int) -1)
@@ -1188,7 +1189,8 @@ ar5416SetTransmitPower(struct ath_hal *a
 HAL_RFGAIN
 ar5416GetRfgain(struct ath_hal *ah)
 {
-   return HAL_RFGAIN_INACTIVE;
+
+   return (HAL_RFGAIN_INACTIVE);
 }
 
 /*
@@ -1197,13 +1199,14 @@ ar5416GetRfgain(struct ath_hal *ah)
 HAL_BOOL
 ar5416Disable(struct ath_hal *ah)
 {
+
if (!ar5416SetPowerMode(ah, HAL_PM_AWAKE, AH_TRUE))
return AH_FALSE;
if (! ar5416SetResetReg(ah, HAL_RESET_COLD))
return AH_FALSE;
 
AH5416(ah)-ah_initPLL(ah, AH_NULL);
-   return AH_TRUE;
+   return (AH_TRUE);
 }
 
 /*
@@ -1215,11 +1218,12 @@ ar5416Disable(struct ath_hal *ah)
 HAL_BOOL
 ar5416PhyDisable(struct ath_hal *ah)
 {
+
if (! ar5416SetResetReg(ah, HAL_RESET_WARM))
return AH_FALSE;
 
AH5416(ah)-ah_initPLL(ah, AH_NULL);
-   return AH_TRUE;
+   return (AH_TRUE);
 }
 
 /*
@@ -1509,6 +1513,7 @@ ar5416SetDefGainValues(struct ath_hal *a
 const struct ar5416eeprom *eep,
 uint8_t txRxAttenLocal, int regChainOffset, int i)
 {
+
if (IS_EEP_MINOR_V3(ah)) {
txRxAttenLocal = pModal-txRxAttenCh[i];
 
@@ -1705,7 +1710,7 @@ ar5416SetBoardValues(struct ath_hal *ah,
eep-baseEepHeader.desiredScaleCCK);
 }
 
-return AH_TRUE;
+return (AH_TRUE);
 }
 
 /*
@@ -1739,7 +1744,8 @@ ar5416SetRatesArrayFromTargetPower(struc
 
/* Set rates Array from collected data */
ratesArray[rate6mb] = ratesArray[rate9mb] = ratesArray[rate12mb] =
-   ratesArray[rate18mb] = ratesArray[rate24mb] = 
targetPowerOfdm-tPow2x[0];
+   ratesArray[rate18mb] = ratesArray[rate24mb] =
+   targetPowerOfdm-tPow2x[0];
ratesArray[rate36mb] = targetPowerOfdm-tPow2x[1];
ratesArray[rate48mb] = targetPowerOfdm-tPow2x[2];
ratesArray[rate54mb] = targetPowerOfdm-tPow2x[3];
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


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

2012-03-22 Thread Adrian Chadd
Author: adrian
Date: Thu Mar 22 21:48:36 2012
New Revision: 20
URL: http://svn.freebsd.org/changeset/base/20

Log:
  Add some further debugging to try and aid tracking down what the state of
  things were just before a full software queue is drained.

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

Modified: head/sys/dev/ath/if_ath_tx.c
==
--- head/sys/dev/ath/if_ath_tx.cThu Mar 22 21:47:14 2012
(r233329)
+++ head/sys/dev/ath/if_ath_tx.cThu Mar 22 21:48:36 2012
(r20)
@@ -663,6 +663,15 @@ ath_tx_tag_crypto(struct ath_softc *sc, 
 struct mbuf *m0, int iswep, int isfrag, int *hdrlen, int *pktlen,
 int *keyix)
 {
+   DPRINTF(sc, ATH_DEBUG_XMIT,
+   %s: hdrlen=%d, pktlen=%d, isfrag=%d, iswep=%d, m0=%p\n,
+   __func__,
+   *hdrlen,
+   *pktlen,
+   isfrag,
+   iswep,
+   m0);
+
if (iswep) {
const struct ieee80211_cipher *cip;
struct ieee80211_key *k;
@@ -1473,6 +1482,7 @@ ath_tx_start(struct ath_softc *sc, struc
/* No AMPDU TX, we've been assigned a sequence number. */
if (IEEE80211_QOS_HAS_SEQ(wh)) {
bf-bf_state.bfs_seqno_assigned = 1;
+   /* XXX we should store the frag+seqno in bfs_seqno */
bf-bf_state.bfs_seqno =
M_SEQNO_GET(m0)  IEEE80211_SEQ_SEQ_SHIFT;
}
@@ -2636,6 +2646,15 @@ ath_tx_tid_drain(struct ath_softc *sc, s
 
if (t == 0) {
device_printf(sc-sc_dev,
+   %s: node %p: bf=%p: addbaw=%d, dobaw=%d, 
+   seqno_assign=%d, seqno_required=%d, seqno=%d\n,
+   __func__, ni, bf,
+   bf-bf_state.bfs_addedbaw,
+   bf-bf_state.bfs_dobaw,
+   bf-bf_state.bfs_need_seqno,
+   bf-bf_state.bfs_seqno_assigned,
+   SEQNO(bf-bf_state.bfs_seqno));
+   device_printf(sc-sc_dev,
%s: node %p: bf=%p: tid %d: txq_depth=%d, 
txq_aggr_depth=%d, sched=%d, paused=%d, 
hwq_depth=%d, incomp=%d, baw_head=%d, 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


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

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

Log:
  Setup fake MODINFO variables for octeon kernel

Modified:
  head/sys/mips/cavium/octeon_machdep.c

Modified: head/sys/mips/cavium/octeon_machdep.c
==
--- head/sys/mips/cavium/octeon_machdep.c   Thu Mar 22 21:48:36 2012
(r20)
+++ head/sys/mips/cavium/octeon_machdep.c   Fri Mar 23 00:01:09 2012
(r21)
@@ -363,6 +363,8 @@ platform_start(__register_t a0, __regist
 * entirely.
 */
 
+   mips_postboot_fixup();
+
/* Initialize pcpu stuff */
mips_pcpu0_init();
mips_timer_early_init(OCTEON_CLOCK_DEFAULT);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r233332 - head/sys/sys

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

Log:
  Add Octeon class and CPU type

Modified:
  head/sys/sys/pmc.h

Modified: head/sys/sys/pmc.h
==
--- head/sys/sys/pmc.h  Fri Mar 23 00:01:09 2012(r21)
+++ head/sys/sys/pmc.h  Fri Mar 23 00:03:26 2012(r22)
@@ -89,6 +89,7 @@
__PMC_CPU(INTEL_SANDYBRIDGE, 0x8D,   Intel Sandy Bridge) \
__PMC_CPU(INTEL_XSCALE, 0x100,  Intel XScale) \
__PMC_CPU(MIPS_24K, 0x200,  MIPS 24K)  \
+   __PMC_CPU(MIPS_OCTEON,  0x201,  Cavium Octeon)  \
__PMC_CPU(PPC_7450, 0x300,  PowerPC MPC7450)
 
 enum pmc_cputype {
@@ -116,7 +117,8 @@ enum pmc_cputype {
__PMC_CLASS(UCF)/* Intel Uncore fixed function */   \
__PMC_CLASS(UCP)/* Intel Uncore programmable */ \
__PMC_CLASS(XSCALE) /* Intel XScale counters */ \
-   __PMC_CLASS(MIPS24K)/* MIPS 24K */ \
+   __PMC_CLASS(MIPS24K)/* MIPS 24K */  \
+   __PMC_CLASS(OCTEON) /* Cavium Octeon */ \
__PMC_CLASS(PPC7450)/* Motorola MPC7450 class */
 
 enum pmc_class {
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r233333 - head/sys/dev/hwpmc

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

Log:
  Add list of Octeon's PMC counters obtained from cvmx-core.h

Modified:
  head/sys/dev/hwpmc/pmc_events.h

Modified: head/sys/dev/hwpmc/pmc_events.h
==
--- head/sys/dev/hwpmc/pmc_events.h Fri Mar 23 00:03:26 2012
(r22)
+++ head/sys/dev/hwpmc/pmc_events.h Fri Mar 23 00:04:09 2012
(r23)
@@ -3411,6 +3411,67 @@ __PMC_EV_ALIAS(IMPC_C0H_TRK_REQUEST.ALL
 #definePMC_EV_MIPS24K_FIRSTPMC_EV_MIPS24K_CYCLE
 #definePMC_EV_MIPS24K_LAST PMC_EV_MIPS24K_WBB_FULL_PIPELINE_STALLS
 
+/*
+ * Cavium Octeon counters. Obtained from cvmx-core.h
+ */
+#define __PMC_EV_OCTEON() \
+__PMC_EV(OCTEON, CLK) \
+__PMC_EV(OCTEON, ISSUE)   \
+__PMC_EV(OCTEON, RET) \
+__PMC_EV(OCTEON, NISSUE)  \
+__PMC_EV(OCTEON, SISSUE)  \
+__PMC_EV(OCTEON, DISSUE)  \
+__PMC_EV(OCTEON, IFI) \
+__PMC_EV(OCTEON, BR)  \
+__PMC_EV(OCTEON, BRMIS)   \
+__PMC_EV(OCTEON, J)   \
+__PMC_EV(OCTEON, JMIS)\
+__PMC_EV(OCTEON, REPLAY)  \
+__PMC_EV(OCTEON, IUNA)\
+__PMC_EV(OCTEON, TRAP)\
+__PMC_EV(OCTEON, UULOAD)  \
+__PMC_EV(OCTEON, UUSTORE) \
+__PMC_EV(OCTEON, ULOAD)   \
+__PMC_EV(OCTEON, USTORE)  \
+__PMC_EV(OCTEON, EC)  \
+__PMC_EV(OCTEON, MC)  \
+__PMC_EV(OCTEON, CC)  \
+__PMC_EV(OCTEON, CSRC)\
+__PMC_EV(OCTEON, CFETCH)  \
+__PMC_EV(OCTEON, CPREF)   \
+__PMC_EV(OCTEON, ICA) \
+__PMC_EV(OCTEON, II)  \
+__PMC_EV(OCTEON, IP)  \
+__PMC_EV(OCTEON, CIMISS)  \
+__PMC_EV(OCTEON, WBUF)\
+__PMC_EV(OCTEON, WDAT)\
+__PMC_EV(OCTEON, WBUFLD)  \
+__PMC_EV(OCTEON, WBUFFL)  \
+__PMC_EV(OCTEON, WBUFTR)  \
+__PMC_EV(OCTEON, BADD)\
+__PMC_EV(OCTEON, BADDL2)  \
+__PMC_EV(OCTEON, BFILL)   \
+__PMC_EV(OCTEON, DDIDS)   \
+__PMC_EV(OCTEON, IDIDS)   \
+__PMC_EV(OCTEON, DIDNA)   \
+__PMC_EV(OCTEON, LDS) \
+__PMC_EV(OCTEON, LMLDS)   \
+__PMC_EV(OCTEON, IOLDS)   \
+__PMC_EV(OCTEON, DMLDS)   \
+__PMC_EV(OCTEON, STS) \
+__PMC_EV(OCTEON, LMSTS)   \
+__PMC_EV(OCTEON, IOSTS)   \
+__PMC_EV(OCTEON, IOBDMA)  \
+__PMC_EV(OCTEON, DTLB)\
+__PMC_EV(OCTEON, DTLBAD)  \
+__PMC_EV(OCTEON, ITLB)\
+__PMC_EV(OCTEON, SYNC)\
+__PMC_EV(OCTEON, SYNCIOB) \
+__PMC_EV(OCTEON, SYNCW)
+
+#definePMC_EV_OCTEON_FIRST PMC_EV_OCTEON_CLK
+#definePMC_EV_OCTEON_LAST  PMC_EV_OCTEON_SYNCW
+
 #define __PMC_EV_PPC7450() \
__PMC_EV(PPC7450, CYCLE)\
__PMC_EV(PPC7450, INSTR_COMPLETED)  \
@@ -3677,6 +3738,8 @@ __PMC_EV_ALIAS(IMPC_C0H_TRK_REQUEST.ALL
__PMC_EV_XSCALE()   \
__PMC_EV_BLOCK(MIPS24K, 0x11300)\
__PMC_EV_MIPS24K()  \
+   __PMC_EV_BLOCK(OCTEON,  0x11400)\
+   __PMC_EV_OCTEON()   \
__PMC_EV_BLOCK(UCF, 0x12000)\
__PMC_EV_UCF()  \
__PMC_EV_BLOCK(UCP, 0x12080)\
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r233334 - head/sys/dev/hwpmc

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

Log:
  Add Octeon PMC hardware backend

Added:
  head/sys/dev/hwpmc/hwpmc_octeon.c   (contents, props changed)

Added: head/sys/dev/hwpmc/hwpmc_octeon.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/hwpmc/hwpmc_octeon.c   Fri Mar 23 00:09:27 2012
(r24)
@@ -0,0 +1,195 @@
+/*-
+ * Copyright (c) 2012 Oleksandr Tymoshenko go...@freebsd.org
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#include sys/cdefs.h
+__FBSDID($FreeBSD$);
+
+#include sys/param.h
+#include sys/systm.h
+#include sys/pmc.h
+#include sys/pmckern.h
+
+#include machine/cpu.h
+#include machine/cpufunc.h
+#include machine/pmc_mdep.h
+
+#include contrib/octeon-sdk/cvmx.h
+#include contrib/octeon-sdk/cvmx-core.h
+
+#defineOCTEON_PMC_CAPS (PMC_CAP_INTERRUPT | PMC_CAP_USER | \
+PMC_CAP_SYSTEM | PMC_CAP_EDGE |\
+PMC_CAP_THRESHOLD | PMC_CAP_READ | \
+PMC_CAP_WRITE | PMC_CAP_INVERT |   \
+PMC_CAP_QUALIFIER)
+
+const struct mips_event_code_map mips_event_codes[] =
+{
+{ PMC_EV_OCTEON_CLK, MIPS_CTR_ALL, CVMX_CORE_PERF_CLK },
+{ PMC_EV_OCTEON_ISSUE, MIPS_CTR_ALL, CVMX_CORE_PERF_ISSUE },
+{ PMC_EV_OCTEON_RET, MIPS_CTR_ALL, CVMX_CORE_PERF_RET },
+{ PMC_EV_OCTEON_NISSUE, MIPS_CTR_ALL, CVMX_CORE_PERF_NISSUE },
+{ PMC_EV_OCTEON_SISSUE, MIPS_CTR_ALL, CVMX_CORE_PERF_SISSUE },
+{ PMC_EV_OCTEON_DISSUE, MIPS_CTR_ALL, CVMX_CORE_PERF_DISSUE },
+{ PMC_EV_OCTEON_IFI, MIPS_CTR_ALL, CVMX_CORE_PERF_IFI },
+{ PMC_EV_OCTEON_BR, MIPS_CTR_ALL, CVMX_CORE_PERF_BR },
+{ PMC_EV_OCTEON_BRMIS, MIPS_CTR_ALL, CVMX_CORE_PERF_BRMIS },
+{ PMC_EV_OCTEON_J, MIPS_CTR_ALL, CVMX_CORE_PERF_J },
+{ PMC_EV_OCTEON_JMIS, MIPS_CTR_ALL, CVMX_CORE_PERF_JMIS },
+{ PMC_EV_OCTEON_REPLAY, MIPS_CTR_ALL, CVMX_CORE_PERF_REPLAY },
+{ PMC_EV_OCTEON_IUNA, MIPS_CTR_ALL, CVMX_CORE_PERF_IUNA },
+{ PMC_EV_OCTEON_TRAP, MIPS_CTR_ALL, CVMX_CORE_PERF_TRAP },
+{ PMC_EV_OCTEON_UULOAD, MIPS_CTR_ALL, CVMX_CORE_PERF_UULOAD },
+{ PMC_EV_OCTEON_UUSTORE, MIPS_CTR_ALL, CVMX_CORE_PERF_UUSTORE },
+{ PMC_EV_OCTEON_ULOAD, MIPS_CTR_ALL, CVMX_CORE_PERF_ULOAD },
+{ PMC_EV_OCTEON_USTORE, MIPS_CTR_ALL, CVMX_CORE_PERF_USTORE },
+{ PMC_EV_OCTEON_EC, MIPS_CTR_ALL, CVMX_CORE_PERF_EC },
+{ PMC_EV_OCTEON_MC, MIPS_CTR_ALL, CVMX_CORE_PERF_MC },
+{ PMC_EV_OCTEON_CC, MIPS_CTR_ALL, CVMX_CORE_PERF_CC },
+{ PMC_EV_OCTEON_CSRC, MIPS_CTR_ALL, CVMX_CORE_PERF_CSRC },
+{ PMC_EV_OCTEON_CFETCH, MIPS_CTR_ALL, CVMX_CORE_PERF_CFETCH },
+{ PMC_EV_OCTEON_CPREF, MIPS_CTR_ALL, CVMX_CORE_PERF_CPREF },
+{ PMC_EV_OCTEON_ICA, MIPS_CTR_ALL, CVMX_CORE_PERF_ICA },
+{ PMC_EV_OCTEON_II, MIPS_CTR_ALL, CVMX_CORE_PERF_II },
+{ PMC_EV_OCTEON_IP, MIPS_CTR_ALL, CVMX_CORE_PERF_IP },
+{ PMC_EV_OCTEON_CIMISS, MIPS_CTR_ALL, CVMX_CORE_PERF_CIMISS },
+{ PMC_EV_OCTEON_WBUF, MIPS_CTR_ALL, CVMX_CORE_PERF_WBUF },
+{ PMC_EV_OCTEON_WDAT, MIPS_CTR_ALL, CVMX_CORE_PERF_WDAT },
+{ PMC_EV_OCTEON_WBUFLD, MIPS_CTR_ALL, CVMX_CORE_PERF_WBUFLD },
+{ PMC_EV_OCTEON_WBUFFL, MIPS_CTR_ALL, CVMX_CORE_PERF_WBUFFL },
+{ PMC_EV_OCTEON_WBUFTR, MIPS_CTR_ALL, CVMX_CORE_PERF_WBUFTR },
+{ PMC_EV_OCTEON_BADD, MIPS_CTR_ALL, CVMX_CORE_PERF_BADD },
+{ PMC_EV_OCTEON_BADDL2, MIPS_CTR_ALL, CVMX_CORE_PERF_BADDL2 },
+{ PMC_EV_OCTEON_BFILL, MIPS_CTR_ALL, CVMX_CORE_PERF_BFILL },
+{ PMC_EV_OCTEON_DDIDS, 

svn commit: r233335 - head/lib/libpmc

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

Log:
  Add Octeon-related parts to libpmc

Modified:
  head/lib/libpmc/libpmc.c

Modified: head/lib/libpmc/libpmc.c
==
--- head/lib/libpmc/libpmc.cFri Mar 23 00:09:27 2012(r24)
+++ head/lib/libpmc/libpmc.cFri Mar 23 00:10:21 2012(r25)
@@ -152,6 +152,7 @@ PMC_CLASSDEP_TABLE(p5, P5);
 PMC_CLASSDEP_TABLE(p6, P6);
 PMC_CLASSDEP_TABLE(xscale, XSCALE);
 PMC_CLASSDEP_TABLE(mips24k, MIPS24K);
+PMC_CLASSDEP_TABLE(octeon, OCTEON);
 PMC_CLASSDEP_TABLE(ucf, UCF);
 PMC_CLASSDEP_TABLE(ppc7450, PPC7450);
 
@@ -227,6 +228,7 @@ PMC_MDEP_TABLE(p5, P5, PMC_CLASS_TSC);
 PMC_MDEP_TABLE(p6, P6, PMC_CLASS_TSC);
 PMC_MDEP_TABLE(xscale, XSCALE, PMC_CLASS_XSCALE);
 PMC_MDEP_TABLE(mips24k, MIPS24K, PMC_CLASS_MIPS24K);
+PMC_MDEP_TABLE(octeon, OCTEON, PMC_CLASS_OCTEON);
 PMC_MDEP_TABLE(ppc7450, PPC7450, PMC_CLASS_PPC7450);
 
 static const struct pmc_event_descr tsc_event_table[] =
@@ -280,6 +282,7 @@ PMC_CLASS_TABLE_DESC(xscale, XSCALE, xsc
 
 #if defined(__mips__)
 PMC_CLASS_TABLE_DESC(mips24k, MIPS24K, mips24k, mips);
+PMC_CLASS_TABLE_DESC(octeon, OCTEON, octeon, mips);
 #endif /* __mips__ */
 
 #if defined(__powerpc__)
@@ -2208,6 +2211,13 @@ static struct pmc_event_alias mips24k_al
EV_ALIAS(NULL, NULL)
 };
 
+static struct pmc_event_alias octeon_aliases[] = {
+   EV_ALIAS(instructions,RET),
+   EV_ALIAS(branches,BR),
+   EV_ALIAS(branch-mispredicts,  BRMIS),
+   EV_ALIAS(NULL, NULL)
+};
+
 #defineMIPS_KW_OS  os
 #defineMIPS_KW_USR usr
 #defineMIPS_KW_ANYTHREAD   anythread
@@ -2645,6 +2655,10 @@ pmc_event_names_of_class(enum pmc_class 
ev = mips24k_event_table;
count = PMC_EVENT_TABLE_SIZE(mips24k);
break;
+   case PMC_CLASS_OCTEON:
+   ev = octeon_event_table;
+   count = PMC_EVENT_TABLE_SIZE(octeon);
+   break;
case PMC_CLASS_PPC7450:
ev = ppc7450_event_table;
count = PMC_EVENT_TABLE_SIZE(ppc7450);
@@ -2864,6 +2878,10 @@ pmc_init(void)
PMC_MDEP_INIT(mips24k);
pmc_class_table[n] = mips24k_class_table_descr;
break;
+   case PMC_CPU_MIPS_OCTEON:
+   PMC_MDEP_INIT(octeon);
+   pmc_class_table[n] = octeon_class_table_descr;
+   break;
 #endif /* __mips__ */
 #if defined(__powerpc__)
case PMC_CPU_PPC_7450:
@@ -3019,6 +3037,9 @@ _pmc_name_of_event(enum pmc_event pe, en
ev = mips24k_event_table;
evfence = mips24k_event_table + PMC_EVENT_TABLE_SIZE(mips24k
 );
+   } else if (pe = PMC_EV_OCTEON_FIRST  pe = PMC_EV_OCTEON_LAST) {
+   ev = octeon_event_table;
+   evfence = octeon_event_table + PMC_EVENT_TABLE_SIZE(octeon);
} else if (pe = PMC_EV_PPC7450_FIRST  pe = PMC_EV_PPC7450_LAST) {
ev = ppc7450_event_table;
evfence = ppc7450_event_table + PMC_EVENT_TABLE_SIZE(ppc7450
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


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

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

Log:
  Add pseudo-device for handling PMC interrupts and link everything
  PMC-related to build

Added:
  head/sys/mips/cavium/octeon_pmc.c   (contents, props changed)
Modified:
  head/sys/mips/cavium/files.octeon1

Modified: head/sys/mips/cavium/files.octeon1
==
--- head/sys/mips/cavium/files.octeon1  Fri Mar 23 00:10:21 2012
(r25)
+++ head/sys/mips/cavium/files.octeon1  Fri Mar 23 00:11:54 2012
(r26)
@@ -8,6 +8,7 @@ mips/cavium/octeon_ds1337.c standard
 mips/cavium/octeon_ebt3000_cf.coptional cf
 mips/cavium/octeon_machdep.c   standard
 mips/cavium/octeon_mp.coptional smp
+mips/cavium/octeon_pmc.c   optional hwpmc
 mips/cavium/octeon_rtc.c   standard
 mips/cavium/uart_bus_octeonusart.c optional uart
 mips/cavium/uart_cpu_octeonusart.c optional uart
@@ -88,3 +89,6 @@ contrib/octeon-sdk/cvmx-thunder.c stand
 contrib/octeon-sdk/cvmx-twsi.c standard
 contrib/octeon-sdk/cvmx-warn.c standard
 contrib/octeon-sdk/octeon-model.c  standard
+
+# HWPMC 
+dev/hwpmc/hwpmc_octeon.c   optional hwpmc

Added: head/sys/mips/cavium/octeon_pmc.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/mips/cavium/octeon_pmc.c   Fri Mar 23 00:11:54 2012
(r26)
@@ -0,0 +1,141 @@
+/*-
+ * Copyright (c) 2012 Oleksandr Tymoshenko go...@freebsd.org
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#include sys/cdefs.h
+__FBSDID($FreeBSD$);
+
+#include sys/param.h
+#include sys/systm.h
+#include sys/bus.h
+#include sys/interrupt.h
+#include sys/kernel.h
+#include sys/module.h
+#include sys/rman.h
+#include sys/malloc.h
+#include sys/smp.h
+#include sys/pmc.h
+#include sys/pmckern.h
+
+#include machine/bus.h
+#include machine/intr_machdep.h
+
+#include contrib/octeon-sdk/cvmx.h
+#include mips/cavium/octeon_irq.h
+
+struct octeon_pmc_softc {
+   struct rman irq_rman;
+   struct resource *octeon_pmc_irq;
+};
+
+static voidocteon_pmc_identify(driver_t *, device_t);
+static int octeon_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)
+{
+   if (octeon_has_feature(OCTEON_FEATURE_USB))
+   BUS_ADD_CHILD(parent, 0, pmc, 0);
+}
+
+static int
+octeon_pmc_probe(device_t dev)
+{
+   if (device_get_unit(dev) != 0)
+   return (ENXIO);
+
+   device_set_desc(dev, Cavium Octeon Performance Counters);
+   return (0);
+}
+
+static int
+octeon_pmc_attach(device_t dev)
+{
+   struct octeon_pmc_softc *sc;
+   int error;
+   int rid;
+   uint64_t cvmctl;
+
+   sc = device_get_softc(dev);
+
+   rid = 0;
+   sc-octeon_pmc_irq = bus_alloc_resource(dev, 
+   SYS_RES_IRQ, rid, OCTEON_PMC_IRQ,
+   OCTEON_PMC_IRQ, 1, RF_ACTIVE);
+
+   if (sc-octeon_pmc_irq == NULL) {
+   device_printf(dev, could not allocate irq%d\n, 
OCTEON_PMC_IRQ);
+   return (ENXIO);
+   }
+
+   error = bus_setup_intr(dev, sc-octeon_pmc_irq, 
+   INTR_TYPE_MISC, octeon_pmc_intr, NULL, sc, NULL);
+   if (error != 0) 

svn commit: r233337 - in head: . lib tools/build/mk usr.bin

2012-03-22 Thread Stanislav Sedov
Author: stas
Date: Fri Mar 23 03:16:35 2012
New Revision: 27
URL: http://svn.freebsd.org/changeset/base/27

Log:
  - Do not build libcom_err and compile_et when kerberos is disabled.  They
depends on several heimdal libraries and not used by anything but kerberos
tools.

Modified:
  head/Makefile.inc1
  head/lib/Makefile
  head/tools/build/mk/OptionalObsoleteFiles.inc
  head/usr.bin/Makefile

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Fri Mar 23 00:11:54 2012(r26)
+++ head/Makefile.inc1  Fri Mar 23 03:16:35 2012(r27)
@@ -1254,7 +1254,7 @@ _prebuild_libs=   ${_kerberos5_lib_libasn1
${_kerberos5_lib_libhx509} ${_kerberos5_lib_libkrb5} \
${_kerberos5_lib_libroken} \
${_kerberos5_lib_libwind} \
-   lib/libbz2 lib/libcom_err lib/libcrypt \
+   lib/libbz2 ${_libcom_err} lib/libcrypt \
lib/libexpat \
${_lib_libgssapi} ${_lib_libipx} \
lib/libkiconv lib/libkvm lib/liblzma lib/libmd \
@@ -1341,6 +1341,7 @@ _kerberos5_lib_libheimntlm= kerberos5/li
 _kerberos5_lib_libheimsqlite= kerberos5/lib/libheimsqlite
 _kerberos5_lib_libheimipcc= kerberos5/lib/libheimipcc
 _kerberos5_lib_libwind= kerberos5/lib/libwind
+_libcom_err= lib/libcom_err
 .endif
 
 .if ${MK_NIS} != no

Modified: head/lib/Makefile
==
--- head/lib/Makefile   Fri Mar 23 00:11:54 2012(r26)
+++ head/lib/Makefile   Fri Mar 23 03:16:35 2012(r27)
@@ -33,7 +33,6 @@ SUBDIR_ORDERED=   ${_csu} \
libc \
libbsm \
libauditd \
-   libcom_err \
libcompiler_rt \
libcrypt \
libelf \
@@ -52,6 +51,10 @@ SUBDIR_ORDERED=  ${_csu} \
${_libcxxrt} \
${_libcplusplus}
 
+.if ${MK_KERBEROS_SUPPORT} != no
+SUBDIR_ORDERED+=   libcom_err
+.endif
+
 SUBDIR=${SUBDIR_ORDERED} \
libalias \
libarchive \

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==
--- head/tools/build/mk/OptionalObsoleteFiles.inc   Fri Mar 23 00:11:54 
2012(r26)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc   Fri Mar 23 03:16:35 
2012(r27)
@@ -2184,6 +2184,7 @@ OLD_FILES+=usr/share/man/man8/jls.8.gz
 .endif
 
 .if ${MK_KERBEROS} == no
+OLD_FILES+=usr/bin/compile_et
 OLD_FILES+=usr/bin/hxtool
 OLD_FILES+=usr/bin/kadmin
 OLD_FILES+=usr/bin/kdestroy
@@ -2266,6 +2267,11 @@ OLD_FILES+=usr/lib/libasn1.a
 OLD_FILES+=usr/lib/libasn1.so
 OLD_LIBS+=usr/lib/libasn1.so.10
 OLD_FILES+=usr/lib/libasn1_p.a
+OLD_FILES+=usr/lib/libcom_err.a
+OLD_FILES+=usr/lib/libcom_err.so
+OLD_LIBS+=usr/lib/libcom_err.so.5
+OLD_FILES+=usr/lib/libcom_err_p.a
+OLD_FILES+=usr/lib/libcom_err_p.a
 OLD_FILES+=usr/lib/libgssapi_krb5.a
 OLD_FILES+=usr/lib/libgssapi_krb5.so
 OLD_LIBS+=usr/lib/libgssapi_krb5.so.10

Modified: head/usr.bin/Makefile
==
--- head/usr.bin/Makefile   Fri Mar 23 00:11:54 2012(r26)
+++ head/usr.bin/Makefile   Fri Mar 23 03:16:35 2012(r27)
@@ -261,6 +261,10 @@ SUBDIR+=   csup
 SUBDIR+=   locate
 .endif
 
+.if ${MK_KERBEROS_SUPPORT} != no
+SUBDIR+=   compile_et
+.endif
+
 # XXX msgs?
 .if ${MK_MAIL} != no
 SUBDIR+=   biff
@@ -317,7 +321,6 @@ SUBDIR+=ul
 SUBDIR+=   ar
 SUBDIR+=   c89
 SUBDIR+=   c99
-SUBDIR+=   compile_et
 SUBDIR+=   ctags
 SUBDIR+=   file2c
 SUBDIR+=   gprof
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r233338 - head/tools/build/mk

2012-03-22 Thread Stanislav Sedov
Author: stas
Date: Fri Mar 23 03:43:04 2012
New Revision: 28
URL: http://svn.freebsd.org/changeset/base/28

Log:
  - Add new kerberos libraries to the list of optional obsolete files.

Modified:
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==
--- head/tools/build/mk/OptionalObsoleteFiles.inc   Fri Mar 23 03:16:35 
2012(r27)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc   Fri Mar 23 03:43:04 
2012(r28)
@@ -2265,7 +2265,7 @@ OLD_FILES+=usr/include/wind_err.h
 OLD_FILES+=usr/include/xdbm.h
 OLD_FILES+=usr/lib/libasn1.a
 OLD_FILES+=usr/lib/libasn1.so
-OLD_LIBS+=usr/lib/libasn1.so.10
+OLD_LIBS+=usr/lib/libasn1.so.11
 OLD_FILES+=usr/lib/libasn1_p.a
 OLD_FILES+=usr/lib/libcom_err.a
 OLD_FILES+=usr/lib/libcom_err.so
@@ -2288,10 +2288,18 @@ OLD_FILES+=usr/lib/libhdb.a
 OLD_FILES+=usr/lib/libhdb.so
 OLD_LIBS+=usr/lib/libhdb.so.11
 OLD_FILES+=usr/lib/libhdb_p.a
+OLD_FILES+=usr/lib/libheimbase.a
+OLD_FILES+=usr/lib/libheimbase.so
+OLD_LIBS+=usr/lib/libheimbase.so.11
+OLD_FILES+=usr/lib/libheimbase_p.a
 OLD_FILES+=usr/lib/libheimntlm.a
 OLD_FILES+=usr/lib/libheimntlm.so
 OLD_LIBS+=usr/lib/libheimntlm.so.11
 OLD_FILES+=usr/lib/libheimntlm_p.a
+OLD_FILES+=usr/lib/libheimsqlite.a
+OLD_FILES+=usr/lib/libheimsqlite.so
+OLD_LIBS+=usr/lib/libheimsqlite.so.11
+OLD_FILES+=usr/lib/libheimsqlite_p.a
 OLD_FILES+=usr/lib/libhx509.a
 OLD_FILES+=usr/lib/libhx509.so
 OLD_LIBS+=usr/lib/libhx509.so.11
@@ -2308,6 +2316,10 @@ OLD_FILES+=usr/lib/libkafs5.a
 OLD_FILES+=usr/lib/libkafs5.so
 OLD_LIBS+=usr/lib/libkafs5.so.11
 OLD_FILES+=usr/lib/libkafs5_p.a
+OLD_FILES+=usr/lib/libkdc.a
+OLD_FILES+=usr/lib/libkdc.so
+OLD_LIBS+=usr/lib/libkdc.so.11
+OLD_FILES+=usr/lib/libkdc_p.a
 OLD_FILES+=usr/lib/libkrb5.a
 OLD_FILES+=usr/lib/libkrb5.so
 OLD_LIBS+=usr/lib/libkrb5.so.11
@@ -2316,6 +2328,10 @@ OLD_FILES+=usr/lib/libroken.a
 OLD_FILES+=usr/lib/libroken.so
 OLD_LIBS+=usr/lib/libroken.so.11
 OLD_FILES+=usr/lib/libroken_p.a
+OLD_FILES+=usr/lib/libwind.a
+OLD_FILES+=usr/lib/libwind.so
+OLD_LIBS+=usr/lib/libwind.so.11
+OLD_FILES+=usr/lib/libwind_p.a
 OLD_FILES+=usr/lib/pam_krb5.so
 OLD_LIBS+=usr/lib/pam_krb5.so.5
 OLD_FILES+=usr/lib/pam_ksu.so
@@ -2341,10 +2357,18 @@ OLD_FILES+=usr/lib32/libhdb.a
 OLD_FILES+=usr/lib32/libhdb.so
 OLD_LIBS+=usr/lib32/libhdb.so.11
 OLD_FILES+=usr/lib32/libhdb_p.a
+OLD_FILES+=usr/lib32/libheimbase.a
+OLD_FILES+=usr/lib32/libheimbase.so
+OLD_LIBS+=usr/lib32/libheimbase.so.11
+OLD_FILES+=usr/lib32/libheimbase_p.a
 OLD_FILES+=usr/lib32/libheimntlm.a
 OLD_FILES+=usr/lib32/libheimntlm.so
 OLD_LIBS+=usr/lib32/libheimntlm.so.11
 OLD_FILES+=usr/lib32/libheimntlm_p.a
+OLD_FILES+=usr/lib32/libheimsqlite.a
+OLD_FILES+=usr/lib32/libheimsqlite.so
+OLD_LIBS+=usr/lib32/libheimsqlite.so.11
+OLD_FILES+=usr/lib32/libheimsqlite_p.a
 OLD_FILES+=usr/lib32/libhx509.a
 OLD_FILES+=usr/lib32/libhx509.so
 OLD_LIBS+=usr/lib32/libhx509.so.11
@@ -2361,6 +2385,10 @@ OLD_FILES+=usr/lib32/libkafs5.a
 OLD_FILES+=usr/lib32/libkafs5.so
 OLD_LIBS+=usr/lib32/libkafs5.so.11
 OLD_FILES+=usr/lib32/libkafs5_p.a
+OLD_FILES+=usr/lib32/libkdc.a
+OLD_FILES+=usr/lib32/libkdc.so
+OLD_LIBS+=usr/lib32/libkdc.so.11
+OLD_FILES+=usr/lib32/libkdc_p.a
 OLD_FILES+=usr/lib32/libkrb5.a
 OLD_FILES+=usr/lib32/libkrb5.so
 OLD_LIBS+=usr/lib32/libkrb5.so.11
@@ -2369,6 +2397,10 @@ OLD_FILES+=usr/lib32/libroken.a
 OLD_FILES+=usr/lib32/libroken.so
 OLD_LIBS+=usr/lib32/libroken.so.11
 OLD_FILES+=usr/lib32/libroken_p.a
+OLD_FILES+=usr/lib32/libwind.a
+OLD_FILES+=usr/lib32/libwind.so
+OLD_LIBS+=usr/lib32/libwind.so.11
+OLD_FILES+=usr/lib32/libwind_p.a
 OLD_FILES+=usr/lib32/pam_krb5.so
 OLD_LIBS+=usr/lib32/pam_krb5.so.5
 OLD_FILES+=usr/lib32/pam_ksu.so
@@ -3495,6 +3527,8 @@ OLD_FILES+=usr/lib/libgpib_p.a
 OLD_FILES+=usr/lib/libgssapi_krb5_p.a
 OLD_FILES+=usr/lib/libgssapi_p.a
 OLD_FILES+=usr/lib/libhdb_p.a
+OLD_FILES+=usr/lib/libheimbase_p.a
+OLD_FILES+=usr/lib/libheimsqlite_p.a
 OLD_FILES+=usr/lib/libhistory_p.a
 OLD_FILES+=usr/lib/libipsec_p.a
 OLD_FILES+=usr/lib/libipx_p.a
@@ -3502,6 +3536,7 @@ OLD_FILES+=usr/lib/libjail_p.a
 OLD_FILES+=usr/lib/libkadm5clnt_p.a
 OLD_FILES+=usr/lib/libkadm5srv_p.a
 OLD_FILES+=usr/lib/libkafs5_p.a
+OLD_FILES+=usr/lib/libkdc_p.a
 OLD_FILES+=usr/lib/libkiconv_p.a
 OLD_FILES+=usr/lib/libkrb5_p.a
 OLD_FILES+=usr/lib/libkvm_p.a
@@ -3554,6 +3589,7 @@ OLD_FILES+=usr/lib/libugidfw_p.a
 OLD_FILES+=usr/lib/libusbhid_p.a
 OLD_FILES+=usr/lib/libutil_p.a
 OLD_FILES+=usr/lib/libvgl_p.a
+OLD_FILES+=usr/lib/libwind_p.a
 OLD_FILES+=usr/lib/libwrap_p.a
 OLD_FILES+=usr/lib/liby_p.a
 OLD_FILES+=usr/lib/libypclnt_p.a
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org