Date: Fri, 22 Sep 2006 17:13:18 GMT From: Matt Jacob <mjacob@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 106512 for review Message-ID: <200609221713.k8MHDIHP039216@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=106512 Change 106512 by mjacob@newisp on 2006/09/22 17:12:22 IFC Affected files ... .. //depot/projects/newisp/amd64/include/stdarg.h#2 integrate .. //depot/projects/newisp/amd64/isa/atpic_vector.S#2 integrate .. //depot/projects/newisp/arm/include/stdarg.h#2 integrate .. //depot/projects/newisp/bsm/audit.h#2 integrate .. //depot/projects/newisp/bsm/audit_internal.h#3 integrate .. //depot/projects/newisp/bsm/audit_kevents.h#2 integrate .. //depot/projects/newisp/bsm/audit_record.h#3 integrate .. //depot/projects/newisp/compat/freebsd32/freebsd32.h#2 integrate .. //depot/projects/newisp/compat/freebsd32/freebsd32_misc.c#2 integrate .. //depot/projects/newisp/compat/freebsd32/freebsd32_proto.h#5 integrate .. //depot/projects/newisp/compat/freebsd32/freebsd32_syscall.h#5 integrate .. //depot/projects/newisp/compat/freebsd32/freebsd32_syscalls.c#5 integrate .. //depot/projects/newisp/compat/freebsd32/freebsd32_sysent.c#5 integrate .. //depot/projects/newisp/compat/freebsd32/syscalls.master#5 integrate .. //depot/projects/newisp/conf/NOTES#3 integrate .. //depot/projects/newisp/conf/options#2 integrate .. //depot/projects/newisp/dev/acpica/acpi.c#3 integrate .. //depot/projects/newisp/dev/bce/if_bce.c#3 integrate .. //depot/projects/newisp/dev/em/if_em.c#8 integrate .. //depot/projects/newisp/dev/kbdmux/kbdmux.c#3 integrate .. //depot/projects/newisp/dev/mfi/mfi.c#4 integrate .. //depot/projects/newisp/dev/mfi/mfivar.h#2 integrate .. //depot/projects/newisp/dev/mpt/mpt_cam.c#5 integrate .. //depot/projects/newisp/dev/pci/pci.c#2 integrate .. //depot/projects/newisp/dev/usb/if_cdce.c#3 integrate .. //depot/projects/newisp/i386/include/stdarg.h#2 integrate .. //depot/projects/newisp/i386/isa/atpic_vector.s#2 integrate .. //depot/projects/newisp/i386/linux/linux_machdep.c#3 integrate .. //depot/projects/newisp/i386/linux/linux_proto.h#3 integrate .. //depot/projects/newisp/i386/linux/linux_syscall.h#3 integrate .. //depot/projects/newisp/i386/linux/linux_sysent.c#3 integrate .. //depot/projects/newisp/i386/linux/syscalls.master#3 integrate .. //depot/projects/newisp/ia64/include/stdarg.h#2 integrate .. //depot/projects/newisp/kern/init_sysent.c#5 integrate .. //depot/projects/newisp/kern/kern_mac.c#2 integrate .. //depot/projects/newisp/kern/kern_resource.c#2 integrate .. //depot/projects/newisp/kern/kern_thr.c#2 integrate .. //depot/projects/newisp/kern/kern_umtx.c#6 integrate .. //depot/projects/newisp/kern/syscalls.c#5 integrate .. //depot/projects/newisp/kern/syscalls.master#5 integrate .. //depot/projects/newisp/kern/systrace_args.c#5 integrate .. //depot/projects/newisp/kern/sysv_msg.c#2 integrate .. //depot/projects/newisp/kern/sysv_sem.c#2 integrate .. //depot/projects/newisp/kern/sysv_shm.c#2 integrate .. //depot/projects/newisp/kern/tty.c#3 integrate .. //depot/projects/newisp/kern/uipc_mbuf.c#2 integrate .. //depot/projects/newisp/kern/uipc_socket.c#4 integrate .. //depot/projects/newisp/kern/vfs_default.c#2 integrate .. //depot/projects/newisp/kern/vfs_syscalls.c#3 integrate .. //depot/projects/newisp/net/if_loop.c#2 integrate .. //depot/projects/newisp/netinet6/in6.c#2 integrate .. //depot/projects/newisp/powerpc/include/stdarg.h#2 integrate .. //depot/projects/newisp/security/audit/audit_bsm.c#5 integrate .. //depot/projects/newisp/security/audit/audit_bsm_token.c#3 integrate .. //depot/projects/newisp/security/audit/audit_worker.c#3 integrate .. //depot/projects/newisp/security/mac/mac_inet.c#3 integrate .. //depot/projects/newisp/security/mac/mac_internal.h#3 integrate .. //depot/projects/newisp/security/mac/mac_net.c#2 integrate .. //depot/projects/newisp/security/mac/mac_pipe.c#2 integrate .. //depot/projects/newisp/security/mac/mac_posix_sem.c#2 integrate .. //depot/projects/newisp/security/mac/mac_process.c#2 integrate .. //depot/projects/newisp/security/mac/mac_socket.c#2 integrate .. //depot/projects/newisp/security/mac/mac_sysv_msg.c#2 integrate .. //depot/projects/newisp/security/mac/mac_sysv_sem.c#2 integrate .. //depot/projects/newisp/security/mac/mac_sysv_shm.c#2 integrate .. //depot/projects/newisp/security/mac/mac_vfs.c#2 integrate .. //depot/projects/newisp/sparc64/include/stdarg.h#2 integrate .. //depot/projects/newisp/sparc64/sparc64/pmap.c#2 integrate .. //depot/projects/newisp/sparc64/sparc64/tsb.c#2 integrate .. //depot/projects/newisp/sys/cdefs.h#2 integrate .. //depot/projects/newisp/sys/rtprio.h#2 integrate .. //depot/projects/newisp/sys/syscall.h#5 integrate .. //depot/projects/newisp/sys/syscall.mk#5 integrate .. //depot/projects/newisp/sys/sysproto.h#5 integrate .. //depot/projects/newisp/sys/thr.h#2 integrate .. //depot/projects/newisp/sys/umtx.h#3 integrate .. //depot/projects/newisp/ufs/ffs/ffs_softdep.c#2 integrate Differences ... ==== //depot/projects/newisp/amd64/include/stdarg.h#2 (text+ko) ==== @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/amd64/include/stdarg.h,v 1.8 2005/03/11 22:16:09 peter Exp $ + * $FreeBSD: src/sys/amd64/include/stdarg.h,v 1.9 2006/09/21 01:37:01 kan Exp $ */ #ifndef _MACHINE_STDARG_H_ @@ -42,7 +42,7 @@ #ifdef __GNUCLIKE_BUILTIN_STDARG #define va_start(ap, last) \ - __builtin_stdarg_start((ap), (last)) + __builtin_va_start((ap), (last)) #define va_arg(ap, type) \ __builtin_va_arg((ap), type) ==== //depot/projects/newisp/amd64/isa/atpic_vector.S#2 (text+ko) ==== @@ -28,7 +28,7 @@ * SUCH DAMAGE. * * from: vector.s, 386BSD 0.1 unknown origin - * $FreeBSD: src/sys/amd64/isa/atpic_vector.S,v 1.46 2005/12/08 18:33:30 jhb Exp $ + * $FreeBSD: src/sys/amd64/isa/atpic_vector.S,v 1.47 2006/09/20 20:52:11 wkoszek Exp $ */ /* @@ -41,7 +41,7 @@ #include "assym.s" /* - * Macros for interrupt interrupt entry, call to handler, and exit. + * Macros for interrupt entry, call to handler, and exit. */ #define INTR(irq_num, vec_name) \ .text ; \ ==== //depot/projects/newisp/arm/include/stdarg.h#2 (text+ko) ==== @@ -28,7 +28,7 @@ * SUCH DAMAGE. * * @(#)stdarg.h 8.1 (Berkeley) 6/10/93 - * $FreeBSD: src/sys/arm/include/stdarg.h,v 1.3 2005/03/02 21:33:22 joerg Exp $ + * $FreeBSD: src/sys/arm/include/stdarg.h,v 1.4 2006/09/21 01:37:02 kan Exp $ */ #ifndef _MACHINE_STDARG_H_ @@ -45,7 +45,7 @@ #ifdef __GNUCLIKE_BUILTIN_STDARG #define va_start(ap, last) \ - __builtin_stdarg_start((ap), (last)) + __builtin_va_start((ap), (last)) #define va_arg(ap, type) \ __builtin_va_arg((ap), type) ==== //depot/projects/newisp/bsm/audit.h#2 (text) ==== @@ -30,8 +30,8 @@ * * @APPLE_BSD_LICENSE_HEADER_END@ * - * $P4: //depot/projects/trustedbsd/audit3/sys/bsm/audit.h#31 $ - * $FreeBSD: src/sys/bsm/audit.h,v 1.5 2006/08/26 08:17:58 rwatson Exp $ + * $P4: //depot/projects/trustedbsd/audit3/sys/bsm/audit.h#34 $ + * $FreeBSD: src/sys/bsm/audit.h,v 1.6 2006/09/21 07:27:02 rwatson Exp $ */ #ifndef _BSM_AUDIT_H @@ -59,23 +59,19 @@ * Triggers for the audit daemon. */ #define AUDIT_TRIGGER_MIN 1 -#define AUDIT_TRIGGER_LOW_SPACE 1 -#define AUDIT_TRIGGER_OPEN_NEW 2 -#define AUDIT_TRIGGER_READ_FILE 3 -#define AUDIT_TRIGGER_CLOSE_AND_DIE 4 -#define AUDIT_TRIGGER_NO_SPACE 5 -#define AUDIT_TRIGGER_MAX 5 +#define AUDIT_TRIGGER_LOW_SPACE 1 /* Below low watermark. */ +#define AUDIT_TRIGGER_ROTATE_KERNEL 2 /* Kernel requests rotate. */ +#define AUDIT_TRIGGER_READ_FILE 3 /* Re-read config file. */ +#define AUDIT_TRIGGER_CLOSE_AND_DIE 4 /* Terminate audit. */ +#define AUDIT_TRIGGER_NO_SPACE 5 /* Below min free space. */ +#define AUDIT_TRIGGER_ROTATE_USER 6 /* User requests roate. */ +#define AUDIT_TRIGGER_MAX 6 /* - * Special file that will be read for trigger events from the kernel - * (FreeBSD). + * The special device filename (FreeBSD). */ -#define AUDIT_TRIGGER_FILE "/dev/audit" - -/* - * The special device filename. - */ #define AUDITDEV_FILENAME "audit" +#define AUDIT_TRIGGER_FILE ("/dev/" AUDITDEV_FILENAME) /* * Pre-defined audit IDs @@ -182,12 +178,12 @@ #define AUDIT_PERZONE 0x2000 /* - * Audit queue control parameters. + * Default audit queue control parameters. */ #define AQ_HIWATER 100 #define AQ_MAXHIGH 10000 #define AQ_LOWATER 10 -#define AQ_BUFSZ 1024 +#define AQ_BUFSZ MAXAUDITDATA #define AQ_MAXBUFSZ 1048576 /* ==== //depot/projects/newisp/bsm/audit_internal.h#3 (text) ==== @@ -34,8 +34,8 @@ * * @APPLE_BSD_LICENSE_HEADER_END@ * - * $P4: //depot/projects/trustedbsd/audit3/sys/bsm/audit_internal.h#11 $ - * $FreeBSD: src/sys/bsm/audit_internal.h,v 1.4 2006/09/02 10:49:44 rwatson Exp $ + * $P4: //depot/projects/trustedbsd/audit3/sys/bsm/audit_internal.h#14 $ + * $FreeBSD: src/sys/bsm/audit_internal.h,v 1.5 2006/09/21 07:27:02 rwatson Exp $ */ #ifndef _AUDIT_INTERNAL_H ==== //depot/projects/newisp/bsm/audit_kevents.h#2 (text) ==== @@ -30,8 +30,8 @@ * * @APPLE_BSD_LICENSE_HEADER_END@ * - * $P4: //depot/projects/trustedbsd/audit3/sys/bsm/audit_kevents.h#26 $ - * $FreeBSD: src/sys/bsm/audit_kevents.h,v 1.7 2006/08/26 08:17:58 rwatson Exp $ + * $P4: //depot/projects/trustedbsd/audit3/sys/bsm/audit_kevents.h#28 $ + * $FreeBSD: src/sys/bsm/audit_kevents.h,v 1.8 2006/09/21 07:27:02 rwatson Exp $ */ #ifndef _BSM_AUDIT_KEVENTS_H_ @@ -468,6 +468,9 @@ #define AUE_EXTATTR_SET_LINK 43111 /* FreeBSD. */ #define AUE_EXTATTR_LIST_LINK 43112 /* FreeBSD. */ #define AUE_EXTATTR_DELETE_LINK 43113 /* FreeBSD. */ +#define AUE_KENV 43114 /* FreeBSD. */ +#define AUE_JAIL_ATTACH 43115 /* FreeBSD. */ +#define AUE_SYSCTL_WRITE 43116 /* FreeBSD. */ /* * Darwin BSM uses a number of AUE_O_* definitions, which are aliased to the ==== //depot/projects/newisp/bsm/audit_record.h#3 (text) ==== @@ -30,8 +30,8 @@ * * @APPLE_BSD_LICENSE_HEADER_END@ * - * $P4: //depot/projects/trustedbsd/audit3/sys/bsm/audit_record.h#19 $ - * $FreeBSD: src/sys/bsm/audit_record.h,v 1.5 2006/09/01 11:45:39 wsalamon Exp $ + * $P4: //depot/projects/trustedbsd/audit3/sys/bsm/audit_record.h#21 $ + * $FreeBSD: src/sys/bsm/audit_record.h,v 1.6 2006/09/21 07:27:02 rwatson Exp $ */ #ifndef _BSM_AUDIT_RECORD_H_ ==== //depot/projects/newisp/compat/freebsd32/freebsd32.h#2 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/compat/freebsd32/freebsd32.h,v 1.5 2006/08/17 22:50:32 imp Exp $ + * $FreeBSD: src/sys/compat/freebsd32/freebsd32.h,v 1.6 2006/09/22 15:04:28 davidxu Exp $ */ #ifndef _COMPAT_FREEBSD32_FREEBSD32_H_ @@ -103,4 +103,18 @@ int32_t f_spare[2]; }; +struct thr_param32 { + uint32_t start_func; + uint32_t arg; + uint32_t stack_base; + uint32_t stack_size; + uint32_t tls_base; + uint32_t tls_size; + uint32_t child_tid; + uint32_t parent_tid; + int32_t flags; + uint32_t rtp; + uint32_t spare[3]; +}; + #endif /* !_COMPAT_FREEBSD32_FREEBSD32_H_ */ ==== //depot/projects/newisp/compat/freebsd32/freebsd32_misc.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/compat/freebsd32/freebsd32_misc.c,v 1.58 2006/08/16 00:02:36 jkim Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/freebsd32/freebsd32_misc.c,v 1.59 2006/09/22 15:04:28 davidxu Exp $"); #include "opt_compat.h" @@ -67,7 +67,9 @@ #include <sys/sysent.h> #include <sys/sysproto.h> #include <sys/systm.h> +#include <sys/thr.h> #include <sys/unistd.h> +#include <sys/ucontext.h> #include <sys/vnode.h> #include <sys/wait.h> #include <sys/ipc.h> @@ -2121,6 +2123,60 @@ return (error); } +int +freebsd32_thr_new(struct thread *td, + struct freebsd32_thr_new_args *uap) +{ + struct thr_param32 param32; + struct thr_param param; + int error; + + if (uap->param_size < 0 || + uap->param_size > sizeof(struct thr_param32)) + return (EINVAL); + bzero(¶m, sizeof(struct thr_param)); + bzero(¶m32, sizeof(struct thr_param32)); + error = copyin(uap->param, ¶m32, uap->param_size); + if (error != 0) + return (error); + param.start_func = PTRIN(param32.start_func); + param.arg = PTRIN(param32.arg); + param.stack_base = PTRIN(param32.stack_base); + param.stack_size = param32.stack_size; + param.tls_base = PTRIN(param32.tls_base); + param.tls_size = param32.tls_size; + param.child_tid = PTRIN(param32.child_tid); + param.parent_tid = PTRIN(param32.parent_tid); + param.flags = param32.flags; + param.rtp = PTRIN(param32.rtp); + param.spare[0] = PTRIN(param32.spare[0]); + param.spare[1] = PTRIN(param32.spare[1]); + param.spare[2] = PTRIN(param32.spare[2]); + + return (kern_thr_new(td, ¶m)); +} + +int +freebsd32_thr_suspend(struct thread *td, struct freebsd32_thr_suspend_args *uap) +{ + struct timespec32 ts32; + struct timespec ts, *tsp; + int error; + + error = 0; + tsp = NULL; + if (uap->timeout != NULL) { + error = copyin((const void *)uap->timeout, (void *)&ts32, + sizeof(struct timespec32)); + if (error != 0) + return (error); + ts.tv_sec = ts32.tv_sec; + ts.tv_nsec = ts32.tv_nsec; + tsp = &ts; + } + return (kern_thr_suspend(td, tsp)); +} + #if 0 int ==== //depot/projects/newisp/compat/freebsd32/freebsd32_proto.h#5 (text+ko) ==== @@ -2,8 +2,8 @@ * System call prototypes. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/compat/freebsd32/freebsd32_proto.h,v 1.62 2006/09/17 13:29:35 rwatson Exp $ - * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.75 2006/09/17 13:28:11 rwatson Exp + * $FreeBSD: src/sys/compat/freebsd32/freebsd32_proto.h,v 1.65 2006/09/22 15:05:33 davidxu Exp $ + * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.78 2006/09/22 15:04:28 davidxu Exp */ #ifndef _FREEBSD32_SYSPROTO_H_ @@ -280,6 +280,20 @@ char oucp_l_[PADL_(struct freebsd32_ucontext *)]; struct freebsd32_ucontext * oucp; char oucp_r_[PADR_(struct freebsd32_ucontext *)]; char ucp_l_[PADL_(const struct freebsd32_ucontext *)]; const struct freebsd32_ucontext * ucp; char ucp_r_[PADR_(const struct freebsd32_ucontext *)]; }; +struct freebsd32_thr_suspend_args { + char timeout_l_[PADL_(const struct timespec32 *)]; const struct timespec32 * timeout; char timeout_r_[PADR_(const struct timespec32 *)]; +}; +struct freebsd32_umtx_op_args { + char obj_l_[PADL_(void *)]; void * obj; char obj_r_[PADR_(void *)]; + char op_l_[PADL_(int)]; int op; char op_r_[PADR_(int)]; + char val_l_[PADL_(uintptr_t)]; uintptr_t val; char val_r_[PADR_(uintptr_t)]; + char uaddr_l_[PADL_(void *)]; void * uaddr; char uaddr_r_[PADR_(void *)]; + char uaddr2_l_[PADL_(void *)]; void * uaddr2; char uaddr2_r_[PADR_(void *)]; +}; +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)]; +}; int freebsd32_wait4(struct thread *, struct freebsd32_wait4_args *); int freebsd32_recvmsg(struct thread *, struct freebsd32_recvmsg_args *); int freebsd32_sendmsg(struct thread *, struct freebsd32_sendmsg_args *); @@ -326,6 +340,9 @@ int freebsd32_getcontext(struct thread *, struct freebsd32_getcontext_args *); int freebsd32_setcontext(struct thread *, struct freebsd32_setcontext_args *); int freebsd32_swapcontext(struct thread *, struct freebsd32_swapcontext_args *); +int freebsd32_thr_suspend(struct thread *, struct freebsd32_thr_suspend_args *); +int freebsd32_umtx_op(struct thread *, struct freebsd32_umtx_op_args *); +int freebsd32_thr_new(struct thread *, struct freebsd32_thr_new_args *); #ifdef COMPAT_43 @@ -461,6 +478,9 @@ #define FREEBSD32_SYS_AUE_freebsd32_getcontext AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_setcontext AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_swapcontext AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_thr_suspend AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_umtx_op AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_thr_new AUE_NULL #undef PAD_ #undef PADL_ ==== //depot/projects/newisp/compat/freebsd32/freebsd32_syscall.h#5 (text+ko) ==== @@ -2,8 +2,8 @@ * System call numbers. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/compat/freebsd32/freebsd32_syscall.h,v 1.60 2006/09/17 13:29:35 rwatson Exp $ - * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.75 2006/09/17 13:28:11 rwatson Exp + * $FreeBSD: src/sys/compat/freebsd32/freebsd32_syscall.h,v 1.63 2006/09/22 15:05:33 davidxu Exp $ + * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.78 2006/09/22 15:04:28 davidxu Exp */ #define FREEBSD32_SYS_syscall 0 @@ -300,20 +300,19 @@ #define FREEBSD32_SYS_freebsd32_getcontext 421 #define FREEBSD32_SYS_freebsd32_setcontext 422 #define FREEBSD32_SYS_freebsd32_swapcontext 423 -#define FREEBSD32_SYS_thr_create 430 #define FREEBSD32_SYS_thr_exit 431 #define FREEBSD32_SYS_thr_self 432 #define FREEBSD32_SYS_thr_kill 433 #define FREEBSD32_SYS__umtx_lock 434 #define FREEBSD32_SYS__umtx_unlock 435 #define FREEBSD32_SYS_jail_attach 436 -#define FREEBSD32_SYS_thr_suspend 442 +#define FREEBSD32_SYS_freebsd32_thr_suspend 442 #define FREEBSD32_SYS_thr_wake 443 #define FREEBSD32_SYS_kldunloadf 444 +#define FREEBSD32_SYS_freebsd32_umtx_op 454 +#define FREEBSD32_SYS_freebsd32_thr_new 455 #define FREEBSD32_SYS_sigqueue 456 #define FREEBSD32_SYS_abort2 463 #define FREEBSD32_SYS_thr_set_name 464 -#define FREEBSD32_SYS_thr_setscheduler 466 -#define FREEBSD32_SYS_thr_getscheduler 467 -#define FREEBSD32_SYS_thr_setschedparam 468 +#define FREEBSD32_SYS_rtprio_thread 466 #define FREEBSD32_SYS_MAXSYSCALL 471 ==== //depot/projects/newisp/compat/freebsd32/freebsd32_syscalls.c#5 (text+ko) ==== @@ -2,8 +2,8 @@ * System call names. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/compat/freebsd32/freebsd32_syscalls.c,v 1.51 2006/09/17 13:29:35 rwatson Exp $ - * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.75 2006/09/17 13:28:11 rwatson Exp + * $FreeBSD: src/sys/compat/freebsd32/freebsd32_syscalls.c,v 1.54 2006/09/22 15:05:33 davidxu Exp $ + * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.78 2006/09/22 15:04:28 davidxu Exp */ const char *freebsd32_syscallnames[] = { @@ -437,7 +437,7 @@ "#427", /* 427 = __acl_delete_link */ "#428", /* 428 = __acl_aclcheck_link */ "#429", /* 429 = sigwait */ - "thr_create", /* 430 = thr_create */ + "#430", /* 430 = thr_create; */ "thr_exit", /* 431 = thr_exit */ "thr_self", /* 432 = thr_self */ "thr_kill", /* 433 = thr_kill */ @@ -449,7 +449,7 @@ "#439", /* 439 = extattr_list_link */ "#440", /* 440 = kse_switchin */ "#441", /* 441 = ksem_timedwait */ - "thr_suspend", /* 442 = thr_suspend */ + "freebsd32_thr_suspend", /* 442 = freebsd32_thr_suspend */ "thr_wake", /* 443 = thr_wake */ "kldunloadf", /* 444 = kldunloadf */ "#445", /* 445 = audit */ @@ -461,8 +461,8 @@ "#451", /* 451 = getaudit_addr */ "#452", /* 452 = setaudit_addr */ "#453", /* 453 = auditctl */ - "#454", /* 454 = _umtx_op */ - "#455", /* 455 = thr_new */ + "freebsd32_umtx_op", /* 454 = freebsd32_umtx_op */ + "freebsd32_thr_new", /* 455 = freebsd32_thr_new */ "sigqueue", /* 456 = sigqueue */ "#457", /* 457 = kmq_open */ "#458", /* 458 = kmq_setattr */ @@ -473,9 +473,9 @@ "abort2", /* 463 = abort2 */ "thr_set_name", /* 464 = thr_set_name */ "#465", /* 465 = aio_fsync */ - "thr_setscheduler", /* 466 = thr_setscheduler */ - "thr_getscheduler", /* 467 = thr_getscheduler */ - "thr_setschedparam", /* 468 = thr_setschedparam */ + "rtprio_thread", /* 466 = rtprio_thread */ + "#467", /* 467 = nosys */ + "#468", /* 468 = nosys */ "#469", /* 469 = __getpath_fromfd */ "#470", /* 470 = __getpath_fromaddr */ }; ==== //depot/projects/newisp/compat/freebsd32/freebsd32_sysent.c#5 (text+ko) ==== @@ -2,8 +2,8 @@ * System call switch table. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/compat/freebsd32/freebsd32_sysent.c,v 1.61 2006/09/17 13:29:35 rwatson Exp $ - * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.75 2006/09/17 13:28:11 rwatson Exp + * $FreeBSD: src/sys/compat/freebsd32/freebsd32_sysent.c,v 1.64 2006/09/22 15:05:34 davidxu Exp $ + * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.78 2006/09/22 15:04:28 davidxu Exp */ #include "opt_compat.h" @@ -462,7 +462,7 @@ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 427 = __acl_delete_link */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 428 = __acl_aclcheck_link */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 429 = sigwait */ - { AS(thr_create_args), (sy_call_t *)thr_create, AUE_NULL, NULL, 0, 0 }, /* 430 = thr_create */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 430 = thr_create; */ { AS(thr_exit_args), (sy_call_t *)thr_exit, AUE_NULL, NULL, 0, 0 }, /* 431 = thr_exit */ { AS(thr_self_args), (sy_call_t *)thr_self, AUE_NULL, NULL, 0, 0 }, /* 432 = thr_self */ { AS(thr_kill_args), (sy_call_t *)thr_kill, AUE_NULL, NULL, 0, 0 }, /* 433 = thr_kill */ @@ -474,7 +474,7 @@ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 439 = extattr_list_link */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 440 = kse_switchin */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 441 = ksem_timedwait */ - { AS(thr_suspend_args), (sy_call_t *)thr_suspend, AUE_NULL, NULL, 0, 0 }, /* 442 = thr_suspend */ + { AS(freebsd32_thr_suspend_args), (sy_call_t *)freebsd32_thr_suspend, AUE_NULL, NULL, 0, 0 }, /* 442 = freebsd32_thr_suspend */ { AS(thr_wake_args), (sy_call_t *)thr_wake, AUE_NULL, NULL, 0, 0 }, /* 443 = thr_wake */ { AS(kldunloadf_args), (sy_call_t *)kldunloadf, AUE_MODUNLOAD, NULL, 0, 0 }, /* 444 = kldunloadf */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 445 = audit */ @@ -486,8 +486,8 @@ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 451 = getaudit_addr */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 452 = setaudit_addr */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 453 = auditctl */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 454 = _umtx_op */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 455 = thr_new */ + { AS(freebsd32_umtx_op_args), (sy_call_t *)freebsd32_umtx_op, AUE_NULL, NULL, 0, 0 }, /* 454 = freebsd32_umtx_op */ + { AS(freebsd32_thr_new_args), (sy_call_t *)freebsd32_thr_new, AUE_NULL, NULL, 0, 0 }, /* 455 = freebsd32_thr_new */ { AS(sigqueue_args), (sy_call_t *)sigqueue, AUE_NULL, NULL, 0, 0 }, /* 456 = sigqueue */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 457 = kmq_open */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 458 = kmq_setattr */ @@ -498,9 +498,9 @@ { AS(abort2_args), (sy_call_t *)abort2, AUE_NULL, NULL, 0, 0 }, /* 463 = abort2 */ { AS(thr_set_name_args), (sy_call_t *)thr_set_name, AUE_NULL, NULL, 0, 0 }, /* 464 = thr_set_name */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 465 = aio_fsync */ - { AS(thr_setscheduler_args), (sy_call_t *)thr_setscheduler, AUE_NULL, NULL, 0, 0 }, /* 466 = thr_setscheduler */ - { AS(thr_getscheduler_args), (sy_call_t *)thr_getscheduler, AUE_NULL, NULL, 0, 0 }, /* 467 = thr_getscheduler */ - { AS(thr_setschedparam_args), (sy_call_t *)thr_setschedparam, AUE_NULL, NULL, 0, 0 }, /* 468 = thr_setschedparam */ + { AS(rtprio_thread_args), (sy_call_t *)rtprio_thread, AUE_RTPRIO, NULL, 0, 0 }, /* 466 = rtprio_thread */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 467 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 468 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 469 = __getpath_fromfd */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 470 = __getpath_fromaddr */ }; ==== //depot/projects/newisp/compat/freebsd32/syscalls.master#5 (text+ko) ==== @@ -1,4 +1,4 @@ - $FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.75 2006/09/17 13:28:11 rwatson Exp $ + $FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.78 2006/09/22 15:04:28 davidxu Exp $ ; from: @(#)syscalls.master 8.2 (Berkeley) 1/13/94 ; from: src/sys/kern/syscalls.master 1.107 ; @@ -715,8 +715,7 @@ 428 AUE_NULL UNIMPL __acl_aclcheck_link ; XXX implement 429 AUE_SIGWAIT UNIMPL sigwait -430 AUE_NULL NOPROTO { int thr_create(ucontext_t *ctx, long *id, \ - int flag s); } +430 AUE_NULL UNIMPL thr_create; 431 AUE_NULL NOPROTO { void thr_exit(long *state); } 432 AUE_NULL NOPROTO { int thr_self(long *id); } 433 AUE_NULL NOPROTO { int thr_kill(long id, int sig); } @@ -728,8 +727,8 @@ 439 AUE_EXTATTR_LIST_LINK UNIMPL extattr_list_link 440 AUE_NULL UNIMPL kse_switchin 441 AUE_NULL UNIMPL ksem_timedwait -442 AUE_NULL NOPROTO { int thr_suspend( \ - const struct timespec *timeout); } +442 AUE_NULL STD { int freebsd32_thr_suspend( \ + const struct timespec32 *timeout); } 443 AUE_NULL NOPROTO { int thr_wake(long id); } 444 AUE_MODUNLOAD NOPROTO { int kldunloadf(int fileid, int flags); } 445 AUE_AUDIT UNIMPL audit @@ -741,8 +740,12 @@ 451 AUE_GETAUDIT_ADDR UNIMPL getaudit_addr 452 AUE_SETAUDIT_ADDR UNIMPL setaudit_addr 453 AUE_AUDITCTL UNIMPL auditctl -454 AUE_NULL UNIMPL _umtx_op -455 AUE_NULL UNIMPL thr_new +454 AUE_NULL STD { int freebsd32_umtx_op(void *obj, int op,\ + uintptr_t val, void *uaddr, \ + void *uaddr2); } +455 AUE_NULL STD { int freebsd32_thr_new( \ + struct thr_param32 *param, \ + int param_size); } 456 AUE_NULL NOPROTO { int sigqueue(pid_t pid, int signum, \ void *value); } 457 AUE_NULL UNIMPL kmq_open @@ -754,14 +757,9 @@ 463 AUE_NULL NOPROTO { int abort2(const char *why, int nargs, void **args); } 464 AUE_NULL NOPROTO { int thr_set_name(long id, const char *name); } 465 AUE_NULL UNIMPL aio_fsync -466 AUE_NULL NOPROTO { int thr_setscheduler(long id, int policy,\ - const struct sched_param *param, \ - int param_size); } -467 AUE_NULL NOPROTO { int thr_getscheduler(long id, int *policy,\ - struct sched_param *param, \ - int param_size); } -468 AUE_NULL NOPROTO { int thr_setschedparam(long id, \ - const struct sched_param *param, \ - int param_size); } +466 AUE_RTPRIO NOPROTO { int rtprio_thread(int function, \ + lwpid_t lwpid, struct rtprio *rtp); } +467 AUE_NULL UNIMPL nosys +468 AUE_NULL UNIMPL nosys 469 AUE_NULL UNIMPL __getpath_fromfd 470 AUE_NULL UNIMPL __getpath_fromaddr ==== //depot/projects/newisp/conf/NOTES#3 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/NOTES,v 1.1380 2006/08/27 12:57:37 marck Exp $ +# $FreeBSD: src/sys/conf/NOTES,v 1.1381 2006/09/20 13:33:40 rwatson Exp $ # # NOTES -- Lines that can be cut/pasted into kernel and hints configs. # @@ -994,7 +994,6 @@ options MAC options MAC_BIBA options MAC_BSDEXTENDED -options MAC_DEBUG options MAC_IFOFF options MAC_LOMAC options MAC_MLS ==== //depot/projects/newisp/conf/options#2 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/options,v 1.557 2006/08/17 00:37:03 julian Exp $ +# $FreeBSD: src/sys/conf/options,v 1.558 2006/09/20 13:33:40 rwatson Exp $ # # On the handling of kernel options # @@ -103,7 +103,6 @@ MAC_ALWAYS_LABEL_MBUF opt_mac.h MAC_BIBA opt_dontuse.h MAC_BSDEXTENDED opt_dontuse.h -MAC_DEBUG opt_mac.h MAC_IFOFF opt_dontuse.h MAC_LOMAC opt_dontuse.h MAC_MLS opt_dontuse.h ==== //depot/projects/newisp/dev/acpica/acpi.c#3 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi.c,v 1.228 2006/09/11 19:32:54 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi.c,v 1.229 2006/09/21 18:56:03 jhb Exp $"); #include "opt_acpi.h" #include <sys/param.h> @@ -1083,7 +1083,7 @@ * If we know about this address, deactivate it and release it to the * local pool. If we don't, pass this request up to the parent. */ - if (acpi_sysres_find(bus, type, rman_get_start(r)) == NULL) { + if (acpi_sysres_find(bus, type, rman_get_start(r)) != NULL) { if (rman_get_flags(r) & RF_ACTIVE) { ret = bus_deactivate_resource(child, type, rid, r); if (ret != 0) ==== //depot/projects/newisp/dev/bce/if_bce.c#3 (text) ==== @@ -29,7 +29,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/bce/if_bce.c,v 1.8 2006/09/17 13:33:27 andre Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/bce/if_bce.c,v 1.9 2006/09/20 18:55:16 ambrisko Exp $"); /* * The following controllers are supported by this driver: @@ -309,6 +309,7 @@ static void bce_ifmedia_sts (struct ifnet *, struct ifmediareq *); static void bce_init_locked (struct bce_softc *); static void bce_init (void *); +static void bce_mgmt_init_locked(struct bce_softc *sc); static void bce_init_context (struct bce_softc *); static void bce_get_mac_addr (struct bce_softc *); @@ -781,6 +782,11 @@ /* Add the supported sysctls to the kernel. */ bce_add_sysctls(sc); + /* Get the firmware running so IPMI still works */ + BCE_LOCK(sc); + bce_mgmt_init_locked(sc); + BCE_UNLOCK(sc); + goto bce_attach_exit; bce_attach_fail: @@ -3241,6 +3247,7 @@ DBPRINT(sc, BCE_VERBOSE_RESET, "Exiting %s()\n", __FUNCTION__); + bce_mgmt_init_locked(sc); } @@ -4569,6 +4576,43 @@ return; } +static void +bce_mgmt_init_locked(struct bce_softc *sc) +{ + u32 val; + struct ifnet *ifp; + + DBPRINT(sc, BCE_VERBOSE_RESET, "Entering %s()\n", __FUNCTION__); + + BCE_LOCK_ASSERT(sc); + + ifp = sc->bce_ifp; + + /* Check if the driver is still running and bail out if it is. */ + if (ifp->if_drv_flags & IFF_DRV_RUNNING) + goto bce_mgmt_init_locked_exit; + + /* Initialize the on-boards CPUs */ + bce_init_cpus(sc); + + val = (BCM_PAGE_BITS - 8) << 24; + REG_WR(sc, BCE_RV2P_CONFIG, val); + + /* Enable all critical blocks in the MAC. */ + REG_WR(sc, BCE_MISC_ENABLE_SET_BITS, + BCE_MISC_ENABLE_SET_BITS_RX_V2P_ENABLE | + BCE_MISC_ENABLE_SET_BITS_RX_DMA_ENABLE | + BCE_MISC_ENABLE_SET_BITS_COMPLETION_ENABLE); + REG_RD(sc, BCE_MISC_ENABLE_SET_BITS); + DELAY(20); + + bce_ifmedia_upd(ifp); +bce_mgmt_init_locked_exit: + DBPRINT(sc, BCE_VERBOSE_RESET, "Exiting %s()\n", __FUNCTION__); + + return; +} + /****************************************************************************/ /* Handles controller initialization when called from an unlocked routine. */ ==== //depot/projects/newisp/dev/em/if_em.c#8 (text+ko) ==== @@ -31,7 +31,7 @@ ***************************************************************************/ -/*$FreeBSD: src/sys/dev/em/if_em.c,v 1.146 2006/09/18 23:44:12 andre Exp $*/ +/*$FreeBSD: src/sys/dev/em/if_em.c,v 1.147 2006/09/21 19:14:51 andre Exp $*/ #ifdef HAVE_KERNEL_OPTION_HEADERS #include "opt_device_polling.h" @@ -1058,6 +1058,18 @@ if (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) em_enable_vlans(adapter); + ifp->if_hwassist = 0; + if (adapter->hw.mac_type >= em_82543) { + if (ifp->if_capenable & IFCAP_TXCSUM) + ifp->if_hwassist = EM_CHECKSUM_FEATURES; + /* + * em_setup_transmit_structures() will behave differently + * based on the state of TSO. + */ + if (ifp->if_capenable & IFCAP_TSO) + ifp->if_hwassist |= EM_TCPSEG_FEATURES; + } + /* Prepare transmit descriptors and buffers */ if (em_setup_transmit_structures(adapter)) { device_printf(dev, "Could not setup transmit structures\n"); @@ -1083,14 +1095,6 @@ ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - ifp->if_hwassist = 0; - if (adapter->hw.mac_type >= em_82543) { - if (ifp->if_capenable & IFCAP_TXCSUM) - ifp->if_hwassist = EM_CHECKSUM_FEATURES; - if (ifp->if_capenable & IFCAP_TSO) - ifp->if_hwassist |= EM_TCPSEG_FEATURES; - } - callout_reset(&adapter->timer, hz, em_local_timer, adapter); em_clear_hw_cntrs(&adapter->hw); #ifdef DEVICE_POLLING ==== //depot/projects/newisp/dev/kbdmux/kbdmux.c#3 (text+ko) ==== @@ -28,7 +28,7 @@ * SUCH DAMAGE. * * $Id: kbdmux.c,v 1.4 2005/07/14 17:38:35 max Exp $ - * $FreeBSD: src/sys/dev/kbdmux/kbdmux.c,v 1.12 2006/09/19 13:03:09 ru Exp $ + * $FreeBSD: src/sys/dev/kbdmux/kbdmux.c,v 1.13 2006/09/20 11:43:36 ru Exp $ */ #include "opt_kbd.h" @@ -1051,7 +1051,7 @@ case KDSKBMODE: /* set keyboard mode */ KBDMUX_LOCK(state); - switch ((int)*(intptr_t *)arg) { + switch (*(int *)arg) { case K_XLATE: if (state->ks_mode != K_XLATE) { /* make lock key state and LED state match */ @@ -1062,9 +1062,9 @@ case K_RAW: case K_CODE: - if (state->ks_mode != (int)*(intptr_t *)arg) { + if (state->ks_mode != *(int *)arg) { kbdmux_clear_state_locked(state); - state->ks_mode = (int)*(intptr_t *)arg; + state->ks_mode = *(int *)arg; } break; @@ -1086,13 +1086,13 @@ KBDMUX_LOCK(state); /* NOTE: lock key state in ks_state won't be changed */ - if ((int)*(intptr_t *)arg & ~LOCK_MASK) { + if (*(int *)arg & ~LOCK_MASK) { KBDMUX_UNLOCK(state); return (EINVAL); } - KBD_LED_VAL(kbd) = (int)*(intptr_t *)arg; + KBD_LED_VAL(kbd) = *(int *)arg; /* KDSETLED on all slave keyboards */ SLIST_FOREACH(k, &state->ks_kbds, next) @@ -1110,14 +1110,14 @@ case KDSKBSTATE: /* set lock key state */ KBDMUX_LOCK(state); - if ((int)*(intptr_t *)arg & ~LOCK_MASK) { + if (*(int *)arg & ~LOCK_MASK) { KBDMUX_UNLOCK(state); return (EINVAL); } state->ks_state &= ~LOCK_MASK; - state->ks_state |= (int)*(intptr_t *)arg; + state->ks_state |= *(int *)arg; /* KDSKBSTATE on all slave keyboards */ SLIST_FOREACH(k, &state->ks_kbds, next) @@ -1147,7 +1147,7 @@ break; mode |= i; } else - mode = (int)*(intptr_t *)arg; + mode = *(int *)arg; if (mode & ~0x7f) { KBDMUX_UNLOCK(state); ==== //depot/projects/newisp/dev/mfi/mfi.c#4 (text) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/mfi/mfi.c,v 1.15 2006/09/07 18:40:49 ambrisko Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/mfi/mfi.c,v 1.17 2006/09/20 18:49:35 ambrisko Exp $"); #include "opt_mfi.h" @@ -85,9 +85,12 @@ SYSCTL_NODE(_hw, OID_AUTO, mfi, CTLFLAG_RD, 0, "MFI driver parameters"); static int mfi_event_locale = MFI_EVT_LOCALE_ALL; +TUNABLE_INT("hw.mfi.event_locale", &mfi_event_locale); SYSCTL_INT(_hw_mfi, OID_AUTO, event_locale, CTLFLAG_RW, &mfi_event_locale, 0, "event message locale"); + static int mfi_event_class = MFI_EVT_CLASS_DEBUG; +TUNABLE_INT("hw.mfi.event_class", &mfi_event_class); SYSCTL_INT(_hw_mfi, OID_AUTO, event_class, CTLFLAG_RW, &mfi_event_class, 0, "event message class"); @@ -179,7 +182,7 @@ { uint32_t status; int error, commsz, framessz, sensesz; - int frames, unit; + int frames, unit, max_fw_sge; mtx_init(&sc->mfi_io_lock, "MFI I/O lock", NULL, MTX_DEF); TAILQ_INIT(&sc->mfi_ld_tqh); @@ -206,8 +209,8 @@ */ status = MFI_READ4(sc, MFI_OMSG0); sc->mfi_max_fw_cmds = status & MFI_FWSTATE_MAXCMD_MASK; - sc->mfi_max_fw_sgl = (status & MFI_FWSTATE_MAXSGL_MASK) >> 16; - sc->mfi_total_sgl = min(sc->mfi_max_fw_sgl, ((MAXPHYS / PAGE_SIZE) +1)); + max_fw_sge = (status & MFI_FWSTATE_MAXSGL_MASK) >> 16; + sc->mfi_max_sge = min(max_fw_sge, ((MAXPHYS / PAGE_SIZE) + 1)); /* * Create the dma tag for data buffers. Used both for block I/O @@ -219,7 +222,7 @@ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ BUS_SPACE_MAXSIZE_32BIT,/* maxsize */ - sc->mfi_total_sgl, /* nsegments */ + sc->mfi_max_sge, /* nsegments */ BUS_SPACE_MAXSIZE_32BIT,/* maxsegsize */ BUS_DMA_ALLOCNOW, /* flags */ busdma_lock_mutex, /* lockfunc */ @@ -262,24 +265,23 @@ /* * Allocate DMA memory for the command frames. Keep them in the - * lower 4GB for efficiency. Calculate the size of the frames at - * the same time; the frame is 64 bytes plus space for the SG lists. + * lower 4GB for efficiency. Calculate the size of the commands at + * the same time; each command is one 64 byte frame plus a set of + * additional frames for holding sg lists or other data. * The assumption here is that the SG list will start at the second - * 64 byte segment of the frame and not use the unused bytes in the - * frame. While this might seem wasteful, apparently the frames must - * be 64 byte aligned, so any savings would be negated by the extra - * alignment padding. + * frame and not use the unused bytes in the first frame. While this + * isn't technically correct, it simplifies the calculation and allows + * for command frames that might be larger than an mfi_io_frame. */ if (sizeof(bus_addr_t) == 8) { - sc->mfi_sgsize = sizeof(struct mfi_sg64); + sc->mfi_sge_size = sizeof(struct mfi_sg64); sc->mfi_flags |= MFI_FLAGS_SG64; } else { - sc->mfi_sgsize = sizeof(struct mfi_sg32); + sc->mfi_sge_size = sizeof(struct mfi_sg32); } - frames = (sc->mfi_sgsize * sc->mfi_total_sgl + MFI_FRAME_SIZE - 1) / - MFI_FRAME_SIZE + 1; - sc->mfi_frame_size = frames * MFI_FRAME_SIZE; - framessz = sc->mfi_frame_size * sc->mfi_max_fw_cmds; + frames = (sc->mfi_sge_size * sc->mfi_max_sge - 1) / MFI_FRAME_SIZE + 2; + sc->mfi_cmd_size = frames * MFI_FRAME_SIZE; + framessz = sc->mfi_cmd_size * sc->mfi_max_fw_cmds; if (bus_dma_tag_create( sc->mfi_parent_dmat, /* parent */ 64, 0, /* algnmnt, boundary */ BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ @@ -407,9 +409,9 @@ for (i = 0; i < ncmds; i++) { cm = &sc->mfi_commands[i]; cm->cm_frame = (union mfi_frame *)((uintptr_t)sc->mfi_frames + >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200609221713.k8MHDIHP039216>