Re: svn commit: r205307 - head/sys/i386/conf

2010-03-19 Thread b. f.
>Author: delphij
>Date: Fri Mar 19 01:16:53 2010
>New Revision: 205307
>URL: http://svn.freebsd.org/changeset/base/205307
>
>Log:
>  SSE is enabled by default about 5 years ago so there is no point pretending
>  that we support I486 and I586 CPUs in the GENERIC kernel, users wants these
>  support would have to build a custom kernel to explicitly disable SSE
>  anyways.

Could you please elaborate?  I thought that, though a bit less
efficient than using the non-default kernel option CPU_DISABLE_SSE for
machines without SSE, there is still the tunable hw.instruction_sse
that allows users with these machines to use GENERIC.  Is this
incorrect, or are there other problems for [45]86?

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


Re: svn commit: r205307 - head/sys/i386/conf

2010-03-19 Thread Paul Wootton

Julian Elischer wrote:

CPU: Geode(TM) Integrated Processor by AMD PCS (499.91-MHz 586-class CPU)
  Origin = "AuthenticAMD"  Id = 0x5a2  Stepping = 2
  Features=0x88a93d
  AMD Features=0xc040
real memory  = 536870912 (512 MB)
avail memory = 436473856 (416 MB)

I can no longer boot my home gateway off the cd
if I need the rescue disk...

that kinda sucks


Just a me too with a Geode and 512Mb RAM...
I wonder  how many people this will actually be affect? I bet there are 
quite a few Geode machines that run BSD.

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


svn commit: r205312 - head/usr.sbin/bsnmpd/modules/snmp_pf

2010-03-19 Thread Shteryana Shopova
Author: syrinx
Date: Fri Mar 19 09:53:25 2010
New Revision: 205312
URL: http://svn.freebsd.org/changeset/base/205312

Log:
  Make sure the snmp_pf module will first refresh its entires if necessary,
  then find a specific entry, and get the requested value. So far, it found
  the specific entry, refreshed the entry list if necessary, and got the
  requested value from the found entry. The problem is that refreshing nukes
  all old entries and replaces them with new ones and the obtained entry
  pointer was no longer valid after the refresh.
  
  Reviewed by:  bz, philip
  MFC after:1 week

Modified:
  head/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c

Modified: head/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c
==
--- head/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c  Fri Mar 19 09:20:06 
2010(r205311)
+++ head/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c  Fri Mar 19 09:53:25 
2010(r205312)
@@ -534,6 +534,9 @@ pf_iftable(struct snmp_context __unused 
asn_subid_t which = val->var.subs[sub - 1];
struct pfi_entry *e = NULL;
 
+   if ((time(NULL) - pfi_table_age) > PFI_TABLE_MAXAGE)
+   pfi_refresh();
+
switch (op) {
case SNMP_OP_SET:
return (SNMP_ERR_NOT_WRITEABLE);
@@ -557,9 +560,6 @@ pf_iftable(struct snmp_context __unused 
abort();
}
 
-   if ((time(NULL) - pfi_table_age) > PFI_TABLE_MAXAGE)
-   pfi_refresh();
-
switch (which) {
case LEAF_pfInterfacesIfDescr:
return (string_get(val, e->pfi.pfik_name, -1));
@@ -684,6 +684,9 @@ pf_tbltable(struct snmp_context __unused
asn_subid_t which = val->var.subs[sub - 1];
struct pft_entry *e = NULL;
 
+   if ((time(NULL) - pft_table_age) > PFT_TABLE_MAXAGE)
+   pft_refresh();
+
switch (op) {
case SNMP_OP_SET:
return (SNMP_ERR_NOT_WRITEABLE);
@@ -707,9 +710,6 @@ pf_tbltable(struct snmp_context __unused
abort();
}
 
-   if ((time(NULL) - pft_table_age) > PFT_TABLE_MAXAGE)
-   pft_refresh();
-
switch (which) {
case LEAF_pfTablesTblDescr:
return (string_get(val, e->pft.pfrts_name, -1));
@@ -842,6 +842,9 @@ pf_altqq(struct snmp_context __unused *c
   return (SNMP_ERR_NOERROR);
}
 
+   if ((time(NULL) - pfq_table_age) > PFQ_TABLE_MAXAGE)
+   pfq_refresh();
+
switch (op) {
case SNMP_OP_SET:
return (SNMP_ERR_NOT_WRITEABLE);
@@ -865,9 +868,6 @@ pf_altqq(struct snmp_context __unused *c
abort();
}
 
-   if ((time(NULL) - pfq_table_age) > PFQ_TABLE_MAXAGE)
-   pfq_refresh();
-
switch (which) {
case LEAF_pfAltqQueueDescr:
return (string_get(val, e->altq.qname, -1));
@@ -930,6 +930,9 @@ pf_lbltable(struct snmp_context __unused
asn_subid_t which = val->var.subs[sub - 1];
struct pfl_entry *e = NULL;
 
+   if ((time(NULL) - pfl_table_age) > PFL_TABLE_MAXAGE)
+   pfl_refresh();
+
switch (op) {
case SNMP_OP_SET:
return (SNMP_ERR_NOT_WRITEABLE);
@@ -953,9 +956,6 @@ pf_lbltable(struct snmp_context __unused
abort();
}
 
-   if ((time(NULL) - pfl_table_age) > PFL_TABLE_MAXAGE)
-   pfl_refresh();
-
switch (which) {
case LEAF_pfLabelsLblName:
return (string_get(val, e->name, -1));
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r205316 - head/sys/kern

2010-03-19 Thread Konstantin Belousov
Author: kib
Date: Fri Mar 19 10:41:32 2010
New Revision: 205316
URL: http://svn.freebsd.org/changeset/base/205316

Log:
  Fix two style issues.
  
  MFC after:2 weeks

Modified:
  head/sys/kern/uipc_syscalls.c

Modified: head/sys/kern/uipc_syscalls.c
==
--- head/sys/kern/uipc_syscalls.c   Fri Mar 19 10:33:45 2010
(r205315)
+++ head/sys/kern/uipc_syscalls.c   Fri Mar 19 10:41:32 2010
(r205316)
@@ -2528,7 +2528,7 @@ sctp_generic_sendmsg_iov(td, uap)
goto sctp_bad;
 #endif /* MAC */
 
-   auio.uio_iov =  iov;
+   auio.uio_iov = iov;
auio.uio_iovcnt = uap->iovlen;
auio.uio_segflg = UIO_USERSPACE;
auio.uio_rw = UIO_WRITE;
@@ -2638,7 +2638,7 @@ sctp_generic_recvmsg(td, uap)
} else {
fromlen = 0;
}
-   if(uap->msg_flags) {
+   if (uap->msg_flags) {
error = copyin(uap->msg_flags, &msg_flags, sizeof (int));
if (error) {
goto out;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r205317 - head/sys/kern

2010-03-19 Thread Konstantin Belousov
Author: kib
Date: Fri Mar 19 10:44:02 2010
New Revision: 205317
URL: http://svn.freebsd.org/changeset/base/205317

Log:
  Remove dead statement.
  
  Reviewed by:  tuexen
  MFC after:2 weeks

Modified:
  head/sys/kern/uipc_syscalls.c

Modified: head/sys/kern/uipc_syscalls.c
==
--- head/sys/kern/uipc_syscalls.c   Fri Mar 19 10:41:32 2010
(r205316)
+++ head/sys/kern/uipc_syscalls.c   Fri Mar 19 10:44:02 2010
(r205317)
@@ -2625,7 +2625,6 @@ sctp_generic_recvmsg(td, uap)
error = mac_socket_check_receive(td->td_ucred, so);
if (error) {
goto out;
-   return (error);
}
 #endif /* MAC */
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r205318 - head/sys/kern

2010-03-19 Thread Konstantin Belousov
Author: kib
Date: Fri Mar 19 10:46:54 2010
New Revision: 205318
URL: http://svn.freebsd.org/changeset/base/205318

Log:
  Properly handle compat32 calls to sctp generic sendmsd/recvmsg functions that
  take iov.
  
  Reviewed by:  tuexen
  MFC after:2 weeks

Modified:
  head/sys/kern/uipc_syscalls.c

Modified: head/sys/kern/uipc_syscalls.c
==
--- head/sys/kern/uipc_syscalls.c   Fri Mar 19 10:44:02 2010
(r205317)
+++ head/sys/kern/uipc_syscalls.c   Fri Mar 19 10:46:54 2010
(r205318)
@@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -69,6 +70,9 @@ __FBSDID("$FreeBSD$");
 #ifdef KTRACE
 #include 
 #endif
+#ifdef COMPAT_FREEBSD32
+#include 
+#endif
 
 #include 
 
@@ -2513,7 +2517,13 @@ sctp_generic_sendmsg_iov(td, uap)
if (error)
goto sctp_bad1;
 
-   error = copyiniov(uap->iov, uap->iovlen, &iov, EMSGSIZE);
+#ifdef COMPAT_FREEBSD32
+   if (SV_CURPROC_FLAG(SV_ILP32))
+   error = freebsd32_copyiniov((struct iovec32 *)uap->iov,
+   uap->iovlen, &iov, EMSGSIZE);
+   else
+#endif
+   error = copyiniov(uap->iov, uap->iovlen, &iov, EMSGSIZE);
if (error)
goto sctp_bad1;
 #ifdef KTRACE
@@ -2615,10 +2625,15 @@ sctp_generic_recvmsg(td, uap)
if (error) {
return (error);
}
-   error = copyiniov(uap->iov, uap->iovlen, &iov, EMSGSIZE);
-   if (error) {
+#ifdef COMPAT_FREEBSD32
+   if (SV_CURPROC_FLAG(SV_ILP32))
+   error = freebsd32_copyiniov((struct iovec32 *)uap->iov,
+   uap->iovlen, &iov, EMSGSIZE);
+   else
+#endif
+   error = copyiniov(uap->iov, uap->iovlen, &iov, EMSGSIZE);
+   if (error)
goto out1;
-   }
 
so = fp->f_data;
 #ifdef MAC
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2010-03-19 Thread Konstantin Belousov
Author: kib
Date: Fri Mar 19 10:49:03 2010
New Revision: 205319
URL: http://svn.freebsd.org/changeset/base/205319

Log:
  Make freebsd32_copyiniov() available outside of freebsd32_misc.
  
  MFC after:2 weeks

Modified:
  head/sys/compat/freebsd32/freebsd32_misc.c
  head/sys/compat/freebsd32/freebsd32_util.h

Modified: head/sys/compat/freebsd32/freebsd32_misc.c
==
--- head/sys/compat/freebsd32/freebsd32_misc.c  Fri Mar 19 10:46:54 2010
(r205318)
+++ head/sys/compat/freebsd32/freebsd32_misc.c  Fri Mar 19 10:49:03 2010
(r205319)
@@ -873,7 +873,7 @@ freebsd32_pwritev(struct thread *td, str
return (error);
 }
 
-static int
+int
 freebsd32_copyiniov(struct iovec32 *iovp32, u_int iovcnt, struct iovec **iovp,
 int error)
 {

Modified: head/sys/compat/freebsd32/freebsd32_util.h
==
--- head/sys/compat/freebsd32/freebsd32_util.h  Fri Mar 19 10:46:54 2010
(r205318)
+++ head/sys/compat/freebsd32/freebsd32_util.h  Fri Mar 19 10:49:03 2010
(r205319)
@@ -84,5 +84,8 @@ intsyscall32_deregister(int *offset,
 intsyscall32_module_handler(struct module *mod, int what, void *arg);
 
 register_t *freebsd32_copyout_strings(struct image_params *imgp);
+struct iovec32;
+intfreebsd32_copyiniov(struct iovec32 *iovp, u_int iovcnt,
+   struct iovec **iov, int error);
 
 #endif /* !_COMPAT_FREEBSD32_FREEBSD32_UTIL_H_ */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r205319 - head/sys/compat/freebsd32

2010-03-19 Thread Kostik Belousov
On Fri, Mar 19, 2010 at 10:49:03AM +, Konstantin Belousov wrote:
> Author: kib
> Date: Fri Mar 19 10:49:03 2010
> New Revision: 205319
> URL: http://svn.freebsd.org/changeset/base/205319
> 
> Log:
>   Make freebsd32_copyiniov() available outside of freebsd32_misc.
>   
>   MFC after:  2 weeks

This has to be committed before r205318, I am sorry for messing it.


pgpPk0ijzOD9h.pgp
Description: PGP signature


svn commit: r205320 - in head/sys: compat/freebsd32 sys

2010-03-19 Thread Konstantin Belousov
Author: kib
Date: Fri Mar 19 10:52:54 2010
New Revision: 205320
URL: http://svn.freebsd.org/changeset/base/205320

Log:
  FOr SYSCALL_MODULE_HELPER, use "sys/" module name.
  FOr SYSCALL32_MODULE_HELPER, use "sys32/" module name.
  This avoids modules name conflict when compat32 syscall does not
  need shims.
  
  Note that SYSCALL_MODULE_HELPER is going to be unused in the tree by
  several next commits.
  
  Suggested by: jhb
  MFC after:2 weeks

Modified:
  head/sys/compat/freebsd32/freebsd32_util.h
  head/sys/sys/sysent.h

Modified: head/sys/compat/freebsd32/freebsd32_util.h
==
--- head/sys/compat/freebsd32/freebsd32_util.h  Fri Mar 19 10:49:03 2010
(r205319)
+++ head/sys/compat/freebsd32/freebsd32_util.h  Fri Mar 19 10:52:54 2010
(r205320)
@@ -61,7 +61,7 @@ static struct syscall_module_data name##
 }; \
\
 static moduledata_t name##32_mod = {   \
-   #name,  \
+   "sys32/" #name, \
syscall32_module_handler,   \
&name##_syscall32_mod   \
 }; \

Modified: head/sys/sys/sysent.h
==
--- head/sys/sys/sysent.h   Fri Mar 19 10:49:03 2010(r205319)
+++ head/sys/sys/sysent.h   Fri Mar 19 10:52:54 2010(r205320)
@@ -149,7 +149,7 @@ static struct syscall_module_data name##
 }; \
\
 static moduledata_t name##_mod = { \
-   #name,  \
+   "sys/" #name,   \
syscall_module_handler, \
&name##_syscall_mod \
 }; \
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r205321 - in head/sys: compat/freebsd32 kern sys

2010-03-19 Thread Konstantin Belousov
Author: kib
Date: Fri Mar 19 10:56:30 2010
New Revision: 205321
URL: http://svn.freebsd.org/changeset/base/205321

Log:
  Introduce SYSCALL_INIT_HELPER and SYSCALL32_INIT_HELPER macros and
  neccessary support functions to allow registering dynamically loaded
  syscalls from the MOD_LOAD handlers. Helpers handle registration
  failures semi-automatically.
  
  Reviewed by:  jhb
  MFC after:2 weeks

Modified:
  head/sys/compat/freebsd32/freebsd32_misc.c
  head/sys/compat/freebsd32/freebsd32_util.h
  head/sys/kern/kern_syscalls.c
  head/sys/sys/sysent.h

Modified: head/sys/compat/freebsd32/freebsd32_misc.c
==
--- head/sys/compat/freebsd32/freebsd32_misc.c  Fri Mar 19 10:52:54 2010
(r205320)
+++ head/sys/compat/freebsd32/freebsd32_misc.c  Fri Mar 19 10:56:30 2010
(r205321)
@@ -3084,6 +3084,36 @@ syscall32_module_handler(struct module *
}
 }
 
+int
+syscall32_helper_register(struct syscall_helper_data *sd)
+{
+   struct syscall_helper_data *sd1;
+   int error;
+
+   for (sd1 = sd; sd1->syscall_no != NO_SYSCALL; sd1++) {
+   error = syscall32_register(&sd1->syscall_no, &sd1->new_sysent,
+   &sd1->old_sysent);
+   if (error != 0) {
+   syscall32_helper_unregister(sd);
+   return (error);
+   }
+   sd1->registered = 1;
+   }
+   return (0);
+}
+
+int
+syscall32_helper_unregister(struct syscall_helper_data *sd)
+{
+   struct syscall_helper_data *sd1;
+
+   for (sd1 = sd; sd1->registered != 0; sd1++) {
+   syscall32_deregister(&sd1->syscall_no, &sd1->old_sysent);
+   sd1->registered = 0;
+   }
+   return (0);
+}
+
 register_t *
 freebsd32_copyout_strings(struct image_params *imgp)
 {

Modified: head/sys/compat/freebsd32/freebsd32_util.h
==
--- head/sys/compat/freebsd32/freebsd32_util.h  Fri Mar 19 10:52:54 2010
(r205320)
+++ head/sys/compat/freebsd32/freebsd32_util.h  Fri Mar 19 10:56:30 2010
(r205321)
@@ -78,10 +78,21 @@ SYSCALL32_MODULE(syscallname,   
 & syscallname##_syscall32, & syscallname##_sysent32,\
 NULL, NULL);
 
+#define SYSCALL32_INIT_HELPER(syscallname) {   \
+.new_sysent = {\
+   .sy_narg = (sizeof(struct syscallname ## _args )\
+   / sizeof(register_t)),  \
+   .sy_call = (sy_call_t *)& syscallname,  \
+}, \
+.syscall_no = FREEBSD32_SYS_##syscallname  \
+}
+
 intsyscall32_register(int *offset, struct sysent *new_sysent,
struct sysent *old_sysent);
 intsyscall32_deregister(int *offset, struct sysent *old_sysent);
 intsyscall32_module_handler(struct module *mod, int what, void *arg);
+intsyscall32_helper_register(struct syscall_helper_data *sd);
+intsyscall32_helper_unregister(struct syscall_helper_data *sd);
 
 register_t *freebsd32_copyout_strings(struct image_params *imgp);
 struct iovec32;

Modified: head/sys/kern/kern_syscalls.c
==
--- head/sys/kern/kern_syscalls.c   Fri Mar 19 10:52:54 2010
(r205320)
+++ head/sys/kern/kern_syscalls.c   Fri Mar 19 10:56:30 2010
(r205321)
@@ -135,3 +135,33 @@ syscall_module_handler(struct module *mo
else
return (0);
 }
+
+int
+syscall_helper_register(struct syscall_helper_data *sd)
+{
+   struct syscall_helper_data *sd1;
+   int error;
+
+   for (sd1 = sd; sd1->syscall_no != NO_SYSCALL; sd1++) {
+   error = syscall_register(&sd1->syscall_no, &sd1->new_sysent,
+   &sd1->old_sysent);
+   if (error != 0) {
+   syscall_helper_unregister(sd);
+   return (error);
+   }
+   sd1->registered = 1;
+   }
+   return (0);
+}
+
+int
+syscall_helper_unregister(struct syscall_helper_data *sd)
+{
+   struct syscall_helper_data *sd1;
+
+   for (sd1 = sd; sd1->registered != 0; sd1++) {
+   syscall_deregister(&sd1->syscall_no, &sd1->old_sysent);
+   sd1->registered = 0;
+   }
+   return (0);
+}

Modified: head/sys/sys/sysent.h
==
--- head/sys/sys/sysent.h   Fri Mar 19 10:52:54 2010(r205320)
+++ head/sys/sys/sysent.h   Fri Mar 19 10:56:30 2010(r205321)
@@ -166,10 +166,34 @@ SYSCALL_MODULE(syscallname,   
\
(sysent[SYS_##syscallname].sy_call != (sy_call_t *)lkmnosys &&  \
sysent[SYS_##syscallname].sy_call != (sy_call_t *)lkmressys)
 
+/*
+ * Sysc

svn commit: r205322 - in head/sys: compat/freebsd32 kern

2010-03-19 Thread Konstantin Belousov
Author: kib
Date: Fri Mar 19 11:01:51 2010
New Revision: 205322
URL: http://svn.freebsd.org/changeset/base/205322

Log:
  Move SysV IPC freebsd32 compat shims helpers from freebsd32_misc.c to
  sysv_ipc.c.
  
  Reviewed by:  jhb
  MFC after:2 weeks

Modified:
  head/sys/compat/freebsd32/freebsd32_ipc.h
  head/sys/compat/freebsd32/freebsd32_misc.c
  head/sys/kern/sysv_ipc.c

Modified: head/sys/compat/freebsd32/freebsd32_ipc.h
==
--- head/sys/compat/freebsd32/freebsd32_ipc.h   Fri Mar 19 10:56:30 2010
(r205321)
+++ head/sys/compat/freebsd32/freebsd32_ipc.h   Fri Mar 19 11:01:51 2010
(r205322)
@@ -147,6 +147,14 @@ struct shmid_ds32_old {
int32_t shm_ctime;
uint32_tshm_internal;
 };
+
+void   freebsd32_ipcperm_old_in(struct ipc_perm32_old *ip32,
+   struct ipc_perm *ip);
+void   freebsd32_ipcperm_old_out(struct ipc_perm *ip,
+   struct ipc_perm32_old *ip32);
 #endif
 
+void   freebsd32_ipcperm_in(struct ipc_perm32 *ip32, struct ipc_perm *ip);
+void   freebsd32_ipcperm_out(struct ipc_perm *ip, struct ipc_perm32 *ip32);
+
 #endif /* !_COMPAT_FREEBSD32_FREEBSD32_IPC_H_ */

Modified: head/sys/compat/freebsd32/freebsd32_misc.c
==
--- head/sys/compat/freebsd32/freebsd32_misc.c  Fri Mar 19 10:56:30 2010
(r205321)
+++ head/sys/compat/freebsd32/freebsd32_misc.c  Fri Mar 19 11:01:51 2010
(r205322)
@@ -1400,60 +1400,6 @@ freebsd4_freebsd32_fhstatfs(struct threa
 }
 #endif
 
-#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \
-defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7)
-static void
-freebsd32_ipcperm_old_in(struct ipc_perm32_old *ip32, struct ipc_perm *ip)
-{
-
-   CP(*ip32, *ip, cuid);
-   CP(*ip32, *ip, cgid);
-   CP(*ip32, *ip, uid);
-   CP(*ip32, *ip, gid);
-   CP(*ip32, *ip, mode);
-   CP(*ip32, *ip, seq);
-   CP(*ip32, *ip, key);
-}
-
-static void
-freebsd32_ipcperm_old_out(struct ipc_perm *ip, struct ipc_perm32_old *ip32)
-{
-
-   CP(*ip, *ip32, cuid);
-   CP(*ip, *ip32, cgid);
-   CP(*ip, *ip32, uid);
-   CP(*ip, *ip32, gid);
-   CP(*ip, *ip32, mode);
-   CP(*ip, *ip32, seq);
-   CP(*ip, *ip32, key);
-}
-#endif
-
-static void
-freebsd32_ipcperm_in(struct ipc_perm32 *ip32, struct ipc_perm *ip)
-{
-
-   CP(*ip32, *ip, cuid);
-   CP(*ip32, *ip, cgid);
-   CP(*ip32, *ip, uid);
-   CP(*ip32, *ip, gid);
-   CP(*ip32, *ip, mode);
-   CP(*ip32, *ip, seq);
-   CP(*ip32, *ip, key);
-}
-
-static void
-freebsd32_ipcperm_out(struct ipc_perm *ip, struct ipc_perm32 *ip32)
-{
-
-   CP(*ip, *ip32, cuid);
-   CP(*ip, *ip32, cgid);
-   CP(*ip, *ip32, uid);
-   CP(*ip, *ip32, gid);
-   CP(*ip, *ip32, mode);
-   CP(*ip, *ip32, seq);
-   CP(*ip, *ip32, key);
-}
 
 int
 freebsd32_semsys(struct thread *td, struct freebsd32_semsys_args *uap)

Modified: head/sys/kern/sysv_ipc.c
==
--- head/sys/kern/sysv_ipc.cFri Mar 19 10:56:30 2010(r205321)
+++ head/sys/kern/sysv_ipc.cFri Mar 19 11:01:51 2010(r205322)
@@ -178,3 +178,69 @@ ipcperm_new2old(struct ipc_perm *new, st
old->key = new->key;
 }
 #endif
+
+#ifdef COMPAT_FREEBSD32
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \
+defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7)
+void
+freebsd32_ipcperm_old_in(struct ipc_perm32_old *ip32, struct ipc_perm *ip)
+{
+
+   CP(*ip32, *ip, cuid);
+   CP(*ip32, *ip, cgid);
+   CP(*ip32, *ip, uid);
+   CP(*ip32, *ip, gid);
+   CP(*ip32, *ip, mode);
+   CP(*ip32, *ip, seq);
+   CP(*ip32, *ip, key);
+}
+
+void
+freebsd32_ipcperm_old_out(struct ipc_perm *ip, struct ipc_perm32_old *ip32)
+{
+
+   CP(*ip, *ip32, cuid);
+   CP(*ip, *ip32, cgid);
+   CP(*ip, *ip32, uid);
+   CP(*ip, *ip32, gid);
+   CP(*ip, *ip32, mode);
+   CP(*ip, *ip32, seq);
+   CP(*ip, *ip32, key);
+}
+#endif
+
+void
+freebsd32_ipcperm_in(struct ipc_perm32 *ip32, struct ipc_perm *ip)
+{
+
+   CP(*ip32, *ip, cuid);
+   CP(*ip32, *ip, cgid);
+   CP(*ip32, *ip, uid);
+   CP(*ip32, *ip, gid);
+   CP(*ip32, *ip, mode);
+   CP(*ip32, *ip, seq);
+   CP(*ip32, *ip, key);
+}
+
+void
+freebsd32_ipcperm_out(struct ipc_perm *ip, struct ipc_perm32 *ip32)
+{
+
+   CP(*ip, *ip32, cuid);
+   CP(*ip, *ip32, cgid);
+   CP(*ip, *ip32, uid);
+   CP(*ip, *ip32, gid);
+   CP(*ip, *ip32, mode);
+   CP(*ip, *ip32, seq);
+   CP(*ip, *ip32, key);
+}
+#endif
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to 

svn commit: r205323 - in head/sys: compat/freebsd32 kern

2010-03-19 Thread Konstantin Belousov
Author: kib
Date: Fri Mar 19 11:04:42 2010
New Revision: 205323
URL: http://svn.freebsd.org/changeset/base/205323

Log:
  Move SysV IPC freebsd32 compat shims from freebsd32_misc.c to corresponding
  sysv_{msg,sem,shm}.c files.
  
  Mark SysV IPC freebsd32 syscalls as NOSTD and add required
  SYSCALL_INIT_HELPER/SYSCALL32_INIT_HELPERs to provide auto
  register/unregister on module load.
  
  This makes COMPAT_FREEBSD32 functional with SysV IPC compiled and loaded
  as modules.
  
  Reviewed by:  jhb
  MFC after:2 weeks

Modified:
  head/sys/compat/freebsd32/freebsd32_misc.c
  head/sys/compat/freebsd32/syscalls.master
  head/sys/kern/sysv_msg.c
  head/sys/kern/sysv_sem.c
  head/sys/kern/sysv_shm.c

Modified: head/sys/compat/freebsd32/freebsd32_misc.c
==
--- head/sys/compat/freebsd32/freebsd32_misc.c  Fri Mar 19 11:01:51 2010
(r205322)
+++ head/sys/compat/freebsd32/freebsd32_misc.c  Fri Mar 19 11:04:42 2010
(r205323)
@@ -1402,536 +1402,6 @@ freebsd4_freebsd32_fhstatfs(struct threa
 
 
 int
-freebsd32_semsys(struct thread *td, struct freebsd32_semsys_args *uap)
-{
-
-#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \
-defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7)
-   switch (uap->which) {
-   case 0:
-   return (freebsd7_freebsd32_semctl(td,
-   (struct freebsd7_freebsd32_semctl_args *)&uap->a2));
-   default:
-   return (semsys(td, (struct semsys_args *)uap));
-   }
-#else
-   return (nosys(td, NULL));
-#endif
-}
-
-#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \
-defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7)
-int
-freebsd7_freebsd32_semctl(struct thread *td,
-struct freebsd7_freebsd32_semctl_args *uap)
-{
-   struct semid_ds32_old dsbuf32;
-   struct semid_ds dsbuf;
-   union semun semun;
-   union semun32 arg;
-   register_t rval;
-   int error;
-
-   switch (uap->cmd) {
-   case SEM_STAT:
-   case IPC_SET:
-   case IPC_STAT:
-   case GETALL:
-   case SETVAL:
-   case SETALL:
-   error = copyin(uap->arg, &arg, sizeof(arg));
-   if (error)
-   return (error); 
-   break;
-   }
-
-   switch (uap->cmd) {
-   case SEM_STAT:
-   case IPC_STAT:
-   semun.buf = &dsbuf;
-   break;
-   case IPC_SET:
-   error = copyin(PTRIN(arg.buf), &dsbuf32, sizeof(dsbuf32));
-   if (error)
-   return (error);
-   freebsd32_ipcperm_old_in(&dsbuf32.sem_perm, &dsbuf.sem_perm);
-   PTRIN_CP(dsbuf32, dsbuf, sem_base);
-   CP(dsbuf32, dsbuf, sem_nsems);
-   CP(dsbuf32, dsbuf, sem_otime);
-   CP(dsbuf32, dsbuf, sem_ctime);
-   semun.buf = &dsbuf;
-   break;
-   case GETALL:
-   case SETALL:
-   semun.array = PTRIN(arg.array);
-   break;
-   case SETVAL:
-   semun.val = arg.val;
-   break;
-   }
-
-   error = kern_semctl(td, uap->semid, uap->semnum, uap->cmd, &semun,
-   &rval);
-   if (error)
-   return (error);
-
-   switch (uap->cmd) {
-   case SEM_STAT:
-   case IPC_STAT:
-   bzero(&dsbuf32, sizeof(dsbuf32));
-   freebsd32_ipcperm_old_out(&dsbuf.sem_perm, &dsbuf32.sem_perm);
-   PTROUT_CP(dsbuf, dsbuf32, sem_base);
-   CP(dsbuf, dsbuf32, sem_nsems);
-   CP(dsbuf, dsbuf32, sem_otime);
-   CP(dsbuf, dsbuf32, sem_ctime);
-   error = copyout(&dsbuf32, PTRIN(arg.buf), sizeof(dsbuf32));
-   break;
-   }
-
-   if (error == 0)
-   td->td_retval[0] = rval;
-   return (error);
-}
-#endif
-
-int
-freebsd32_semctl(struct thread *td, struct freebsd32_semctl_args *uap)
-{
-   struct semid_ds32 dsbuf32;
-   struct semid_ds dsbuf;
-   union semun semun;
-   union semun32 arg;
-   register_t rval;
-   int error;
-
-   switch (uap->cmd) {
-   case SEM_STAT:
-   case IPC_SET:
-   case IPC_STAT:
-   case GETALL:
-   case SETVAL:
-   case SETALL:
-   error = copyin(uap->arg, &arg, sizeof(arg));
-   if (error)
-   return (error); 
-   break;
-   }
-
-   switch (uap->cmd) {
-   case SEM_STAT:
-   case IPC_STAT:
-   semun.buf = &dsbuf;
-   break;
-   case IPC_SET:
-   error = copyin(PTRIN(arg.buf), &dsbuf32, sizeof(dsbuf32));
-   if (error)
-   return (error);
-   freebsd32_ipcperm_in(&dsbuf32.sem_perm, &dsbuf.sem_perm);
-   PTRIN_CP(dsbuf32, dsbuf, sem_base);
-   CP(dsbuf32, dsbuf, sem_nsems);
-   CP(d

svn commit: r205324 - in head/sys: compat/freebsd32 kern

2010-03-19 Thread Konstantin Belousov
Author: kib
Date: Fri Mar 19 11:08:43 2010
New Revision: 205324
URL: http://svn.freebsd.org/changeset/base/205324

Log:
  Implement compat32 shims for ksem syscalls.
  
  Reviewed by:  jhb
  MFC after:2 weeks

Modified:
  head/sys/compat/freebsd32/syscalls.master
  head/sys/kern/uipc_sem.c

Modified: head/sys/compat/freebsd32/syscalls.master
==
--- head/sys/compat/freebsd32/syscalls.master   Fri Mar 19 11:04:42 2010
(r205323)
+++ head/sys/compat/freebsd32/syscalls.master   Fri Mar 19 11:08:43 2010
(r205324)
@@ -697,16 +697,19 @@
 398AUE_FHSTATFSNOPROTO { int fhstatfs(const struct fhandle *u_fhp, \
struct statfs *buf); }
 399AUE_NULLUNIMPL  nosys
-; XXX implement these?
-400AUE_NULLUNIMPL  ksem_close
-401AUE_NULLUNIMPL  ksem_post
-402AUE_NULLUNIMPL  ksem_wait
-403AUE_NULLUNIMPL  ksem_trywait
-404AUE_NULLUNIMPL  ksem_init
-405AUE_NULLUNIMPL  ksem_open
-406AUE_NULLUNIMPL  ksem_unlink
-407AUE_NULLUNIMPL  ksem_getvalue
-408AUE_NULLUNIMPL  ksem_destroy
+400AUE_NULLNOSTD|NOPROTO   { int ksem_close(semid_t id); }
+401AUE_NULLNOSTD|NOPROTO   { int ksem_post(semid_t id); }
+402AUE_NULLNOSTD|NOPROTO   { int ksem_wait(semid_t id); }
+403AUE_NULLNOSTD|NOPROTO   { int ksem_trywait(semid_t id); }
+404AUE_NULLNOSTD   { int freebsd32_ksem_init(semid_t *idp, \
+   unsigned int value); }
+405AUE_NULLNOSTD   { int freebsd32_ksem_open(semid_t *idp, \
+   const char *name, int oflag, \
+   mode_t mode, unsigned int value); }
+406AUE_NULLNOSTD|NOPROTO   { int ksem_unlink(const char *name); }
+407AUE_NULLNOSTD|NOPROTO   { int ksem_getvalue(semid_t id, \
+   int *val); }
+408AUE_NULLNOSTD|NOPROTO   { int ksem_destroy(semid_t id); }
 409AUE_NULLUNIMPL  __mac_get_pid
 410AUE_NULLUNIMPL  __mac_get_link
 411AUE_NULLUNIMPL  __mac_set_link
@@ -765,7 +768,8 @@
const char *path, int attrnamespace, \
void *data, size_t nbytes); }
 440AUE_NULLUNIMPL  kse_switchin
-441AUE_NULLUNIMPL  ksem_timedwait
+441AUE_NULLNOSTD   { int freebsd32_ksem_timedwait(semid_t id, \
+   const struct timespec32 *abstime); }
 442AUE_NULLSTD { int freebsd32_thr_suspend( \
const struct timespec32 *timeout); }
 443AUE_NULLNOPROTO { int thr_wake(long id); }

Modified: head/sys/kern/uipc_sem.c
==
--- head/sys/kern/uipc_sem.cFri Mar 19 11:04:42 2010(r205323)
+++ head/sys/kern/uipc_sem.cFri Mar 19 11:08:43 2010(r205324)
@@ -34,6 +34,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_compat.h"
 #include "opt_posix.h"
 
 #include 
@@ -112,7 +113,7 @@ static struct ksem *ksem_alloc(struct uc
unsigned int value);
 static int ksem_create(struct thread *td, const char *path,
semid_t *semidp, mode_t mode, unsigned int value,
-   int flags);
+   int flags, int compat32);
 static voidksem_drop(struct ksem *ks);
 static int ksem_get(struct thread *td, semid_t id, struct file **fpp);
 static struct ksem *ksem_hold(struct ksem *ks);
@@ -374,16 +375,44 @@ ksem_remove(char *path, Fnv32_t fnv, str
return (ENOENT);
 }
 
+static int
+ksem_create_copyout_semid(struct thread *td, semid_t *semidp, int fd,
+int compat32)
+{
+   semid_t semid;
+#ifdef COMPAT_FREEBSD32
+   int32_t semid32;
+#endif
+   void *ptr;
+   size_t ptrs;
+
+#ifdef COMPAT_FREEBSD32
+   if (compat32) {
+   semid32 = fd;
+   ptr = &semid32;
+   ptrs = sizeof(semid32);
+   } else {
+#endif
+   semid = fd;
+   ptr = &semid;
+   ptrs = sizeof(semid);
+   compat32 = 0; /* silence gcc */
+#ifdef COMPAT_FREEBSD32
+   }
+#endif
+
+   return (copyout(ptr, semidp, ptrs));
+}
+
 /* Other helper routines. */
 static int
 ksem_create(struct thread *td, const char *name, semid_t *semidp, mode_t mode,
-unsigned int value, int flags)
+unsigned int value, int flags, int compat32)
 {
struct filedesc *fdp;
struct ksem *ks;
struct file *fp;
char *path;
-   semid_t semid;
Fnv32_t fnv;
int error, fd;
 
@@ -404,8 +433,7 @@ ksem_create(struct thread *td, const cha
 * premature, but it is a lot easier to handle errors as opposed
 * to la

svn commit: r205325 - in head/sys: compat/freebsd32 kern

2010-03-19 Thread Konstantin Belousov
Author: kib
Date: Fri Mar 19 11:10:24 2010
New Revision: 205325
URL: http://svn.freebsd.org/changeset/base/205325

Log:
  Implement compat32 shims for mqueuefs.
  
  Reviewed by:  jhb
  MFC after:2 weeks

Modified:
  head/sys/compat/freebsd32/freebsd32.h
  head/sys/compat/freebsd32/syscalls.master
  head/sys/kern/uipc_mqueue.c

Modified: head/sys/compat/freebsd32/freebsd32.h
==
--- head/sys/compat/freebsd32/freebsd32.h   Fri Mar 19 11:08:43 2010
(r205324)
+++ head/sys/compat/freebsd32/freebsd32.h   Fri Mar 19 11:10:24 2010
(r205325)
@@ -221,4 +221,12 @@ struct prpsinfo32 {
 charpr_psargs[PRARGSZ+1];
 };
 
+struct mq_attr32 {
+   int mq_flags;
+   int mq_maxmsg;
+   int mq_msgsize;
+   int mq_curmsgs;
+   int __reserved[4];
+};
+
 #endif /* !_COMPAT_FREEBSD32_FREEBSD32_H_ */

Modified: head/sys/compat/freebsd32/syscalls.master
==
--- head/sys/compat/freebsd32/syscalls.master   Fri Mar 19 11:08:43 2010
(r205324)
+++ head/sys/compat/freebsd32/syscalls.master   Fri Mar 19 11:10:24 2010
(r205325)
@@ -797,12 +797,23 @@
int param_size); }
 456AUE_NULLNOPROTO { int sigqueue(pid_t pid, int signum, \
void *value); }
-457AUE_NULLUNIMPL  kmq_open
-458AUE_NULLUNIMPL  kmq_setattr
-459AUE_NULLUNIMPL  kmq_timedreceive
-460AUE_NULLUNIMPL  kmq_timedsend
-461AUE_NULLUNIMPL  kmq_notify
-462AUE_NULLUNIMPL  kmq_unlink
+457AUE_NULLNOSTD   { int freebsd32_kmq_open( \
+   const char *path, int flags, mode_t mode, \
+   const struct mq_attr32 *attr); }
+458AUE_NULLNOSTD   { int freebsd32_kmq_setattr(int mqd, \
+   const struct mq_attr32 *attr,   \
+   struct mq_attr32 *oattr); }
+459AUE_NULLNOSTD   { int freebsd32_kmq_timedreceive(int mqd, \
+   char *msg_ptr, size_t msg_len,  \
+   unsigned *msg_prio, \
+   const struct timespec32 *abs_timeout); }
+460AUE_NULLNOSTD   { int freebsd32_kmq_timedsend(int mqd,  \
+   const char *msg_ptr, size_t msg_len,\
+   unsigned msg_prio,  \
+   const struct timespec32 *abs_timeout);}
+461AUE_NULLNOPROTO|NOSTD   { int kmq_notify(int mqd,   \
+   const struct sigevent *sigev); }
+462AUE_NULLNOPROTO|NOSTD   { int kmq_unlink(const char *path); }
 463AUE_NULLNOPROTO { int abort2(const char *why, int nargs, void 
**args); }
 464AUE_NULLNOPROTO { int thr_set_name(long id, const char *name); }
 465AUE_NULLNOSTD   { int freebsd32_aio_fsync(int op, \

Modified: head/sys/kern/uipc_mqueue.c
==
--- head/sys/kern/uipc_mqueue.c Fri Mar 19 11:08:43 2010(r205324)
+++ head/sys/kern/uipc_mqueue.c Fri Mar 19 11:10:24 2010(r205325)
@@ -45,6 +45,8 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_compat.h"
+
 #include 
 #include 
 #include 
@@ -1622,7 +1624,7 @@ mqueue_send(struct mqueue *mq, const cha
const struct timespec *abs_timeout)
 {
struct mqueue_msg *msg;
-   struct timespec ets, ts, ts2;
+   struct timespec ts, ts2;
struct timeval tv;
int error;
 
@@ -1658,15 +1660,12 @@ mqueue_send(struct mqueue *mq, const cha
if (error != EAGAIN)
goto bad;
 
-   error = copyin(abs_timeout, &ets, sizeof(ets));
-   if (error != 0)
-   goto bad;
-   if (ets.tv_nsec >= 10 || ets.tv_nsec < 0) {
+   if (abs_timeout->tv_nsec >= 10 || abs_timeout->tv_nsec < 0) {
error = EINVAL;
goto bad;
}
for (;;) {
-   ts2 = ets;
+   ts2 = *abs_timeout;
getnanotime(&ts);
timespecsub(&ts2, &ts);
if (ts2.tv_sec < 0 || (ts2.tv_sec == 0 && ts2.tv_nsec <= 0)) {
@@ -1773,7 +1772,7 @@ mqueue_receive(struct mqueue *mq, char *
const struct timespec *abs_timeout)
 {
struct mqueue_msg *msg;
-   struct timespec ets, ts, ts2;
+   struct timespec ts, ts2;
struct timeval tv;
int error;
 
@@ -1804,16 +1803,13 @@ mqueue_receive(struct mqueue *mq, char *
if (error != EAGAIN)
return (error);
 
-   error = copyin(abs_timeout, &ets, sizeof(ets));
-   if (error != 0)
-   retu

svn commit: r205326 - head/sys/kern

2010-03-19 Thread Konstantin Belousov
Author: kib
Date: Fri Mar 19 11:11:34 2010
New Revision: 205326
URL: http://svn.freebsd.org/changeset/base/205326

Log:
  Convert aio syscall registration to SYSCALL_INIT_HELPER.
  
  Reviewed by:  jhb
  MFC after:2 weeks

Modified:
  head/sys/kern/vfs_aio.c

Modified: head/sys/kern/vfs_aio.c
==
--- head/sys/kern/vfs_aio.c Fri Mar 19 11:10:24 2010(r205325)
+++ head/sys/kern/vfs_aio.c Fri Mar 19 11:11:34 2010(r205326)
@@ -334,7 +334,7 @@ static TAILQ_HEAD(,aiocblist) aio_jobs; 
 static struct unrhdr *aiod_unr;
 
 void   aio_init_aioinfo(struct proc *p);
-static voidaio_onceonly(void);
+static int aio_onceonly(void);
 static int aio_free_entry(struct aiocblist *aiocbe);
 static voidaio_process(struct aiocblist *aiocbe);
 static int aio_newproc(int *);
@@ -419,18 +419,47 @@ static moduledata_t aio_mod = {
NULL
 };
 
-SYSCALL_MODULE_HELPER(aio_cancel);
-SYSCALL_MODULE_HELPER(aio_error);
-SYSCALL_MODULE_HELPER(aio_fsync);
-SYSCALL_MODULE_HELPER(aio_read);
-SYSCALL_MODULE_HELPER(aio_return);
-SYSCALL_MODULE_HELPER(aio_suspend);
-SYSCALL_MODULE_HELPER(aio_waitcomplete);
-SYSCALL_MODULE_HELPER(aio_write);
-SYSCALL_MODULE_HELPER(lio_listio);
-SYSCALL_MODULE_HELPER(oaio_read);
-SYSCALL_MODULE_HELPER(oaio_write);
-SYSCALL_MODULE_HELPER(olio_listio);
+static struct syscall_helper_data aio_syscalls[] = {
+   SYSCALL_INIT_HELPER(aio_cancel),
+   SYSCALL_INIT_HELPER(aio_error),
+   SYSCALL_INIT_HELPER(aio_fsync),
+   SYSCALL_INIT_HELPER(aio_read),
+   SYSCALL_INIT_HELPER(aio_return),
+   SYSCALL_INIT_HELPER(aio_suspend),
+   SYSCALL_INIT_HELPER(aio_waitcomplete),
+   SYSCALL_INIT_HELPER(aio_write),
+   SYSCALL_INIT_HELPER(lio_listio),
+   SYSCALL_INIT_HELPER(oaio_read),
+   SYSCALL_INIT_HELPER(oaio_write),
+   SYSCALL_INIT_HELPER(olio_listio),
+   SYSCALL_INIT_LAST
+};
+
+#ifdef COMPAT_FREEBSD32
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static struct syscall_helper_data aio32_syscalls[] = {
+   SYSCALL32_INIT_HELPER(freebsd32_aio_return),
+   SYSCALL32_INIT_HELPER(freebsd32_aio_suspend),
+   SYSCALL32_INIT_HELPER(freebsd32_aio_cancel),
+   SYSCALL32_INIT_HELPER(freebsd32_aio_error),
+   SYSCALL32_INIT_HELPER(freebsd32_aio_fsync),
+   SYSCALL32_INIT_HELPER(freebsd32_aio_read),
+   SYSCALL32_INIT_HELPER(freebsd32_aio_write),
+   SYSCALL32_INIT_HELPER(freebsd32_aio_waitcomplete),
+   SYSCALL32_INIT_HELPER(freebsd32_lio_listio),
+   SYSCALL32_INIT_HELPER(freebsd32_oaio_read),
+   SYSCALL32_INIT_HELPER(freebsd32_oaio_write),
+   SYSCALL32_INIT_HELPER(freebsd32_olio_listio),
+   SYSCALL_INIT_LAST
+};
+#endif
 
 DECLARE_MODULE(aio, aio_mod,
SI_SUB_VFS, SI_ORDER_ANY);
@@ -439,9 +468,10 @@ MODULE_VERSION(aio, 1);
 /*
  * Startup initialization
  */
-static void
+static int
 aio_onceonly(void)
 {
+   int error;
 
/* XXX: should probably just use so->callback */
aio_swake = &aio_swake_cb;
@@ -474,6 +504,16 @@ aio_onceonly(void)
p31b_setcfg(CTL_P1003_1B_AIO_LISTIO_MAX, AIO_LISTIO_MAX);
p31b_setcfg(CTL_P1003_1B_AIO_MAX, MAX_AIO_QUEUE);
p31b_setcfg(CTL_P1003_1B_AIO_PRIO_DELTA_MAX, 0);
+
+   error = syscall_helper_register(aio_syscalls);
+   if (error)
+   return (error);
+#ifdef COMPAT_FREEBSD32
+   error = syscall32_helper_register(aio32_syscalls);
+   if (error)
+   return (error);
+#endif
+   return (0);
 }
 
 /*
@@ -495,6 +535,11 @@ aio_unload(void)
if (!unloadable)
return (EOPNOTSUPP);
 
+#ifdef COMPAT_FREEBSD32
+   syscall32_helper_unregister(aio32_syscalls);
+#endif
+   syscall_helper_unregister(aio_syscalls);
+
error = kqueue_del_filteropts(EVFILT_AIO);
if (error)
return error;
@@ -2533,13 +2578,6 @@ filt_lio(struct knote *kn, long hint)
 }
 
 #ifdef COMPAT_FREEBSD32
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
 
 struct __aiocb_private32 {
int32_t status;
@@ -2948,16 +2986,4 @@ freebsd32_lio_listio(struct thread *td, 
return (error);
 }
 
-SYSCALL32_MODULE_HELPER(freebsd32_aio_return);
-SYSCALL32_MODULE_HELPER(freebsd32_aio_suspend);
-SYSCALL32_MODULE_HELPER(freebsd32_aio_cancel);
-SYSCALL32_MODULE_HELPER(freebsd32_aio_error);
-SYSCALL32_MODULE_HELPER(freebsd32_aio_fsync);
-SYSCALL32_MODULE_HELPER(freebsd32_aio_read);
-SYSCALL32_MODULE_HELPER(freebsd32_aio_write);
-SYSCALL32_MODULE_HELPER(freebsd32_aio_waitcomplete);
-SYSCALL32_MODULE_HELPER(freebsd32_lio_listio);
-SYSCALL32_MODULE_HELPER(freebsd32_oaio_read);
-SYSCALL32_MODULE_HELPER(freebsd32_oaio_write);
-SYSCALL32_MODULE_HELPER(freebsd32_olio_listio);
 #endif
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/sv

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

2010-03-19 Thread Konstantin Belousov
Author: kib
Date: Fri Mar 19 11:13:42 2010
New Revision: 205327
URL: http://svn.freebsd.org/changeset/base/205327

Log:
  Remove empty line.
  
  MFC after:2 weeks

Modified:
  head/sys/compat/freebsd32/freebsd32_misc.c

Modified: head/sys/compat/freebsd32/freebsd32_misc.c
==
--- head/sys/compat/freebsd32/freebsd32_misc.c  Fri Mar 19 11:11:34 2010
(r205326)
+++ head/sys/compat/freebsd32/freebsd32_misc.c  Fri Mar 19 11:13:42 2010
(r205327)
@@ -1400,7 +1400,6 @@ freebsd4_freebsd32_fhstatfs(struct threa
 }
 #endif
 
-
 int
 freebsd32_pread(struct thread *td, struct freebsd32_pread_args *uap)
 {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2010-03-19 Thread Konstantin Belousov
Author: kib
Date: Fri Mar 19 11:14:37 2010
New Revision: 205328
URL: http://svn.freebsd.org/changeset/base/205328

Log:
  Regen

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

Modified: head/sys/compat/freebsd32/freebsd32_proto.h
==
--- head/sys/compat/freebsd32/freebsd32_proto.h Fri Mar 19 11:13:42 2010
(r205327)
+++ head/sys/compat/freebsd32/freebsd32_proto.h Fri Mar 19 11:14:37 2010
(r205328)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 205014 
2010-03-11 14:49:06Z nwhitehorn 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 205325 
2010-03-19 11:10:24Z kib 
  */
 
 #ifndef _FREEBSD32_SYSPROTO_H_
@@ -306,6 +306,17 @@ struct freebsd32_sendfile_args {
char sbytes_l_[PADL_(off_t *)]; off_t * sbytes; char 
sbytes_r_[PADR_(off_t *)];
char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
 };
+struct freebsd32_ksem_init_args {
+   char idp_l_[PADL_(semid_t *)]; semid_t * idp; char idp_r_[PADR_(semid_t 
*)];
+   char value_l_[PADL_(unsigned int)]; unsigned int value; char 
value_r_[PADR_(unsigned int)];
+};
+struct freebsd32_ksem_open_args {
+   char idp_l_[PADL_(semid_t *)]; semid_t * idp; char idp_r_[PADR_(semid_t 
*)];
+   char name_l_[PADL_(const char *)]; const char * name; char 
name_r_[PADR_(const char *)];
+   char oflag_l_[PADL_(int)]; int oflag; char oflag_r_[PADR_(int)];
+   char mode_l_[PADL_(mode_t)]; mode_t mode; char mode_r_[PADR_(mode_t)];
+   char value_l_[PADL_(unsigned int)]; unsigned int value; char 
value_r_[PADR_(unsigned int)];
+};
 struct freebsd32_sigaction_args {
char sig_l_[PADL_(int)]; int sig; char sig_r_[PADR_(int)];
char act_l_[PADL_(struct sigaction32 *)]; struct sigaction32 * act; 
char act_r_[PADR_(struct sigaction32 *)];
@@ -330,6 +341,10 @@ struct freebsd32_umtx_lock_args {
 struct freebsd32_umtx_unlock_args {
char umtx_l_[PADL_(struct umtx *)]; struct umtx * umtx; char 
umtx_r_[PADR_(struct umtx *)];
 };
+struct freebsd32_ksem_timedwait_args {
+   char id_l_[PADL_(semid_t)]; semid_t id; char id_r_[PADR_(semid_t)];
+   char abstime_l_[PADL_(const struct timespec32 *)]; const struct 
timespec32 * abstime; char abstime_r_[PADR_(const struct timespec32 *)];
+};
 struct freebsd32_thr_suspend_args {
char timeout_l_[PADL_(const struct timespec32 *)]; const struct 
timespec32 * timeout; char timeout_r_[PADR_(const struct timespec32 *)];
 };
@@ -344,6 +359,31 @@ struct freebsd32_thr_new_args {
char param_l_[PADL_(struct thr_param32 *)]; struct thr_param32 * param; 
char param_r_[PADR_(struct thr_param32 *)];
char param_size_l_[PADL_(int)]; int param_size; char 
param_size_r_[PADR_(int)];
 };
+struct freebsd32_kmq_open_args {
+   char path_l_[PADL_(const char *)]; const char * path; char 
path_r_[PADR_(const char *)];
+   char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
+   char mode_l_[PADL_(mode_t)]; mode_t mode; char mode_r_[PADR_(mode_t)];
+   char attr_l_[PADL_(const struct mq_attr32 *)]; const struct mq_attr32 * 
attr; char attr_r_[PADR_(const struct mq_attr32 *)];
+};
+struct freebsd32_kmq_setattr_args {
+   char mqd_l_[PADL_(int)]; int mqd; char mqd_r_[PADR_(int)];
+   char attr_l_[PADL_(const struct mq_attr32 *)]; const struct mq_attr32 * 
attr; char attr_r_[PADR_(const struct mq_attr32 *)];
+   char oattr_l_[PADL_(struct mq_attr32 *)]; struct mq_attr32 * oattr; 
char oattr_r_[PADR_(struct mq_attr32 *)];
+};
+struct freebsd32_kmq_timedreceive_args {
+   char mqd_l_[PADL_(int)]; int mqd; char mqd_r_[PADR_(int)];
+   char msg_ptr_l_[PADL_(char *)]; char * msg_ptr; char 
msg_ptr_r_[PADR_(char *)];
+   char msg_len_l_[PADL_(size_t)]; size_t msg_len; char 
msg_len_r_[PADR_(size_t)];
+   char msg_prio_l_[PADL_(unsigned *)]; unsigned * msg_prio; char 
msg_prio_r_[PADR_(unsigned *)];
+   char abs_timeout_l_[PADL_(const struct timespec32 *)]; const struct 
timespec32 * abs_timeout; char abs_timeout_r_[PADR_(const struct timespec32 *)];
+};
+struct freebsd32_kmq_timedsend_args {
+   char mqd_l_[PADL_(int)]; int mqd; char mqd_r_[PADR_(int)];
+   char msg_ptr_l_[PADL_(const char *)]; const char * msg_ptr; char 
msg_ptr_r_[PADR_(const char *)];
+   char msg_len_l_[PADL_(size_t)]; size_t msg_len; char 
msg_len_r_[PADR_(size_t)];
+   char msg_prio_l_[PADL_(unsigned)]; unsigned msg_prio; char 
msg_prio_r_[PADR_(unsigned)];
+   char abs_timeout_l_[PADL_(const struct timespec32 *)]; const struct 
timespec32 * abs_timeout; char abs_timeout_r_[PADR_(const struct timespec32 *)];
+};
 struct freebsd32_aio_fsync_args {
char op_l

Re: svn commit: r205307 - head/sys/i386/conf

2010-03-19 Thread Ed Schouten
* Xin LI  wrote:
> Log:
>   SSE is enabled by default about 5 years ago so there is no point pretending
>   that we support I486 and I586 CPUs in the GENERIC kernel, users wants these
>   support would have to build a custom kernel to explicitly disable SSE
>   anyways.
>   
>   MFC after:  1 month

Could we please leave i586 here? I agree people should throw their
Pentiums on the scrapyard, but only supporting i686 by default is a bit
too agressive in my opinion.

-- 
 Ed Schouten 
 WWW: http://80386.nl/


pgppTVDuc8NIF.pgp
Description: PGP signature


svn commit: r205329 - head/etc

2010-03-19 Thread Ed Schouten
Author: ed
Date: Fri Mar 19 11:59:02 2010
New Revision: 205329
URL: http://svn.freebsd.org/changeset/base/205329

Log:
  Don't add the atrun-line to the crontab when MK_AT is set.
  
  This prevents spurious calls to sendmail every 5 minutes.
  
  MFC after:1 week

Modified:
  head/etc/Makefile

Modified: head/etc/Makefile
==
--- head/etc/Makefile   Fri Mar 19 11:14:37 2010(r205328)
+++ head/etc/Makefile   Fri Mar 19 11:59:02 2010(r205329)
@@ -161,6 +161,9 @@ distribution:
${BIN2} ${DESTDIR}/etc; \
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
master.passwd nsmb.conf opieaccess ${DESTDIR}/etc;
+.if ${MK_AT} == "no"
+   sed -i "" -e '/atrun/d' ${DESTDIR}/etc/crontab
+.endif
 .if ${MK_TCSH} == "no"
sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
 .endif
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r205307 - head/sys/i386/conf

2010-03-19 Thread John Baldwin
On Thursday 18 March 2010 9:16:53 pm Xin LI wrote:
> Author: delphij
> Date: Fri Mar 19 01:16:53 2010
> New Revision: 205307
> URL: http://svn.freebsd.org/changeset/base/205307
> 
> Log:
>   SSE is enabled by default about 5 years ago so there is no point pretending
>   that we support I486 and I586 CPUs in the GENERIC kernel, users wants these
>   support would have to build a custom kernel to explicitly disable SSE
>   anyways.
>   
>   MFC after:  1 month

No, this is wrong.  Revert this.  We do _not_ unconditionally use SSE in the
kernel.  GENERIC should run just fine on a 486.  If it doesn't, that should be
fixed, but I have not seen any reports to the contrary.  In general we do not
use any floating-point / MMX / SSE instructions in the kernel as our FPU
context-saving code doesn't support it.

All the x86 world is not rack-mounted 64-bit servers.  We should not remove
support for non-686 CPUs for no good reason.  486 CPUs have cmpxchg and xadd
so are perfectly adequate.

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


Re: svn commit: r205307 - head/sys/i386/conf

2010-03-19 Thread Poul-Henning Kamp
In message <201003190759.56385@freebsd.org>, John Baldwin writes:
>On Thursday 18 March 2010 9:16:53 pm Xin LI wrote:

>All the x86 world is not rack-mounted 64-bit servers.  We should not remove
>support for non-686 CPUs for no good reason.  486 CPUs have cmpxchg and xadd
>so are perfectly adequate.

Seconded.

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r205332 - in head/sys: amd64/acpica i386/acpica

2010-03-19 Thread John Baldwin
Author: jhb
Date: Fri Mar 19 12:43:18 2010
New Revision: 205332
URL: http://svn.freebsd.org/changeset/base/205332

Log:
  Use the same policy for rejecting / not-reject ACPI tables with incorrect
  checksums as the base acpi(4) driver.  This fixes a problem where the MADT
  parser would reject the MADT table during early boot causing the MP Table
  to be, but then the acpi(4) driver would attach and use non-SMP interrupt
  routing.
  
  Tested by:Alastair Hogge  agh of coolrhaug com
  MFC after:1 week

Modified:
  head/sys/amd64/acpica/acpi_machdep.c
  head/sys/i386/acpica/acpi_machdep.c

Modified: head/sys/amd64/acpica/acpi_machdep.c
==
--- head/sys/amd64/acpica/acpi_machdep.cFri Mar 19 12:07:28 2010
(r205331)
+++ head/sys/amd64/acpica/acpi_machdep.cFri Mar 19 12:43:18 2010
(r205332)
@@ -627,8 +627,10 @@ map_table(vm_paddr_t pa, int offset, con
if (ACPI_FAILURE(AcpiTbChecksum(table, length))) {
if (bootverbose)
printf("ACPI: Failed checksum for table %s\n", sig);
+#if (ACPI_CHECKSUM_ABORT)
table_unmap(table, length);
return (NULL);
+#endif
}
return (table);
 }

Modified: head/sys/i386/acpica/acpi_machdep.c
==
--- head/sys/i386/acpica/acpi_machdep.c Fri Mar 19 12:07:28 2010
(r205331)
+++ head/sys/i386/acpica/acpi_machdep.c Fri Mar 19 12:43:18 2010
(r205332)
@@ -641,8 +641,10 @@ map_table(vm_paddr_t pa, int offset, con
if (ACPI_FAILURE(AcpiTbChecksum(table, length))) {
if (bootverbose)
printf("ACPI: Failed checksum for table %s\n", sig);
+#if (ACPI_CHECKSUM_ABORT)
table_unmap(table, length);
return (NULL);
+#endif
}
return (table);
 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r205307 - head/sys/i386/conf

2010-03-19 Thread Matthew Jacob

On 3/19/2010 5:10 AM, Poul-Henning Kamp wrote:

In message<201003190759.56385@freebsd.org>, John Baldwin writes:
   

On Thursday 18 March 2010 9:16:53 pm Xin LI wrote:
 
   

All the x86 world is not rack-mounted 64-bit servers.  We should not remove
support for non-686 CPUs for no good reason.  486 CPUs have cmpxchg and xadd
so are perfectly adequate.
 

Seconded.

   
I had thought that the SSE was unconditional. My mistake (and big 
mouth). I'll agree/


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


Re: svn commit: r205307 - head/sys/i386/conf

2010-03-19 Thread Bruce Evans

On Fri, 19 Mar 2010, John Baldwin wrote:


On Thursday 18 March 2010 9:16:53 pm Xin LI wrote:

Author: delphij
Date: Fri Mar 19 01:16:53 2010
New Revision: 205307
URL: http://svn.freebsd.org/changeset/base/205307

Log:
  SSE is enabled by default about 5 years ago so there is no point pretending
  that we support I486 and I586 CPUs in the GENERIC kernel, users wants these
  support would have to build a custom kernel to explicitly disable SSE
  anyways.

  MFC after:1 month


No, this is wrong.  Revert this.  We do _not_ unconditionally use SSE in the
kernel.  GENERIC should run just fine on a 486.  If it doesn't, that should be
fixed, but I have not seen any reports to the contrary.


Indeed.  This doesn't even break the non-SSE case, since it doesn't
remove I686_CPU or any of the code that dynamically chooses whether
to use SSE.

Most 686's don't have SSE, since a 686 is an old name for a PentiumPro
or maybe a Pentium2 and these don't have SSE (not sure about the
Pentium2, but my old Celeron is Pentimum2-class and it only has FXSR).
However, we keep using this old name for all generations of i386's
after i586, even for generations that are really HAMMERs.  Thus the
static configuration related to I*86_CPU is almost usless: it controls
only couple of options for i486 and i586, with the more complicated
and costly configuration for post-i586 being handled dynamically.
Omitting I486_CPU and I586_CPU thus has very little effect except
breaking i486 and i586, and having these options does little except
support this foot-shooting.  The effect of I486_CPU is especially small.
It is:
- statically disable use of the TSC in the bogus get_cyclecount() API.
  Although the TSC is dynamically configured elsewhere, this function
  wants to use the TSC without any dynamic tests, so it is uses static
  configuration for efficiency.
- avoid compiling in functions to initialize a 486.  There is dynamic
  code to use these functions as needed, but this optimization saves
  a few hundred if not a few thousand bytes.
- panic if the CPU is an i486, since the necessary extra support for
  an i486 (just the above 2 features) is not present.
I586_CPU gives a little more.  E.g., support for fixing the F00F hardware
bug on some Pentium1's.  Again there is dynamic configuration for this
but a few hundred bytes are saved by not compiling it in.


In general we do not
use any floating-point / MMX / SSE instructions in the kernel as our FPU
context-saving code doesn't support it.


Actually, we do, sort of.  We use the fxsave and fxrstor instructions, if
available, in the context-saving code itself.  These are closely related
to SSE, if not part of SSE.  They are in different cpuid flags (FXSR
instead of SSE*), but the dynamic code for using them is configured by
the same ifdefs as for using SSE.  My old Celeron with FXSR thus uses
fxsave/fxrstor but not SSE proper (even in userland).


All the x86 world is not rack-mounted 64-bit servers.  We should not remove
support for non-686 CPUs for no good reason.  486 CPUs have cmpxchg and xadd
so are perfectly adequate.


Why do we still have CPU_DISABLE_CMPXCHG then?  It was mainly for i386, and
is now documented as being useful for old vmware, but hopefully vmware has
been replaced by not-so-old vmware, qemu, kqemu, virtualbox,... and these
support cmpxchg.

The configuration of cmpxchg and a couple of other things is only static.

SSE has both dynamic and static configuration.  Its static configuration
is obfuscated for historical reasons.  It used to be a positive option
but now it is a negative option.  The positive option is set in all 2
files that use SSE (actually only FXSR?) by the following ifdef:

% #if !defined(CPU_DISABLE_SSE) && defined(I686_CPU)
% #define CPU_ENABLE_SSE
% #endif

So CPU_ENABLE_SSE is the default, but the dynamic code for using it can
be not compiled in either by configuring CPU_DISABLE_SSE or by not
configuring I686_CPU.

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


svn commit: r205333 - head/share/man/man9

2010-03-19 Thread Andriy Gapon
Author: avg
Date: Fri Mar 19 14:35:38 2010
New Revision: 205333
URL: http://svn.freebsd.org/changeset/base/205333

Log:
  vfs_mount.9: drop cross-reference to a removed manual
  
  MFC after:3 days

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

Modified: head/share/man/man9/vfs_mount.9
==
--- head/share/man/man9/vfs_mount.9 Fri Mar 19 12:43:18 2010
(r205332)
+++ head/share/man/man9/vfs_mount.9 Fri Mar 19 14:35:38 2010
(r205333)
@@ -127,8 +127,7 @@ this call relies on a large number of ot
 whose errors it returns so this list may not be exhaustive.
 .Sh SEE ALSO
 .Xr mount 2 ,
-.Xr mount 8 ,
-.Xr vfs_mountedon 9
+.Xr mount 8
 .Pp
 .Va vfs.usermount
 .Sh AUTHORS
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r205334 - in head/sys: amd64/amd64 i386/i386

2010-03-19 Thread Andriy Gapon
Author: avg
Date: Fri Mar 19 14:48:32 2010
New Revision: 205334
URL: http://svn.freebsd.org/changeset/base/205334

Log:
  pmap amd64/i386: fix a typo in a comment
  
  MFC after:3 days

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

Modified: head/sys/amd64/amd64/pmap.c
==
--- head/sys/amd64/amd64/pmap.c Fri Mar 19 14:35:38 2010(r205333)
+++ head/sys/amd64/amd64/pmap.c Fri Mar 19 14:48:32 2010(r205334)
@@ -1123,7 +1123,7 @@ pmap_invalidate_cache_range(vm_offset_t 
 
/*
 * No targeted cache flush methods are supported by CPU,
-* or the supplied range is bigger then 2MB.
+* or the supplied range is bigger than 2MB.
 * Globally invalidate cache.
 */
pmap_invalidate_cache();

Modified: head/sys/i386/i386/pmap.c
==
--- head/sys/i386/i386/pmap.c   Fri Mar 19 14:35:38 2010(r205333)
+++ head/sys/i386/i386/pmap.c   Fri Mar 19 14:48:32 2010(r205334)
@@ -1014,7 +1014,7 @@ pmap_invalidate_cache_range(vm_offset_t 
 
/*
 * No targeted cache flush methods are supported by CPU,
-* or the supplied range is bigger then 2MB.
+* or the supplied range is bigger than 2MB.
 * Globally invalidate cache.
 */
pmap_invalidate_cache();
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r205335 - head/etc

2010-03-19 Thread Ed Schouten
Author: ed
Date: Fri Mar 19 15:53:02 2010
New Revision: 205335
URL: http://svn.freebsd.org/changeset/base/205335

Log:
  Slightly improve my previous commit.
  
  Just comment out the atrun line instead of completely removing it. It is
  not a bad idea to leave it as a reference in case someone decides to
  install atrun by hand afterwards.

Modified:
  head/etc/Makefile

Modified: head/etc/Makefile
==
--- head/etc/Makefile   Fri Mar 19 14:48:32 2010(r205334)
+++ head/etc/Makefile   Fri Mar 19 15:53:02 2010(r205335)
@@ -162,7 +162,7 @@ distribution:
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
master.passwd nsmb.conf opieaccess ${DESTDIR}/etc;
 .if ${MK_AT} == "no"
-   sed -i "" -e '/atrun/d' ${DESTDIR}/etc/crontab
+   sed -i "" -e 's;.*/usr/libexec/atrun;#&;' ${DESTDIR}/etc/crontab
 .endif
 .if ${MK_TCSH} == "no"
sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r205336 - head/sys/i386/conf

2010-03-19 Thread Xin LI
Author: delphij
Date: Fri Mar 19 16:09:57 2010
New Revision: 205336
URL: http://svn.freebsd.org/changeset/base/205336

Log:
  Back out revision 205307.
  
  For the record:
  
  CPU_ENABLE_SSE enables some code that dynamically enables SSE support
  but not necessarily enforce execution of SSE instructions.

Modified:
  head/sys/i386/conf/GENERIC

Modified: head/sys/i386/conf/GENERIC
==
--- head/sys/i386/conf/GENERIC  Fri Mar 19 15:53:02 2010(r205335)
+++ head/sys/i386/conf/GENERIC  Fri Mar 19 16:09:57 2010(r205336)
@@ -18,6 +18,8 @@
 #
 # $FreeBSD$
 
+cpuI486_CPU
+cpuI586_CPU
 cpuI686_CPU
 ident  GENERIC
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: I486_CPU and I586_CPU removed from GENERIC kernel [was Re: svn commit: r205307 - head/sys/i386/conf]

2010-03-19 Thread Ivan Voras
On 19 March 2010 07:33, Garrett Cooper  wrote:
> On Thu, Mar 18, 2010 at 6:16 PM, Xin LI  wrote:
>> Author: delphij
>> Date: Fri Mar 19 01:16:53 2010
>> New Revision: 205307
>> URL: http://svn.freebsd.org/changeset/base/205307
>>
>> Log:
>>  SSE is enabled by default about 5 years ago so there is no point pretending
>>  that we support I486 and I586 CPUs in the GENERIC kernel, users wants these
>>  support would have to build a custom kernel to explicitly disable SSE
>>  anyways.

SSE in the userland you mean? Regardless, I don't think there is now
reason for compiling everything as for i386. E.g. why not add at least
-mtune=generic or even also -march=i686 to default gcc options?

http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86_002d64-Options.html
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: I486_CPU and I586_CPU removed from GENERIC kernel [was Re: svn commit: r205307 - head/sys/i386/conf]

2010-03-19 Thread Valentin Nechayev
 Fri, Mar 19, 2010 at 17:13:00, ivoras wrote about "Re: I486_CPU and I586_CPU 
removed from GENERIC kernel [was Re: svn commit: r205307 - 
head/sys/i386/conf]": 

> SSE in the userland you mean? Regardless, I don't think there is now
> reason for compiling everything as for i386. E.g. why not add at least
> -mtune=generic or even also -march=i686 to default gcc options?
> 
> http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86_002d64-Options.html

Having userland compiled with i686 will give the same effect as i686-only
kernel: it won't boot on machines which doesn't conform to. If it is
supposed to boot on i486 and higher, no more than -march=i486 can be used.

OTOH it would be quite popular for most desktops and big servers to
orient to fresh hardware, so one can (if having enough resources) to split
targets:
1) - for most, which would have e.g.
CFLAGS=... -march=pentium3 -mmmx -msse -mfpmath=sse,387 -mtune=generic
COPTFLAGS=... -march=pentium3 -mtune=generic
2) for small/embedded/etc. with defaults to i486

and make separate binary distributions for them.

OT3H it isn't proven to give real effect except very limited cases
(CPU-intensive (mplayer, etc.), graphics-intensive apps (KDE)). Mplayer
usually uses differently compiled modules for different CPUs. There are
quite few applications which can get real benefit.


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


Re: I486_CPU and I586_CPU removed from GENERIC kernel [was Re: svn commit: r205307 - head/sys/i386/conf]

2010-03-19 Thread Xin LI
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 2010/03/18 23:33, Garrett Cooper wrote:
> On Thu, Mar 18, 2010 at 6:16 PM, Xin LI  wrote:
>> Author: delphij
>> Date: Fri Mar 19 01:16:53 2010
>> New Revision: 205307
>> URL: http://svn.freebsd.org/changeset/base/205307
>>
>> Log:
>>  SSE is enabled by default about 5 years ago so there is no point pretending
>>  that we support I486 and I586 CPUs in the GENERIC kernel, users wants these
>>  support would have to build a custom kernel to explicitly disable SSE
>>  anyways.
>>
>>  MFC after:1 month
>>
>> Modified:
>>  head/sys/i386/conf/GENERIC
>>
>> Modified: head/sys/i386/conf/GENERIC
>> ==
>> --- head/sys/i386/conf/GENERIC  Fri Mar 19 00:51:48 2010(r205306)
>> +++ head/sys/i386/conf/GENERIC  Fri Mar 19 01:16:53 2010(r205307)
>> @@ -18,8 +18,6 @@
>>  #
>>  # $FreeBSD$
>>
>> -cpuI486_CPU
>> -cpuI586_CPU
>>  cpuI686_CPU
>>  ident  GENERIC
> 
> 1. UPDATING entry ?
> 2. CC -current@ with the news?

Perhaps not, I was wrong on this: CPU_ENABLE_SSE would compile in the
support for SSE, not enforcing it.  Our lib32 on the other hand already
uses -i686 -sse -sse2 and -mmx so I'm just cutting the wrong foot I
guess :-/

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

iQEcBAEBAgAGBQJLo6XpAAoJEATO+BI/yjfBkucIAMkBwr0dR9GMJys2sl/reDkr
fNW3L6kIEY6kWu/G6H0ScTl1JXWhNcyhloOiswrVyekZJSf8bcXrbKoqTAig2ndE
eEaYHFQ1mM44nN6h30qDVR0E5xJvGLK2PPrYF1X88DDn8ykDGdVkM1nkR406/lGO
XyY2wdmvbwnFU535fPV/BA+uyYtBTfTQ7ZiiSUTior1086o7yHz2H3Q9a2+NlPAM
T669L/2+soDpXCNzZ+Fifm9dUAtu6zHEpLnyCQ1B280x/nvKtSyJEup1QxXy+zZJ
mr6nviODCfuRlEgiJRE0BzAhchLMbYpy8oEbgqbg8dZqGsnfTECQ1OUPXVRowfc=
=0bfK
-END PGP SIGNATURE-
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: I486_CPU and I586_CPU removed from GENERIC kernel [was Re: svn commit: r205307 - head/sys/i386/conf]

2010-03-19 Thread Ivan Voras
On 19 March 2010 17:22, Valentin Nechayev  wrote:
>  Fri, Mar 19, 2010 at 17:13:00, ivoras wrote about "Re: I486_CPU and I586_CPU 
> removed from GENERIC kernel [was Re: svn commit: r205307 - 
> head/sys/i386/conf]":
>
>> SSE in the userland you mean? Regardless, I don't think there is now
>> reason for compiling everything as for i386. E.g. why not add at least
>> -mtune=generic or even also -march=i686 to default gcc options?
>>
>> http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86_002d64-Options.html
>
> Having userland compiled with i686 will give the same effect as i686-only
> kernel: it won't boot on machines which doesn't conform to. If it is
> supposed to boot on i486 and higher, no more than -march=i486 can be used.

Yes, this is how I read the change - the move from "i386" to "i686". I
apologize if I got it wrong :)

As it was pointed out earlier - small systems users and designers
probably have special install procedures because of the nature of the
business.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r205307 - head/sys/i386/conf

2010-03-19 Thread M. Warner Losh
In message: <20100319114426.go32...@hoeg.nl>
Ed Schouten  writes:
: * Xin LI  wrote:
: > Log:
: >   SSE is enabled by default about 5 years ago so there is no point 
pretending
: >   that we support I486 and I586 CPUs in the GENERIC kernel, users wants 
these
: >   support would have to build a custom kernel to explicitly disable SSE
: >   anyways.
: >   
: >   MFC after:1 month
: 
: Could we please leave i586 here? I agree people should throw their
: Pentiums on the scrapyard, but only supporting i686 by default is a bit
: too agressive in my opinion.

I don't think we should MFC this change at all.  Geodes are still
fairly popular machines and have 486 cores in them.

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


Re: svn commit: r205307 - head/sys/i386/conf

2010-03-19 Thread M. Warner Losh
In message: <4ba2f899.8070...@feral.com>
Matthew Jacob  writes:
: Does anyone out there have a 486 DX4 even? Can you boot 8.0 CDs?

The soekris boxes have a geode in them, which is a 486.  I've run
generic on them w/o disabling SSE for ages...

Warner

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


Re: svn commit: r205307 - head/sys/i386/conf

2010-03-19 Thread Xin LI
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 2010/03/19 10:08, M. Warner Losh wrote:
> In message: <20100319114426.go32...@hoeg.nl>
> Ed Schouten  writes:
> : * Xin LI  wrote:
> : > Log:
> : >   SSE is enabled by default about 5 years ago so there is no point 
> pretending
> : >   that we support I486 and I586 CPUs in the GENERIC kernel, users wants 
> these
> : >   support would have to build a custom kernel to explicitly disable SSE
> : >   anyways.
> : >   
> : >   MFC after:  1 month
> : 
> : Could we please leave i586 here? I agree people should throw their
> : Pentiums on the scrapyard, but only supporting i686 by default is a bit
> : too agressive in my opinion.
> 
> I don't think we should MFC this change at all.  Geodes are still
> fairly popular machines and have 486 cores in them.

Yes you are right.  I overlooked the effect of CPU_ENABLE_SSE which is
to add the support for SSE not to enforce using it...  This revision has
been backed out anyways.

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

iQEcBAEBAgAGBQJLo7FkAAoJEATO+BI/yjfBqdEH/i61aI1hBIzP1+owXbtsRfzL
RzzdkM7eZfoNi6rYwG5JqJUQvJgxJWmQgHCMpwLZhp6D6mG4wKQKlVOJGfPiASDI
fouVxR2wKRf7hnK3WngTOBjDrwZ2xLpwsViMRLftsRUPGVFhGPB1lqKIeVXQ0kgb
bH9fydyeRLRXVixDJlhFq0UKfzMt3MGVbCJlKzeJ+3+EqeookIfPknN6G9NhhDzo
wHIRnwaYutnB95BBvsh/f6vtDbs7zUxcpxmcO+Rxt6eQgXZo9DtfRnRSAZ8urBA0
fFPOsc+tvflX4CCrFk7DM9klVFC4QGrofnPKoTlu4LwkusF+rPZ5RlmVw4qyWPY=
=/fSQ
-END PGP SIGNATURE-
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r205336 - head/sys/i386/conf

2010-03-19 Thread John Baldwin
On Friday 19 March 2010 12:09:57 pm Xin LI wrote:
> Author: delphij
> Date: Fri Mar 19 16:09:57 2010
> New Revision: 205336
> URL: http://svn.freebsd.org/changeset/base/205336
> 
> Log:
>   Back out revision 205307.
>   
>   For the record:
>   
>   CPU_ENABLE_SSE enables some code that dynamically enables SSE support
>   but not necessarily enforce execution of SSE instructions.

Thanks.

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


Re: I486_CPU and I586_CPU removed from GENERIC kernel [was Re: svn commit: r205307 - head/sys/i386/conf]

2010-03-19 Thread John Baldwin
On Friday 19 March 2010 12:13:00 pm Ivan Voras wrote:
> On 19 March 2010 07:33, Garrett Cooper  wrote:
> > On Thu, Mar 18, 2010 at 6:16 PM, Xin LI  wrote:
> >> Author: delphij
> >> Date: Fri Mar 19 01:16:53 2010
> >> New Revision: 205307
> >> URL: http://svn.freebsd.org/changeset/base/205307
> >>
> >> Log:
> >>  SSE is enabled by default about 5 years ago so there is no point 
> >> pretending
> >>  that we support I486 and I586 CPUs in the GENERIC kernel, users wants 
> >> these
> >>  support would have to build a custom kernel to explicitly disable SSE
> >>  anyways.
> 
> SSE in the userland you mean? Regardless, I don't think there is now
> reason for compiling everything as for i386. E.g. why not add at least
> -mtune=generic or even also -march=i686 to default gcc options?
> 
> http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86_002d64-Options.html

I actually suggested using -mtune=i686 several years ago for i386.  Using
-mtune=generic probably would be a good thing to use when CPUTYPE is not
specified for i386 and amd64 now.

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


Re: I486_CPU and I586_CPU removed from GENERIC kernel [was Re: svn commit: r205307 - head/sys/i386/conf]

2010-03-19 Thread John Baldwin
On Friday 19 March 2010 12:27:21 pm Xin LI wrote:
> On 2010/03/18 23:33, Garrett Cooper wrote:
> > On Thu, Mar 18, 2010 at 6:16 PM, Xin LI  wrote:
> >> Author: delphij
> >> Date: Fri Mar 19 01:16:53 2010
> >> New Revision: 205307
> >> URL: http://svn.freebsd.org/changeset/base/205307
> >>
> >> Log:
> >>  SSE is enabled by default about 5 years ago so there is no point 
pretending
> >>  that we support I486 and I586 CPUs in the GENERIC kernel, users wants 
these
> >>  support would have to build a custom kernel to explicitly disable SSE
> >>  anyways.
> >>
> >>  MFC after:1 month
> >>
> >> Modified:
> >>  head/sys/i386/conf/GENERIC
> >>
> >> Modified: head/sys/i386/conf/GENERIC
> >> 
==
> >> --- head/sys/i386/conf/GENERIC  Fri Mar 19 00:51:48 2010(r205306)
> >> +++ head/sys/i386/conf/GENERIC  Fri Mar 19 01:16:53 2010(r205307)
> >> @@ -18,8 +18,6 @@
> >>  #
> >>  # $FreeBSD$
> >>
> >> -cpuI486_CPU
> >> -cpuI586_CPU
> >>  cpuI686_CPU
> >>  ident  GENERIC
> >
> > 1. UPDATING entry ?
> > 2. CC -current@ with the news?
> 
> Perhaps not, I was wrong on this: CPU_ENABLE_SSE would compile in the
> support for SSE, not enforcing it.  Our lib32 on the other hand already
> uses -i686 -sse -sse2 and -mmx so I'm just cutting the wrong foot I
> guess :-/

I believe the lib32 bits assume they will always run on an amd64-capable CPU 
in which case SSE2 is guaranteed to be present.  Similarly, I think the lib32 
variant of libc uses a different method of setting up TLS than the native i386 
version (I think the lib32 libc uses a GSBASE sysarch() directly vs what an 
i386 libc does, or at least this used to be true at one point in the past if 
not currently true).

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


Re: I486_CPU and I586_CPU removed from GENERIC kernel [was Re: svn commit: r205307 - head/sys/i386/conf]

2010-03-19 Thread Bruce Evans

On Fri, 19 Mar 2010, John Baldwin wrote:


On Friday 19 March 2010 12:13:00 pm Ivan Voras wrote:

SSE in the userland you mean? Regardless, I don't think there is now
reason for compiling everything as for i386. E.g. why not add at least
-mtune=generic or even also -march=i686 to default gcc options?

http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86_002d64-Options.html


I actually suggested using -mtune=i686 several years ago for i386.  Using
-mtune=generic probably would be a good thing to use when CPUTYPE is not
specified for i386 and amd64 now.


Er, isn't -mtune=generic the default in gcc-4.2?  I once fought with
gcc-4.2 to produce kernels with similar size and compile time to ones
produced by gcc-3 (impossible for the runtime since gcc got another
40% slower and kernel source size and complications expanded another
40% even when the object size didn't bloat much).  It took -i386
and a couple of other flags like -fno-inline-functions-called-once
(the latter is also needed to unbreak debugging with ddb and profiling).
The flags had very little difference on runtime efficiency, partly because
I ran the kernels mainly on Athlons which run old i386-optimized code
amazingly well but gain on benefits from i686 optimizations.  Optimizing
Athlon kernels for Athlons also makes little difference but I usually do
it.

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


Re: svn commit: r205307 - head/sys/i386/conf

2010-03-19 Thread Dmitry Marakasov
* Steve Kargl (s...@troutmask.apl.washington.edu) wrote:

> Can you explain?  AFAIK, SSE including floating point
> instructions.  Floating point operations aren't allowed
> in the kernel.

Afaik, there are also effecient memory copy/move/fill instructions,
that do not require floating point context. For example, movnti is
used in sse2_pagezero().

-- 
Dmitry Marakasov   .   55B5 0596 FF1E 8D84 5F56  9510 D35A 80DD F9D2 F77D
amd...@amdmi3.ru  ..:  jabber: amd...@jabber.ruhttp://www.amdmi3.ru
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r205345 - in head/sys: kern net sys

2010-03-19 Thread Bjoern A. Zeeb
Author: bz
Date: Fri Mar 19 19:51:03 2010
New Revision: 205345
URL: http://svn.freebsd.org/changeset/base/205345

Log:
  Split eventhandler_register() into an internal part and a wrapper function
  that provides the allocated and setup eventhandler entry.
  
  Add a new wrapper for VIMAGE that allocates extra space to hold the
  callback function and argument in addition to an extra wrapper function.
  While the wrapper function goes as normal callback function the
  argument points to the extra space allocated holding the original func
  and arg that the wrapper function can then call.
  
  Provide an iterator function for the virtual network stack (vnet) that
  will call the callback function for each network stack.
  
  Provide a new set of macros for VNET that in the non-VIMAGE case will
  just call eventhandler_register() while in the VIMAGE case it will use
  vimage_eventhandler_register() passing in the extra iterator function
  but will only register once rather than per-vnet.
  We need a special macro in case we are interested in the tag returned
  as we must check for curvnet and can neither simply assign the
  return value, nor not change it in the non-vnet0 case without that.
  
  Sponsored by: ISPsystem
  Discussed with:   jhb
  Reviewed by:  zec (earlier version), jhb
  MFC after:1 month

Modified:
  head/sys/kern/subr_eventhandler.c
  head/sys/net/vnet.c
  head/sys/net/vnet.h
  head/sys/sys/eventhandler.h

Modified: head/sys/kern/subr_eventhandler.c
==
--- head/sys/kern/subr_eventhandler.c   Fri Mar 19 18:43:15 2010
(r205344)
+++ head/sys/kern/subr_eventhandler.c   Fri Mar 19 19:51:03 2010
(r205345)
@@ -68,15 +68,15 @@ SYSINIT(eventhandlers, SI_SUB_EVENTHANDL
  * Insertion is O(n) due to the priority scan, but optimises to O(1)
  * if all priorities are identical.
  */
-eventhandler_tag
-eventhandler_register(struct eventhandler_list *list, const char *name, 
- void *func, void *arg, int priority)
+static eventhandler_tag
+eventhandler_register_internal(struct eventhandler_list *list,
+const char *name, eventhandler_tag epn)
 {
 struct eventhandler_list   *new_list;
-struct eventhandler_entry_generic  *eg;
 struct eventhandler_entry  *ep;
 
 KASSERT(eventhandler_lists_initted, ("eventhandler registered too early"));
+KASSERT(epn != NULL, ("%s: cannot register NULL event", __func__));
 
 /* lock the eventhandler lists */
 mtx_lock(&eventhandler_mutex);
@@ -117,31 +117,68 @@ eventhandler_register(struct eventhandle
 }
 mtx_unlock(&eventhandler_mutex);
 
-/* allocate an entry for this handler, populate it */
-eg = malloc(sizeof(struct eventhandler_entry_generic), M_EVENTHANDLER,
-   M_WAITOK | M_ZERO);
-eg->func = func;
-eg->ee.ee_arg = arg;
-eg->ee.ee_priority = priority;
-KASSERT(priority != EHE_DEAD_PRIORITY,
+KASSERT(epn->ee_priority != EHE_DEAD_PRIORITY,
("%s: handler for %s registered with dead priority", __func__, name));
 
 /* sort it into the list */
-CTR4(KTR_EVH, "%s: adding item %p (function %p) to \"%s\"", __func__, eg,
-   func, name);
+CTR4(KTR_EVH, "%s: adding item %p (function %p) to \"%s\"", __func__, epn,
+   ((struct eventhandler_entry_generic *)epn)->func, name);
 EHL_LOCK(list);
 TAILQ_FOREACH(ep, &list->el_entries, ee_link) {
if (ep->ee_priority != EHE_DEAD_PRIORITY &&
-   eg->ee.ee_priority < ep->ee_priority) {
-   TAILQ_INSERT_BEFORE(ep, &eg->ee, ee_link);
+   epn->ee_priority < ep->ee_priority) {
+   TAILQ_INSERT_BEFORE(ep, epn, ee_link);
break;
}
 }
 if (ep == NULL)
-   TAILQ_INSERT_TAIL(&list->el_entries, &eg->ee, ee_link);
+   TAILQ_INSERT_TAIL(&list->el_entries, epn, ee_link);
 EHL_UNLOCK(list);
-return(&eg->ee);
+return(epn);
+}
+
+eventhandler_tag
+eventhandler_register(struct eventhandler_list *list, const char *name, 
+ void *func, void *arg, int priority)
+{
+struct eventhandler_entry_generic  *eg;
+
+/* allocate an entry for this handler, populate it */
+eg = malloc(sizeof(struct eventhandler_entry_generic), M_EVENTHANDLER,
+   M_WAITOK | M_ZERO);
+eg->func = func;
+eg->ee.ee_arg = arg;
+eg->ee.ee_priority = priority;
+
+return (eventhandler_register_internal(list, name, &eg->ee));
+}
+
+#ifdef VIMAGE
+struct eventhandler_entry_generic_vimage
+{
+struct eventhandler_entry  ee;
+vimage_iterator_func_t func;   /* Vimage iterator 
function. */
+struct eventhandler_entry_vimage   v_ee;   /* Original func, arg. 
*/
+};
+
+eventhandler_tag
+vimage_eventhandler_register(struct eventhandler_list *list, const char *name, 
+void *func, void *arg, int priority, vimage_iterator_func_t iterfunc)
+{
+struct eventhandler_entry_generic

svn commit: r205346 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2010-03-19 Thread Pawel Jakub Dawidek
Author: pjd
Date: Fri Mar 19 20:14:27 2010
New Revision: 205346
URL: http://svn.freebsd.org/changeset/base/205346

Log:
  The same code is used to import and to create pool.
  The order of operations is the following:
  1. Try to open vdev by remembered path and guid.
  2. If 1 failed, try to find vdev which guid matches and ignore the path.
  3. If 2 failed this means either that the vdev we're looking for is gone
 or that pool is being created and vdev doesn't contain proper guid yet.
 To be able to handle pool creation we open vdev by path anyway.
  
  Because of 3 it is possible that we open wrong vdev on import which can lead 
to
  confusions.
  
  The solution for this is to check spa_load_state. On pool creation it will be
  equal to SPA_LOAD_NONE and we can open vdev only by path immediately and if it
  is not equal to SPA_LOAD_NONE we first open by path+guid and when that fails,
  we open by guid. We no longer open wrong vdev on import.
  
  MFC after:2 weeks

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Fri Mar 
19 19:51:03 2010(r205345)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Fri Mar 
19 20:14:27 2010(r205346)
@@ -29,6 +29,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -505,17 +506,26 @@ vdev_geom_open(vdev_t *vd, uint64_t *psi
if ((owned = mtx_owned(&Giant)))
mtx_unlock(&Giant);
error = 0;
-   cp = vdev_geom_open_by_path(vd, 1);
-   if (cp == NULL) {
-   /*
-* The device at vd->vdev_path doesn't have the expected guid.
-* The disks might have merely moved around so try all other
-* geom providers to find one with the right guid.
-*/
-   cp = vdev_geom_open_by_guid(vd);
-   }
-   if (cp == NULL)
+
+   /*
+* If we're creating pool, just find GEOM provider by its name
+* and ignore GUID mismatches.
+*/
+   if (vd->vdev_spa->spa_load_state == SPA_LOAD_NONE)
cp = vdev_geom_open_by_path(vd, 0);
+   else {
+   cp = vdev_geom_open_by_path(vd, 1);
+   if (cp == NULL) {
+   /*
+* The device at vd->vdev_path doesn't have the
+* expected guid. The disks might have merely
+* moved around so try all other GEOM providers
+* to find one with the right guid.
+*/
+   cp = vdev_geom_open_by_guid(vd);
+   }
+   }
+
if (cp == NULL) {
ZFS_LOG(1, "Provider %s not found.", vd->vdev_path);
error = ENOENT;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r205347 - head/sys/compat/x86bios

2010-03-19 Thread Jung-uk Kim
Author: jkim
Date: Fri Mar 19 21:15:43 2010
New Revision: 205347
URL: http://svn.freebsd.org/changeset/base/205347

Log:
  - Map EBDA if available and add 64KB above 1MB (high memory), just in case.
  - Print the initial memory map when bootverbose is set.
  - Change the page fault address format from linear to %cs:%ip style.
  - Move duplicate code into a newly added function.
  - Add strictly aligned memory access for distant future. ;-)

Modified:
  head/sys/compat/x86bios/x86bios.c

Modified: head/sys/compat/x86bios/x86bios.c
==
--- head/sys/compat/x86bios/x86bios.c   Fri Mar 19 20:14:27 2010
(r205346)
+++ head/sys/compat/x86bios/x86bios.c   Fri Mar 19 21:15:43 2010
(r205347)
@@ -56,18 +56,20 @@ __FBSDID("$FreeBSD$");
 
 #defineX86BIOS_IVT_SIZE0x0500  /* 1K + 256 (BDA) */
 #defineX86BIOS_SEG_SIZE0x0001  /* 64K */
-#defineX86BIOS_MEM_SIZE0x0010  /* 1M */
+#defineX86BIOS_MEM_SIZE(0x0010 + X86BIOS_SEG_SIZE)
+   /* 1M + 64K (high memory) */
 
 #defineX86BIOS_IVT_BASE0x
 #defineX86BIOS_RAM_BASE0x1000
-#defineX86BIOS_ROM_BASE0x000a  /* XXX EBDA? */
+#defineX86BIOS_ROM_BASE0x000a
 
-#defineX86BIOS_ROM_SIZE(X86BIOS_MEM_SIZE - X86BIOS_ROM_BASE)
+#defineX86BIOS_ROM_SIZE(X86BIOS_MEM_SIZE - 
(uint32_t)x86bios_rom_phys)
 
 #defineX86BIOS_PAGES   (X86BIOS_MEM_SIZE / X86BIOS_PAGE_SIZE)
 
 #defineX86BIOS_R_DS_pad1
 #defineX86BIOS_R_SS_pad2
+#defineX86BIOS_R_SP_pad3.I16_reg.x_reg
 
 static struct x86emu x86bios_emu;
 
@@ -79,11 +81,13 @@ static void *x86bios_seg;
 
 static vm_offset_t *x86bios_map;
 
+static vm_paddr_t x86bios_rom_phys;
 static vm_paddr_t x86bios_seg_phys;
 
 static int x86bios_fault;
 static uint32_t x86bios_fault_addr;
-static uint32_t x86bios_fault_inst;
+static uint16_t x86bios_fault_cs;
+static uint16_t x86bios_fault_ip;
 
 SYSCTL_NODE(_debug, OID_AUTO, x86bios, CTLFLAG_RD, NULL, "x86bios debugging");
 static int x86bios_trace_call;
@@ -101,7 +105,9 @@ x86bios_set_fault(struct x86emu *emu, ui
 
x86bios_fault = 1;
x86bios_fault_addr = addr;
-   x86bios_fault_inst = (emu->x86.R_CS << 4) + emu->x86.R_IP;
+   x86bios_fault_cs = emu->x86.R_CS;
+   x86bios_fault_ip = emu->x86.R_IP;
+   x86emu_halt_sys(emu);
 }
 
 static void *
@@ -136,10 +142,8 @@ x86bios_emu_rdb(struct x86emu *emu, uint
uint8_t *va;
 
va = x86bios_get_pages(addr, sizeof(*va));
-   if (va == NULL) {
+   if (va == NULL)
x86bios_set_fault(emu, addr);
-   x86emu_halt_sys(emu);
-   }
 
return (*va);
 }
@@ -150,11 +154,14 @@ x86bios_emu_rdw(struct x86emu *emu, uint
uint16_t *va;
 
va = x86bios_get_pages(addr, sizeof(*va));
-   if (va == NULL) {
+   if (va == NULL)
x86bios_set_fault(emu, addr);
-   x86emu_halt_sys(emu);
-   }
 
+#ifndef __NO_STRICT_ALIGNMENT
+   if ((addr & 1) != 0)
+   return (le16dec(va));
+   else
+#endif
return (le16toh(*va));
 }
 
@@ -164,11 +171,14 @@ x86bios_emu_rdl(struct x86emu *emu, uint
uint32_t *va;
 
va = x86bios_get_pages(addr, sizeof(*va));
-   if (va == NULL) {
+   if (va == NULL)
x86bios_set_fault(emu, addr);
-   x86emu_halt_sys(emu);
-   }
 
+#ifndef __NO_STRICT_ALIGNMENT
+   if ((addr & 3) != 0)
+   return (le32dec(va));
+   else
+#endif
return (le32toh(*va));
 }
 
@@ -178,10 +188,8 @@ x86bios_emu_wrb(struct x86emu *emu, uint
uint8_t *va;
 
va = x86bios_get_pages(addr, sizeof(*va));
-   if (va == NULL) {
+   if (va == NULL)
x86bios_set_fault(emu, addr);
-   x86emu_halt_sys(emu);
-   }
 
*va = val;
 }
@@ -192,11 +200,14 @@ x86bios_emu_wrw(struct x86emu *emu, uint
uint16_t *va;
 
va = x86bios_get_pages(addr, sizeof(*va));
-   if (va == NULL) {
+   if (va == NULL)
x86bios_set_fault(emu, addr);
-   x86emu_halt_sys(emu);
-   }
 
+#ifndef __NO_STRICT_ALIGNMENT
+   if ((addr & 1) != 0)
+   le16enc(va, val);
+   else
+#endif
*va = htole16(val);
 }
 
@@ -206,11 +217,14 @@ x86bios_emu_wrl(struct x86emu *emu, uint
uint32_t *va;
 
va = x86bios_get_pages(addr, sizeof(*va));
-   if (va == NULL) {
+   if (va == NULL)
x86bios_set_fault(emu, addr);
-   x86emu_halt_sys(emu);
-   }
 
+#ifndef __NO_STRICT_ALIGNMENT
+   if ((addr & 3) != 0)
+   le32enc(va, val);
+   else
+#endif
*va = htole32(val);
 }
 
@@ -306,7 +320,7 @@ x8

Re: svn commit: r205307 - head/sys/i386/conf

2010-03-19 Thread David Schultz
On Sat, Mar 20, 2010, Bruce Evans wrote:
> The effect of I486_CPU is especially small.
> It is:
> - statically disable use of the TSC in the bogus get_cyclecount() API.
>   Although the TSC is dynamically configured elsewhere, this function
>   wants to use the TSC without any dynamic tests, so it is uses static
>   configuration for efficiency.
> - avoid compiling in functions to initialize a 486.  There is dynamic
>   code to use these functions as needed, but this optimization saves
>   a few hundred if not a few thousand bytes.
> - panic if the CPU is an i486, since the necessary extra support for
>   an i486 (just the above 2 features) is not present.
> I586_CPU gives a little more.  E.g., support for fixing the F00F hardware
> bug on some Pentium1's.  Again there is dynamic configuration for this
> but a few hundred bytes are saved by not compiling it in.

Agreed, these options make very little difference right now, but
they *could* have a bigger impact.  Other operating systems have
completely deprecated older CPUs in order to take better advantage
of new features than FreeBSD does.  For instance, Solaris 10
requries CMPXCHG8B, which is needed to implement correct lock-free
queues that are efficient enough to be useful.  Supposedly this is
a big win under high contention.  Windows XP and later also
require CMPXCHG8B.

The catch, of course, is that if you write a scheduler to take
advantage of lock-free queues, expensive emulation (spinlocks)
will be required to make it work on hardware without the necessary
support.  Merely *having* a supported I486_CPU knob makes design
choices like these seem unattractive.  Another concrete example:
We don't properly save/restore the SSE state in setjmp() on i386
because it's cumbersome to do this and without breaking older CPUs.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r205354 - in head/sys: arm/conf arm/s3c2xx0 dev/usb/controller

2010-03-19 Thread Warner Losh
Author: imp
Date: Sat Mar 20 03:39:35 2010
New Revision: 205354
URL: http://svn.freebsd.org/changeset/base/205354

Log:
  Add support for the Samsung S3C2xx0 family of ARM SoCs written by
  Andrew Turner.  The kernel supports the LN2410SBC evaluation board,
  and likely others.  These parts (or similar ones) are in some open
  hardware designs for phones.
  
  Submitted by: Andrew Turner

Added:
  head/sys/arm/conf/LN2410SBC   (contents, props changed)
  head/sys/arm/s3c2xx0/
  head/sys/arm/s3c2xx0/board_ln2410sbc.c   (contents, props changed)
  head/sys/arm/s3c2xx0/files.s3c2xx0   (contents, props changed)
  head/sys/arm/s3c2xx0/s3c2410reg.h   (contents, props changed)
  head/sys/arm/s3c2xx0/s3c2410var.h   (contents, props changed)
  head/sys/arm/s3c2xx0/s3c2440reg.h   (contents, props changed)
  head/sys/arm/s3c2xx0/s3c24x0.c   (contents, props changed)
  head/sys/arm/s3c2xx0/s3c24x0_clk.c   (contents, props changed)
  head/sys/arm/s3c2xx0/s3c24x0_machdep.c   (contents, props changed)
  head/sys/arm/s3c2xx0/s3c24x0reg.h   (contents, props changed)
  head/sys/arm/s3c2xx0/s3c24x0var.h   (contents, props changed)
  head/sys/arm/s3c2xx0/s3c2xx0_space.c   (contents, props changed)
  head/sys/arm/s3c2xx0/s3c2xx0board.h   (contents, props changed)
  head/sys/arm/s3c2xx0/s3c2xx0reg.h   (contents, props changed)
  head/sys/arm/s3c2xx0/s3c2xx0var.h   (contents, props changed)
  head/sys/arm/s3c2xx0/std.ln2410sbc   (contents, props changed)
  head/sys/arm/s3c2xx0/std.s3c2410   (contents, props changed)
  head/sys/arm/s3c2xx0/uart_bus_s3c2410.c   (contents, props changed)
  head/sys/arm/s3c2xx0/uart_cpu_s3c2410.c   (contents, props changed)
  head/sys/arm/s3c2xx0/uart_dev_s3c2410.c   (contents, props changed)
  head/sys/arm/s3c2xx0/uart_dev_s3c2410.h   (contents, props changed)
  head/sys/dev/usb/controller/ohci_s3c24x0.c   (contents, props changed)

Added: head/sys/arm/conf/LN2410SBC
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm/conf/LN2410SBC Sat Mar 20 03:39:35 2010(r205354)
@@ -0,0 +1,87 @@
+# LN2410SBC -- Custom kernel configuration for the LN2410SBC
+#
+# For more information on this file, please read the handbook section on
+# Kernel Configuration Files:
+#
+#
http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html
+#
+# The handbook is also available locally in /usr/share/doc/handbook
+# if you've installed the doc distribution, otherwise always see the
+# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the
+# latest information.
+#
+# An exhaustive list of options and more detailed explanations of the
+# device lines is also present in the ../../conf/NOTES and NOTES files. 
+# If you are in doubt as to the purpose or necessity of a line, check first 
+# in NOTES.
+#
+# $FreeBSD$
+
+machinearm
+ident  LN2410SBC
+
+include"../s3c2xx0/std.ln2410sbc"
+#To statically compile in device wiring instead of /boot/device.hints
+#hints "GENERIC.hints" #Default places to look for devices.
+makeoptionsMODULES_OVERRIDE=""
+
+device board_ln2410sbc
+
+makeoptionsDEBUG=-g#Build kernel with gdb(1) debug symbols
+optionsHZ=100
+optionsDDB
+optionsKDB
+
+optionsSCHED_4BSD  #4BSD scheduler
+optionsINET#InterNETworking
+#options   INET6   #IPv6 communications protocols
+optionsFFS #Berkeley Fast Filesystem
+#options   SOFTUPDATES #Enable FFS soft updates support
+#options   UFS_ACL #Support for access control lists
+#options   UFS_DIRHASH #Improve performance on big directories
+#options   MD_ROOT #MD is a potential root device
+#options   MD_ROOT_SIZE=4096   # 4MB ram disk
+optionsROOTDEVNAME=\"ufs:da0s1\"
+
+#options   BOOTP
+#options   BOOTP_NFSROOT   # NFS mount root filesystem using BOOTP info
+#options   NFSCLIENT   #Network File System client
+#options   NFS_ROOT#NFS usable as root device
+
+optionsPSEUDOFS#Pseudo-filesystem framework
+#options   SCSI_DELAY=5000 #Delay (in ms) before probing SCSI
+optionsKTRACE  #ktrace(1) support
+optionsSYSVSHM #SYSV-style shared memory
+optionsSYSVMSG #SYSV-style message queues
+optionsSYSVSEM #SYSV-style semaphores
+options_KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions
+
+optionsMUTEX_NOINLINE
+optionsRWLOCK_NOINLINE
+optionsSX_NOINLINE
+
+optionsNO_FFS_SNAPSHOT
+optionsNO_SWAPPING
+device random
+device pty
+
+device loop
+device ether
+device bpf
+

svn commit: r205356 - head/sys/powerpc/powermac

2010-03-19 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Sat Mar 20 03:58:00 2010
New Revision: 205356
URL: http://svn.freebsd.org/changeset/base/205356

Log:
  Let unin(4) attach to U3 controllers found on G5 machines.
  
  Submitted by: Andreas Tobler

Modified:
  head/sys/powerpc/powermac/uninorth.c

Modified: head/sys/powerpc/powermac/uninorth.c
==
--- head/sys/powerpc/powermac/uninorth.cSat Mar 20 03:54:02 2010
(r205355)
+++ head/sys/powerpc/powermac/uninorth.cSat Mar 20 03:58:00 2010
(r205356)
@@ -611,7 +611,7 @@ unin_chip_probe(device_t dev)
if (name == NULL)
return (ENXIO);
 
-   if (strcmp(name, "uni-n") != 0)
+   if (strcmp(name, "uni-n") != 0 && strcmp(name, "u3") != 0)
return (ENXIO);
 
device_set_desc(dev, "Apple UniNorth System Controller");
@@ -622,7 +622,8 @@ static int
 unin_chip_attach(device_t dev)
 {
phandle_t node;
-   u_int reg[2];
+   u_int reg[3];
+   int i = 0;
 
uncsc = device_get_softc(dev);
node = ofw_bus_get_node(dev);
@@ -630,14 +631,18 @@ unin_chip_attach(device_t dev)
if (OF_getprop(node, "reg", reg, sizeof(reg)) < 8)
return (ENXIO);
 
-   uncsc->sc_physaddr = reg[0];
-   uncsc->sc_size = reg[1];
+   if (strcmp(ofw_bus_get_name(dev), "u3") == 0)
+   i = 1; /* #address-cells lies */
+
+   uncsc->sc_physaddr = reg[i];
+   uncsc->sc_size = reg[i+1];
 
/*
 * Only map the first page, since that is where the registers
 * of interest lie.
 */
-   uncsc->sc_addr = (vm_offset_t) pmap_mapdev(reg[0], PAGE_SIZE);
+   uncsc->sc_addr = (vm_offset_t) pmap_mapdev(uncsc->sc_physaddr,
+   PAGE_SIZE);
 
uncsc->sc_version = *(u_int *)uncsc->sc_addr;
device_printf(dev, "Version %d\n", uncsc->sc_version);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r205357 - head/sys/ia64/ia64

2010-03-19 Thread Marcel Moolenaar
Author: marcel
Date: Sat Mar 20 04:22:22 2010
New Revision: 205357
URL: http://svn.freebsd.org/changeset/base/205357

Log:
  Don't check for boot_verbose in the environment. The loader does
  that already and sets RB_VERBOSE. The loader has always done it.

Modified:
  head/sys/ia64/ia64/machdep.c

Modified: head/sys/ia64/ia64/machdep.c
==
--- head/sys/ia64/ia64/machdep.cSat Mar 20 03:58:00 2010
(r205356)
+++ head/sys/ia64/ia64/machdep.cSat Mar 20 04:22:22 2010
(r205357)
@@ -718,16 +718,6 @@ ia64_init(void)
 */
boothowto = bootinfo.bi_boothowto;
 
-   /*
-* Catch case of boot_verbose set in environment.
-*/
-   if ((p = getenv("boot_verbose")) != NULL) {
-   if (strcmp(p, "yes") == 0 || strcmp(p, "YES") == 0) {
-   boothowto |= RB_VERBOSE;
-   }
-   freeenv(p);
-   }
-
if (boothowto & RB_VERBOSE)
bootverbose = 1;
 
@@ -796,7 +786,7 @@ ia64_init(void)
init_param1();
 
p = getenv("kernelname");
-   if (p) {
+   if (p != NULL) {
strncpy(kernelname, p, sizeof(kernelname) - 1);
freeenv(p);
}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r205358 - head/sys/dev/siis

2010-03-19 Thread Alexander Motin
Author: mav
Date: Sat Mar 20 04:40:15 2010
New Revision: 205358
URL: http://svn.freebsd.org/changeset/base/205358

Log:
  Enable MSI by default for SiI3124.

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

Modified: head/sys/dev/siis/siis.c
==
--- head/sys/dev/siis/siis.cSat Mar 20 04:22:22 2010(r205357)
+++ head/sys/dev/siis/siis.cSat Mar 20 04:40:15 2010(r205358)
@@ -94,14 +94,15 @@ static struct {
int ports;
int quirks;
 #define SIIS_Q_SNTF1
+#define SIIS_Q_NOMSI   2
 } siis_ids[] = {
{0x31241095,"SiI3124",  4,  0},
{0x31248086,"SiI3124",  4,  0},
-   {0x31321095,"SiI3132",  2,  SIIS_Q_SNTF},
-   {0x02421095,"SiI3132",  2,  SIIS_Q_SNTF},
-   {0x02441095,"SiI3132",  2,  SIIS_Q_SNTF},
-   {0x31311095,"SiI3131",  1,  SIIS_Q_SNTF},
-   {0x35311095,"SiI3531",  1,  SIIS_Q_SNTF},
+   {0x31321095,"SiI3132",  2,  SIIS_Q_SNTF|SIIS_Q_NOMSI},
+   {0x02421095,"SiI3132",  2,  SIIS_Q_SNTF|SIIS_Q_NOMSI},
+   {0x02441095,"SiI3132",  2,  SIIS_Q_SNTF|SIIS_Q_NOMSI},
+   {0x31311095,"SiI3131",  1,  SIIS_Q_SNTF|SIIS_Q_NOMSI},
+   {0x35311095,"SiI3531",  1,  SIIS_Q_SNTF|SIIS_Q_NOMSI},
{0, NULL,   0,  0}
 };
 
@@ -249,7 +250,7 @@ static int
 siis_setup_interrupt(device_t dev)
 {
struct siis_controller *ctlr = device_get_softc(dev);
-   int msi = 0;
+   int msi = ctlr->quirks & SIIS_Q_NOMSI ? 0 : 1;
 
/* Process hints. */
resource_int_value(device_get_name(dev),
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r205360 - in head/sys/mips: include mips

2010-03-19 Thread Neel Natu
Author: neel
Date: Sat Mar 20 05:07:15 2010
New Revision: 205360
URL: http://svn.freebsd.org/changeset/base/205360

Log:
  This change enables use of physical memory that is beyond the direct
  mapped kseg0 region.
  
  The basic idea is to use KVA from the kseg2 region for mapping page
  table pages that lie beyond the direct mapped region.
  
  The TLB miss handler can now recursively fault into the TLB invalid
  handler if it dereferences a kseg2 page table page address that is not
  in the TLB.
  
  Tested by: JC (c.jayachand...@gmail.com)

Modified:
  head/sys/mips/include/db_machdep.h
  head/sys/mips/include/trap.h
  head/sys/mips/mips/db_trace.c
  head/sys/mips/mips/exception.S
  head/sys/mips/mips/pmap.c
  head/sys/mips/mips/trap.c

Modified: head/sys/mips/include/db_machdep.h
==
--- head/sys/mips/include/db_machdep.h  Sat Mar 20 05:06:47 2010
(r205359)
+++ head/sys/mips/include/db_machdep.h  Sat Mar 20 05:07:15 2010
(r205360)
@@ -92,7 +92,6 @@ db_addr_t next_instr_address(db_addr_t, 
 #defineDB_SMALL_VALUE_MIN  (-0x41)
 
 int db_inst_type(int);
-void db_dump_tlb(int, int);
 db_addr_t branch_taken(int inst, db_addr_t pc);
 void stacktrace_subr(register_t pc, register_t sp, register_t ra, int 
(*)(const char *, ...));
 int kdbpeek(int *);

Modified: head/sys/mips/include/trap.h
==
--- head/sys/mips/include/trap.hSat Mar 20 05:06:47 2010
(r205359)
+++ head/sys/mips/include/trap.hSat Mar 20 05:07:15 2010
(r205360)
@@ -111,11 +111,10 @@ void trapDump(char *msg);
 void MipsFPTrap(u_int, u_int, u_int);
 void MipsKernGenException(void);
 void MipsKernIntr(void);
-void MipsKernTLBInvalidException(void);
+void MipsTLBInvalidException(void);
 void MipsTLBMissException(void);
 void MipsUserGenException(void);
 void MipsUserIntr(void);
-void MipsUserTLBInvalidException(void);
 
 u_int trap(struct trapframe *);
 

Modified: head/sys/mips/mips/db_trace.c
==
--- head/sys/mips/mips/db_trace.c   Sat Mar 20 05:06:47 2010
(r205359)
+++ head/sys/mips/mips/db_trace.c   Sat Mar 20 05:07:15 2010
(r205360)
@@ -162,13 +162,10 @@ loop:
subr = (uintptr_t)MipsUserGenException;
else if (pcBetween(MipsKernIntr, MipsUserIntr))
subr = (uintptr_t)MipsKernIntr;
-   else if (pcBetween(MipsUserIntr, MipsKernTLBInvalidException))
+   else if (pcBetween(MipsUserIntr, MipsTLBInvalidException))
subr = (uintptr_t)MipsUserIntr;
-   else if (pcBetween(MipsKernTLBInvalidException,
-   MipsUserTLBInvalidException))
-   subr = (uintptr_t)MipsKernTLBInvalidException;
-   else if (pcBetween(MipsUserTLBInvalidException, MipsTLBMissException))
-   subr = (uintptr_t)MipsUserTLBInvalidException;
+   else if (pcBetween(MipsTLBInvalidException, MipsTLBMissException))
+   subr = (uintptr_t)MipsTLBInvalidException;
else if (pcBetween(fork_trampoline, savectx))
subr = (uintptr_t)fork_trampoline;
else if (pcBetween(savectx, mips_cpu_throw))

Modified: head/sys/mips/mips/exception.S
==
--- head/sys/mips/mips/exception.S  Sat Mar 20 05:06:47 2010
(r205359)
+++ head/sys/mips/mips/exception.S  Sat Mar 20 05:07:15 2010
(r205360)
@@ -264,13 +264,13 @@ SlowFault:
mfc0a0, COP_0_STATUS_REG;\
li  a2, (MIPS_SR_KX | MIPS_SR_SX | MIPS_SR_UX) ; \
or  a0, a0, a2  ; \
-   li  a2, ~(MIPS_SR_INT_IE|MIPS_SR_EXL)   ; \
+   li  a2, ~(MIPS_SR_INT_IE | MIPS_SR_EXL | SR_KSU_USER)   ; \
and a0, a0, a2  ; \
 mtc0a0, COP_0_STATUS_REG
 #else
 #define CLEAR_STATUS \
mfc0a0, COP_0_STATUS_REG;\
-   li  a2, ~(MIPS_SR_INT_IE|MIPS_SR_EXL)   ; \
+   li  a2, ~(MIPS_SR_INT_IE | MIPS_SR_EXL | SR_KSU_USER)   ; \
and a0, a0, a2  ; \
mtc0a0, COP_0_STATUS_REG
 #endif
@@ -827,177 +827,168 @@ NNON_LEAF(MipsUserIntr, STAND_FRAME_SIZE
.setat
 END(MipsUserIntr)
 
-NLEAF(MipsKernTLBInvalidException)
-   .setnoat
-   mfc0k0, COP_0_BAD_VADDR # get the fault address
-
+NLEAF(MipsTLBInvalidException)
+   .set push
+   .set noat
+   .set noreorder
 
+   mfc0k0, COP_0_BAD_VADDR
li  k1, VM_MAXUSER_ADDRESS
sltuk1, k0, k1
-   beqzk1, 1f
-   nop
-   GET_CPU_PCPU(k1)
-   lw  k1, PC_SEGBASE(k1)   # works for single cpu
-   beqzk1, _C_LABEL(MipsKernGenException)   # seg tab is null
+   bnezk1, 1f
nop
+
+   /* badvaddr = kernel address */
+ 

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

2010-03-19 Thread Neel Natu
Author: neel
Date: Sat Mar 20 05:10:44 2010
New Revision: 205361
URL: http://svn.freebsd.org/changeset/base/205361

Log:
  Get rid of unused macro MIPS_MEM_RID.
  
  Suggested by: Alexandr Rybalko (r...@dlink.ua)

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

Modified: head/sys/mips/mips/nexus.c
==
--- head/sys/mips/mips/nexus.c  Sat Mar 20 05:07:15 2010(r205360)
+++ head/sys/mips/mips/nexus.c  Sat Mar 20 05:10:44 2010(r205361)
@@ -73,7 +73,6 @@ struct nexus_device {
 
 #define DEVTONX(dev)   ((struct nexus_device *)device_get_ivars(dev))
 #define NUM_MIPS_IRQS  6
-#define MIPS_MEM_RID   0x20
 
 static struct rman irq_rman;
 static struct rman mem_rman;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r205363 - head/sys/mips/sibyte

2010-03-19 Thread Neel Natu
Author: neel
Date: Sat Mar 20 05:21:14 2010
New Revision: 205363
URL: http://svn.freebsd.org/changeset/base/205363

Log:
  Make sure that the registers 'v0' and 'v1' are properly sign-extended
  when sb_load64() returns.
  
  Some 32-bit arithmetic operations (e.g. subu) have unpredicatable results
  when operating on 64-bit registers that are not properly sign-extended.

Modified:
  head/sys/mips/sibyte/sb_asm.S

Modified: head/sys/mips/sibyte/sb_asm.S
==
--- head/sys/mips/sibyte/sb_asm.S   Sat Mar 20 05:11:56 2010
(r205362)
+++ head/sys/mips/sibyte/sb_asm.S   Sat Mar 20 05:21:14 2010
(r205363)
@@ -53,14 +53,14 @@ LEAF(sb_load64)
movev0, v1
 #if _BYTE_ORDER == _BIG_ENDIAN
dsll32  v1, v1, 0
-   dsrl32  v1, v1, 0   /* v1 = lower_uint32(result) */
+   dsra32  v1, v1, 0   /* v1 = lower_uint32(result) */
jr  ra
-   dsrl32  v0, v0, 0   /* v0 = upper_uint32(result) */
+   dsra32  v0, v0, 0   /* v0 = upper_uint32(result) */
 #else
dsll32  v0, v0, 0
-   dsrl32  v0, v0, 0   /* v0 = lower_uint32(result) */
+   dsra32  v0, v0, 0   /* v0 = lower_uint32(result) */
jr  ra
-   dsrl32  v1, v1, 0   /* v1 = upper_uint32(result) */
+   dsra32  v1, v1, 0   /* v1 = upper_uint32(result) */
 #endif
 END(sb_load64)
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r205364 - in head/sys/mips: include mips sibyte

2010-03-19 Thread Neel Natu
Author: neel
Date: Sat Mar 20 05:49:06 2010
New Revision: 205364
URL: http://svn.freebsd.org/changeset/base/205364

Log:
  Sibyte provides a 64-bit read-only counter that counts at half the processor
  frequency. This counter can be accessed coherently from both cores.
  
  Use this as the preferred timecounter for the SWARM kernels.
  
  The CP0 COUNT register is unusable as the timecounter on SMP platforms because
  the COUNT registers on different CPUs are not guaranteed to be in sync.

Modified:
  head/sys/mips/include/clock.h
  head/sys/mips/mips/tick.c
  head/sys/mips/sibyte/sb_machdep.c
  head/sys/mips/sibyte/sb_scd.c
  head/sys/mips/sibyte/sb_scd.h

Modified: head/sys/mips/include/clock.h
==
--- head/sys/mips/include/clock.h   Sat Mar 20 05:21:14 2010
(r205363)
+++ head/sys/mips/include/clock.h   Sat Mar 20 05:49:06 2010
(r205364)
@@ -34,6 +34,14 @@ void mips_timer_init_params(uint64_t, in
 extern uint64_tcounter_freq;
 extern int clocks_running;
 
+/*
+ * The 'platform_timecounter' pointer may be used to register a
+ * platform-specific timecounter.
+ *
+ * A default timecounter based on the CP0 COUNT register is always registered.
+ */
+extern struct timecounter *platform_timecounter;
+
 #endif
 
 #endif /* !_MACHINE_CLOCK_H_ */

Modified: head/sys/mips/mips/tick.c
==
--- head/sys/mips/mips/tick.c   Sat Mar 20 05:21:14 2010(r205363)
+++ head/sys/mips/mips/tick.c   Sat Mar 20 05:49:06 2010(r205364)
@@ -54,6 +54,8 @@ __FBSDID("$FreeBSD$");
 
 uint64_t counter_freq;
 
+struct timecounter *platform_timecounter;
+
 static uint64_t cycles_per_tick;
 static uint64_t cycles_per_usec;
 static uint64_t cycles_per_hz, cycles_per_stathz, cycles_per_profhz;
@@ -103,6 +105,9 @@ platform_initclocks(void)
 {
 
tc_init(&counter_timecounter);
+
+   if (platform_timecounter != NULL)
+   tc_init(platform_timecounter);
 }
 
 static uint64_t

Modified: head/sys/mips/sibyte/sb_machdep.c
==
--- head/sys/mips/sibyte/sb_machdep.c   Sat Mar 20 05:21:14 2010
(r205363)
+++ head/sys/mips/sibyte/sb_machdep.c   Sat Mar 20 05:49:06 2010
(r205364)
@@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -364,6 +365,32 @@ platform_start_ap(int cpuid)
 }
 #endif /* SMP */
 
+static u_int
+sb_get_timecount(struct timecounter *tc)
+{
+
+   return ((u_int)sb_zbbus_cycle_count());
+}
+
+static void
+sb_timecounter_init(void)
+{
+   static struct timecounter sb_timecounter = {
+   sb_get_timecount,
+   NULL,
+   ~0u,
+   0,
+   "sibyte_zbbus_counter",
+   2000
+   };
+
+   /*
+* The ZBbus cycle counter runs at half the cpu frequency.
+*/
+   sb_timecounter.tc_frequency = sb_cpu_speed() / 2;
+   platform_timecounter = &sb_timecounter;
+}
+
 void
 platform_start(__register_t a0, __register_t a1, __register_t a2,
   __register_t a3)
@@ -378,6 +405,7 @@ platform_start(__register_t a0, __regist
mips_postboot_fixup();
 
sb_intr_init(0);
+   sb_timecounter_init();
 
/* Initialize pcpu stuff */
mips_pcpu0_init();
@@ -400,4 +428,6 @@ platform_start(__register_t a0, __regist
mips_init();
 
mips_timer_init_params(sb_cpu_speed(), 0);
+
+   set_cputicker(sb_zbbus_cycle_count, sb_cpu_speed() / 2, 1);
 }

Modified: head/sys/mips/sibyte/sb_scd.c
==
--- head/sys/mips/sibyte/sb_scd.c   Sat Mar 20 05:21:14 2010
(r205363)
+++ head/sys/mips/sibyte/sb_scd.c   Sat Mar 20 05:49:06 2010
(r205364)
@@ -56,6 +56,8 @@ extern uint64_t   sb_load64(uint32_t addr)
 #defineSYSCFG_ADDR MIPS_PHYS_TO_KSEG1(0x10020008)
 #define SYSCFG_PLLDIV(x)   GET_VAL_64((x), 7, 5)
 
+#defineZBBUS_CYCLE_COUNT_ADDR  MIPS_PHYS_TO_KSEG1(0x1003)
+
 #defineINTSRC_MASK_ADDR(cpu)   \
(MIPS_PHYS_TO_KSEG1(0x10020028) | ((cpu) << 13))
 
@@ -83,6 +85,13 @@ sb_write_syscfg(uint64_t val)
 }
 
 uint64_t
+sb_zbbus_cycle_count(void)
+{
+
+   return (sb_load64(ZBBUS_CYCLE_COUNT_ADDR));
+}
+
+uint64_t
 sb_cpu_speed(void)
 {
int plldiv;

Modified: head/sys/mips/sibyte/sb_scd.h
==
--- head/sys/mips/sibyte/sb_scd.h   Sat Mar 20 05:21:14 2010
(r205363)
+++ head/sys/mips/sibyte/sb_scd.h   Sat Mar 20 05:49:06 2010
(r205364)
@@ -31,6 +31,7 @@
 
 #defineNUM_INTSRC  64  /* total number of interrupt 
sources */
 
+uint64_t   sb_zbbus_cycle_count(void);
 uint64_t   sb_cpu_speed