PERFORCE change 117207 for review
Jung-uk Kim
jkim at FreeBSD.org
Mon Apr 2 18:52:50 UTC 2007
http://perforce.freebsd.org/chv.cgi?CH=117207
Change 117207 by jkim at jkim_hammer on 2007/04/02 18:52:10
IFC @117206
Affected files ...
.. //depot/projects/linuxolator/src/sys/amd64/amd64/support.S#5 integrate
.. //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_sysvec.c#13 integrate
.. //depot/projects/linuxolator/src/sys/compat/linux/linux_emul.c#42 integrate
.. //depot/projects/linuxolator/src/sys/compat/linux/linux_emul.h#11 integrate
.. //depot/projects/linuxolator/src/sys/conf/NOTES#22 integrate
.. //depot/projects/linuxolator/src/sys/conf/options#21 integrate
.. //depot/projects/linuxolator/src/sys/dev/acpica/acpi_ec.c#4 integrate
.. //depot/projects/linuxolator/src/sys/dev/ahb/ahb.c#5 integrate
.. //depot/projects/linuxolator/src/sys/dev/arcmsr/arcmsr.c#7 integrate
.. //depot/projects/linuxolator/src/sys/dev/ed/if_ed_pccard.c#3 integrate
.. //depot/projects/linuxolator/src/sys/dev/firewire/fwohci_pci.c#6 integrate
.. //depot/projects/linuxolator/src/sys/dev/ipmi/ipmi_pci.c#3 integrate
.. //depot/projects/linuxolator/src/sys/dev/isp/isp_freebsd.c#11 integrate
.. //depot/projects/linuxolator/src/sys/dev/isp/isp_freebsd.h#11 integrate
.. //depot/projects/linuxolator/src/sys/dev/isp/isp_library.c#8 integrate
.. //depot/projects/linuxolator/src/sys/dev/isp/isp_library.h#7 integrate
.. //depot/projects/linuxolator/src/sys/dev/isp/isp_pci.c#16 integrate
.. //depot/projects/linuxolator/src/sys/dev/isp/isp_sbus.c#10 integrate
.. //depot/projects/linuxolator/src/sys/dev/mxge/if_mxge.c#10 integrate
.. //depot/projects/linuxolator/src/sys/dev/pci/pci.c#21 integrate
.. //depot/projects/linuxolator/src/sys/dev/pci/pci_pci.c#8 integrate
.. //depot/projects/linuxolator/src/sys/dev/pci/pcireg.h#8 integrate
.. //depot/projects/linuxolator/src/sys/dev/sk/if_sk.c#6 integrate
.. //depot/projects/linuxolator/src/sys/dev/sk/if_skreg.h#4 integrate
.. //depot/projects/linuxolator/src/sys/dev/sound/midi/midi.c#5 integrate
.. //depot/projects/linuxolator/src/sys/dev/sound/pcm/channel.c#8 integrate
.. //depot/projects/linuxolator/src/sys/dev/sound/pcm/mixer.c#6 integrate
.. //depot/projects/linuxolator/src/sys/dev/sound/usb/uaudio.c#6 integrate
.. //depot/projects/linuxolator/src/sys/dev/usb/if_aue.c#8 integrate
.. //depot/projects/linuxolator/src/sys/dev/usb/if_axe.c#3 integrate
.. //depot/projects/linuxolator/src/sys/dev/usb/ubser.c#2 integrate
.. //depot/projects/linuxolator/src/sys/gnu/fs/xfs/FreeBSD/support/mrlock.c#2 integrate
.. //depot/projects/linuxolator/src/sys/gnu/fs/xfs/FreeBSD/support/mrlock.h#2 integrate
.. //depot/projects/linuxolator/src/sys/i386/acpica/acpi_machdep.c#3 integrate
.. //depot/projects/linuxolator/src/sys/i386/i386/support.s#5 integrate
.. //depot/projects/linuxolator/src/sys/i386/linux/linux_sysvec.c#6 integrate
.. //depot/projects/linuxolator/src/sys/i4b/layer1/ifpnp/i4b_ifpnp_avm.c#3 integrate
.. //depot/projects/linuxolator/src/sys/i4b/layer1/ihfc/i4b_ihfc_pnp.c#3 integrate
.. //depot/projects/linuxolator/src/sys/i4b/layer1/isic/i4b_avm_a1.c#3 integrate
.. //depot/projects/linuxolator/src/sys/i4b/layer1/isic/i4b_isic_pnp.c#3 integrate
.. //depot/projects/linuxolator/src/sys/i4b/layer1/isic/i4b_itk_ix1.c#3 integrate
.. //depot/projects/linuxolator/src/sys/i4b/layer1/isic/i4b_tel_s016.c#3 integrate
.. //depot/projects/linuxolator/src/sys/i4b/layer1/isic/i4b_tel_s0163.c#3 integrate
.. //depot/projects/linuxolator/src/sys/kern/kern_lock.c#8 integrate
.. //depot/projects/linuxolator/src/sys/kern/kern_rwlock.c#8 integrate
.. //depot/projects/linuxolator/src/sys/kern/kern_sx.c#7 integrate
.. //depot/projects/linuxolator/src/sys/kern/subr_witness.c#10 integrate
.. //depot/projects/linuxolator/src/sys/kern/vfs_lookup.c#7 integrate
.. //depot/projects/linuxolator/src/sys/kern/vfs_mount.c#12 integrate
.. //depot/projects/linuxolator/src/sys/kern/vfs_subr.c#11 integrate
.. //depot/projects/linuxolator/src/sys/kern/vfs_syscalls.c#12 integrate
.. //depot/projects/linuxolator/src/sys/modules/cryptodev/Makefile#2 integrate
.. //depot/projects/linuxolator/src/sys/netgraph/ng_base.c#6 integrate
.. //depot/projects/linuxolator/src/sys/netinet/sctp_auth.c#6 integrate
.. //depot/projects/linuxolator/src/sys/netinet/sctp_constants.h#8 integrate
.. //depot/projects/linuxolator/src/sys/netinet/sctp_indata.c#10 integrate
.. //depot/projects/linuxolator/src/sys/netinet/sctp_input.c#10 integrate
.. //depot/projects/linuxolator/src/sys/netinet/sctp_os_bsd.h#9 integrate
.. //depot/projects/linuxolator/src/sys/netinet/sctp_output.c#10 integrate
.. //depot/projects/linuxolator/src/sys/netinet/sctp_pcb.c#10 integrate
.. //depot/projects/linuxolator/src/sys/netinet/sctp_pcb.h#8 integrate
.. //depot/projects/linuxolator/src/sys/netinet/sctp_structs.h#10 integrate
.. //depot/projects/linuxolator/src/sys/netinet/sctp_sysctl.c#2 integrate
.. //depot/projects/linuxolator/src/sys/netinet/sctp_sysctl.h#2 integrate
.. //depot/projects/linuxolator/src/sys/netinet/sctp_uio.h#7 integrate
.. //depot/projects/linuxolator/src/sys/netinet/sctp_usrreq.c#10 integrate
.. //depot/projects/linuxolator/src/sys/netinet/sctputil.c#10 integrate
.. //depot/projects/linuxolator/src/sys/netinet6/in6_src.c#4 integrate
.. //depot/projects/linuxolator/src/sys/netinet6/sctp6_usrreq.c#10 integrate
.. //depot/projects/linuxolator/src/sys/nfsserver/nfs_srvsubs.c#5 integrate
.. //depot/projects/linuxolator/src/sys/powerpc/conf/GENERIC#7 integrate
.. //depot/projects/linuxolator/src/sys/powerpc/conf/NOTES#4 integrate
.. //depot/projects/linuxolator/src/sys/powerpc/powermac/uninorth.c#2 integrate
.. //depot/projects/linuxolator/src/sys/powerpc/powerpc/extintr.c#2 delete
.. //depot/projects/linuxolator/src/sys/sys/_sx.h#1 branch
.. //depot/projects/linuxolator/src/sys/sys/lockmgr.h#4 integrate
.. //depot/projects/linuxolator/src/sys/sys/mount.h#9 integrate
.. //depot/projects/linuxolator/src/sys/sys/mutex.h#8 integrate
.. //depot/projects/linuxolator/src/sys/sys/sleepqueue.h#6 integrate
.. //depot/projects/linuxolator/src/sys/sys/sx.h#4 integrate
.. //depot/projects/linuxolator/src/sys/sys/sysent.h#4 integrate
.. //depot/projects/linuxolator/src/sys/sys/vnode.h#7 integrate
Differences ...
==== //depot/projects/linuxolator/src/sys/amd64/amd64/support.S#5 (text+ko) ====
@@ -27,7 +27,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/amd64/amd64/support.S,v 1.122 2007/03/30 01:07:27 jkim Exp $
+ * $FreeBSD: src/sys/amd64/amd64/support.S,v 1.126 2007/03/31 01:47:37 jkim Exp $
*/
#include "opt_ddb.h"
@@ -242,7 +242,7 @@
cmpq %rcx,%rax
ja copyout_fault
- xchgq %rdi, %rsi
+ xchgq %rdi,%rsi
/* bcopy(%rsi, %rdi, %rdx) */
movq %rdx,%rcx
@@ -288,8 +288,8 @@
cmpq %rcx,%rax
ja copyin_fault
- xchgq %rdi, %rsi
- movq %rdx, %rcx
+ xchgq %rdi,%rsi
+ movq %rdx,%rcx
movb %cl,%al
shrq $3,%rcx /* copy longword-wise */
cld
@@ -353,11 +353,11 @@
cmpq %rax,%rdi /* verify address is valid */
ja fusufault
- movq %rsi, %rax /* old */
+ movq %rsi,%rax /* old */
#ifdef SMP
lock
#endif
- cmpxchgq %rdx, (%rdi) /* new = %rdx */
+ cmpxchgq %rdx,(%rdi) /* new = %rdx */
/*
* The old value is in %eax. If the store succeeded it will be the
@@ -501,7 +501,7 @@
cmpq %rax,%rdi /* verify address validity */
ja fusufault
- movl %esi, %eax
+ movl %esi,%eax
movb %al,(%rdi)
xorl %eax,%eax
movq PCPU(CURPCB),%rcx /* restore trashed register */
@@ -518,9 +518,9 @@
* return the actual length in *lencopied.
*/
ENTRY(copyinstr)
- movq %rdx, %r8 /* %r8 = maxlen */
- movq %rcx, %r9 /* %r9 = *len */
- xchgq %rdi, %rsi /* %rdi = from, %rsi = to */
+ movq %rdx,%r8 /* %r8 = maxlen */
+ movq %rcx,%r9 /* %r9 = *len */
+ xchgq %rdi,%rsi /* %rdi = from, %rsi = to */
movq PCPU(CURPCB),%rcx
movq $cpystrflt,PCB_ONFAULT(%rcx)
@@ -582,9 +582,9 @@
* %rdi, %rsi, %rdx, %rcx
*/
ENTRY(copystr)
- movq %rdx, %r8 /* %r8 = maxlen */
+ movq %rdx,%r8 /* %r8 = maxlen */
- xchgq %rdi, %rsi
+ xchgq %rdi,%rsi
incq %rdx
cld
1:
@@ -605,11 +605,11 @@
6:
- testq %rcx, %rcx
+ testq %rcx,%rcx
jz 7f
/* set *lencopied and return %rax */
- subq %rdx, %r8
- movq %r8, (%rcx)
+ subq %rdx,%r8
+ movq %r8,(%rcx)
7:
ret
@@ -626,7 +626,7 @@
jmp 1f
nop
1:
- movl $KDSEL, %eax
+ movl $KDSEL,%eax
movl %eax,%ds
movl %eax,%es
movl %eax,%fs /* Beware, use wrmsr to set 64 bit base */
@@ -671,6 +671,49 @@
incl %eax
ret
+/*****************************************************************************/
+/* linux_futex support */
+/*****************************************************************************/
+
+futex_fault:
+ movq $0,PCB_ONFAULT(%rcx)
+ movq $-EFAULT,%rax
+ ret
+
+ENTRY(futex_xchgl)
+ movq PCPU(CURPCB),%rcx
+ movq $futex_fault,PCB_ONFAULT(%rcx)
+
+ movq $VM_MAXUSER_ADDRESS-4,%rax
+ cmpq %rax,%rsi
+ ja futex_fault
+
+#ifdef SMP
+ lock
+#endif
+ xchgl %edi,(%rsi)
+ movl %edi,(%rdx)
+ xorl %eax,%eax
+ movq %rax,PCB_ONFAULT(%rcx)
+ ret
+
+ENTRY(futex_addl)
+ movq PCPU(CURPCB),%rcx
+ movq $futex_fault,PCB_ONFAULT(%rcx)
+
+ movq $VM_MAXUSER_ADDRESS-4,%rax
+ cmpq %rax,%rsi
+ ja futex_fault
+
+#ifdef SMP
+ lock
+#endif
+ xaddl %edi,(%rsi)
+ movl %edi,(%rdx)
+ xorl %eax,%eax
+ movq %rax,PCB_ONFAULT(%rcx)
+ ret
+
/*
* Support for BB-profiling (gcc -a). The kernbb program will extract
* the data from the kernel.
@@ -689,47 +732,3 @@
movq %rax,32(%rdi)
movq %rdi,bbhead
NON_GPROF_RET
-
-#if defined(SMP) || !defined(_KERNEL)
-#define MPLOCKED lock ;
-#else
-#define MPLOCKED
-#endif
-
- .text
-
-futex_fault:
- movq PCPU(CURPCB), %rdx
- movq $0, PCB_ONFAULT(%rdx)
- movq $-EFAULT, %rax
- ret
-
-/* int futex_xchgl(int oparg, caddr_t uaddr, int *oldval); */
-ENTRY(futex_xchgl)
- movq PCPU(CURPCB), %r11
- movq $futex_fault, PCB_ONFAULT(%r11)
-
- movq $VM_MAXUSER_ADDRESS-4, %rax
- cmpq %rax, %rsi
- ja futex_fault
-
- MPLOCKED xchgl %edi, (%rsi)
- movl %edi, (%rdx)
- xorl %eax, %eax
- movq %rax, PCB_ONFAULT(%r11)
- ret
-
-/* int futex_addl(int oparg, caddr_t uaddr, int *oldval); */
-ENTRY(futex_addl)
- movq PCPU(CURPCB), %r11
- movq $futex_fault, PCB_ONFAULT(%r11)
-
- movq $VM_MAXUSER_ADDRESS-4, %rax
- cmpq %rax, %rsi
- ja futex_fault
-
- MPLOCKED xaddl %edi, (%rsi)
- movl %edi, (%rdx)
- xorl %eax, %eax
- movq %rax, PCB_ONFAULT(%r11)
- ret
==== //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_sysvec.c#13 (text+ko) ====
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_sysvec.c,v 1.27 2007/03/30 00:06:21 jkim Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_sysvec.c,v 1.28 2007/04/02 18:38:12 jkim Exp $");
#include "opt_compat.h"
#ifndef COMPAT_IA32
==== //depot/projects/linuxolator/src/sys/compat/linux/linux_emul.c#42 (text+ko) ====
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/linux/linux_emul.c,v 1.19 2007/03/02 00:08:47 jkim Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/linux/linux_emul.c,v 1.20 2007/04/02 18:38:13 jkim Exp $");
#include "opt_compat.h"
@@ -55,8 +55,8 @@
#include <machine/../linux/linux_proto.h>
#endif
-struct sx emul_shared_lock;
-struct mtx emul_lock;
+struct sx emul_shared_lock;
+struct mtx emul_lock;
/* this returns locked reference to the emuldata entry (if found) */
struct linux_emuldata *
==== //depot/projects/linuxolator/src/sys/compat/linux/linux_emul.h#11 (text+ko) ====
@@ -25,11 +25,11 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/sys/compat/linux/linux_emul.h,v 1.6 2007/01/07 19:00:38 netchild Exp $
+ * $FreeBSD: src/sys/compat/linux/linux_emul.h,v 1.7 2007/04/02 18:38:13 jkim Exp $
*/
#ifndef _LINUX_EMUL_H_
-#define _LINUX_EMUL_H_
+#define _LINUX_EMUL_H_
struct linux_emuldata_shared {
int refs;
@@ -55,26 +55,26 @@
LIST_ENTRY(linux_emuldata) threads; /* list of linux threads */
};
-struct linux_emuldata *em_find(struct proc *, int locked);
+struct linux_emuldata *em_find(struct proc *, int locked);
-#define EMUL_LOCK(l) mtx_lock(l)
-#define EMUL_UNLOCK(l) mtx_unlock(l)
+#define EMUL_LOCK(l) mtx_lock(l)
+#define EMUL_UNLOCK(l) mtx_unlock(l)
-#define EMUL_SHARED_RLOCK(l) sx_slock(l)
-#define EMUL_SHARED_RUNLOCK(l) sx_sunlock(l)
-#define EMUL_SHARED_WLOCK(l) sx_xlock(l)
-#define EMUL_SHARED_WUNLOCK(l) sx_xunlock(l)
+#define EMUL_SHARED_RLOCK(l) sx_slock(l)
+#define EMUL_SHARED_RUNLOCK(l) sx_sunlock(l)
+#define EMUL_SHARED_WLOCK(l) sx_xlock(l)
+#define EMUL_SHARED_WUNLOCK(l) sx_xunlock(l)
/* for em_find use */
-#define EMUL_DOLOCK 1
-#define EMUL_DONTLOCK 0
+#define EMUL_DOLOCK 1
+#define EMUL_DONTLOCK 0
int linux_proc_init(struct thread *, pid_t, int);
void linux_proc_exit(void *, struct proc *);
void linux_schedtail(void *, struct proc *);
void linux_proc_exec(void *, struct proc *, struct image_params *);
-extern struct sx emul_shared_lock;
-extern struct mtx emul_lock;
+extern struct sx emul_shared_lock;
+extern struct mtx emul_lock;
#endif /* !_LINUX_EMUL_H_ */
==== //depot/projects/linuxolator/src/sys/conf/NOTES#22 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/NOTES,v 1.1416 2007/03/26 09:10:28 yar Exp $
+# $FreeBSD: src/sys/conf/NOTES,v 1.1418 2007/04/02 01:04:20 mjacob Exp $
#
# NOTES -- Lines that can be cut/pasted into kernel and hints configs.
#
@@ -214,6 +214,12 @@
# to sleep rather than spinning.
options ADAPTIVE_GIANT
+# ADAPTIVE_SX changes the behavior of sx locks to spin if the thread
+# that currently owns the lock is executing on another CPU. Note that
+# in addition to enabling this option, individual sx locks must be
+# initialized with the SX_ADAPTIVESPIN flag.
+options ADAPTIVE_SX
+
# MUTEX_NOINLINE forces mutex operations to call functions to perform each
# operation rather than inlining the simple cases. This can be used to
# shrink the size of the kernel text segment. Note that this behavior is
@@ -233,6 +239,13 @@
# and WITNESS options.
options RWLOCK_NOINLINE
+# SX_NOINLINE forces sx lock operations to call functions to perform each
+# operation rather than inlining the simple cases. This can be used to
+# shrink the size of the kernel text segment. Note that this behavior is
+# already implied by the INVARIANT_SUPPORT, INVARIANTS, KTR, LOCK_PROFILING,
+# and WITNESS options.
+options SX_NOINLINE
+
# SMP Debugging Options:
#
# PREEMPTION allows the threads that are in the kernel to be preempted
@@ -1521,9 +1534,13 @@
#
options ISP_TARGET_MODE=1
#
-# ISP_DEFAULT_ROLES - default role (none, target, init, both)
+# ISP_DEFAULT_ROLES - default role
+# none=0
+# target=1
+# initiator=2
+# both=3 (not supported currently)
#
-options ISP_DEFAULT_ROLES=3
+options ISP_DEFAULT_ROLES=2
# Options used in dev/sym/ (Symbios SCSI driver).
#options SYM_SETUP_LP_PROBE_MAP #-Low Priority Probe Map (bits)
==== //depot/projects/linuxolator/src/sys/conf/options#21 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/options,v 1.583 2007/03/27 19:32:40 jhb Exp $
+# $FreeBSD: src/sys/conf/options,v 1.584 2007/03/31 23:23:41 jhb Exp $
#
# On the handling of kernel options
#
@@ -59,6 +59,7 @@
# Miscellaneous options.
ADAPTIVE_GIANT opt_adaptive_mutexes.h
+ADAPTIVE_SX
ALQ
AUDIT opt_global.h
CODA_COMPAT_5 opt_coda.h
@@ -555,6 +556,7 @@
REGRESSION opt_global.h
RESTARTABLE_PANICS opt_global.h
RWLOCK_NOINLINE opt_global.h
+SX_NOINLINE opt_global.h
VFS_BIO_DEBUG opt_global.h
# These are VM related options
==== //depot/projects/linuxolator/src/sys/dev/acpica/acpi_ec.c#4 (text+ko) ====
@@ -136,12 +136,13 @@
*****************************************************************************/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_ec.c,v 1.72 2007/03/22 18:16:40 jkim Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_ec.c,v 1.73 2007/03/31 23:23:41 jhb Exp $");
#include "opt_acpi.h"
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/bus.h>
+#include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/module.h>
#include <sys/sx.h>
==== //depot/projects/linuxolator/src/sys/dev/ahb/ahb.c#5 (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/dev/ahb/ahb.c,v 1.39 2007/02/23 12:18:30 piso Exp $
+ * $FreeBSD: src/sys/dev/ahb/ahb.c,v 1.40 2007/04/01 16:55:31 netchild Exp $
*/
#include <sys/param.h>
@@ -378,8 +378,10 @@
goto error_exit;
/* Enable our interrupt */
- bus_setup_intr(dev, irq, INTR_TYPE_CAM|INTR_ENTROPY, NULL, ahbintr,
- ahb, &ih);
+ if (bus_setup_intr(dev, irq, INTR_TYPE_CAM|INTR_ENTROPY, NULL, ahbintr,
+ ahb, &ih) != 0)
+ goto error_exit;
+
return (0);
error_exit:
==== //depot/projects/linuxolator/src/sys/dev/arcmsr/arcmsr.c#7 (text+ko) ====
@@ -56,7 +56,7 @@
** and cause g_vfs_done() read write error
******************************************************************************************
-* $FreeBSD: src/sys/dev/arcmsr/arcmsr.c,v 1.20 2007/03/12 05:10:29 mjacob Exp $
+* $FreeBSD: src/sys/dev/arcmsr/arcmsr.c,v 1.21 2007/04/02 03:31:37 scottl Exp $
*/
#include <sys/param.h>
#include <sys/systm.h>
@@ -1270,8 +1270,7 @@
, acb->pci_unit, error);
}
if((pccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_INPROG) {
- xpt_freeze_devq(pccb->ccb_h.path, /*count*/1);
- pccb->ccb_h.status |= (CAM_REQ_TOO_BIG|CAM_DEV_QFRZN);
+ pccb->ccb_h.status |= CAM_REQ_TOO_BIG;
}
arcmsr_srb_complete(srb, 0);
return;
@@ -1307,14 +1306,14 @@
arcmsr_srb_complete(srb, 0);
return;
}
- pccb->ccb_h.status |= CAM_SIM_QUEUED;
if(acb->srboutstandingcount >= ARCMSR_MAX_OUTSTANDING_CMD) {
- pccb->ccb_h.status &= ~CAM_STATUS_MASK;
- pccb->ccb_h.status |= (CAM_REQUEUE_REQ|CAM_DEV_QFRZN);
+ xpt_freeze_simq(acb->psim, 1);
+ pccb->ccb_h.status = CAM_REQUEUE_REQ;
acb->acb_flags |= ACB_F_CAM_DEV_QFRZN;
arcmsr_srb_complete(srb, 0);
return;
}
+ pccb->ccb_h.status |= CAM_SIM_QUEUED;
arcmsr_build_srb(srb, dm_segs, nseg);
arcmsr_post_srb(acb, srb);
return;
==== //depot/projects/linuxolator/src/sys/dev/ed/if_ed_pccard.c#3 (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/dev/ed/if_ed_pccard.c,v 1.111 2007/02/23 12:18:38 piso Exp $
+ * $FreeBSD: src/sys/dev/ed/if_ed_pccard.c,v 1.112 2007/04/01 14:15:26 netchild Exp $
*/
/*
@@ -541,7 +541,7 @@
sc->chip_type == ED_CHIP_TYPE_DL10022) {
/* Probe for an MII bus, but ignore errors. */
ed_pccard_dl100xx_mii_reset(sc);
- mii_phy_probe(dev, &sc->miibus, ed_ifmedia_upd,
+ (void)mii_phy_probe(dev, &sc->miibus, ed_ifmedia_upd,
ed_ifmedia_sts);
} else if (sc->chip_type == ED_CHIP_TYPE_AX88190) {
ed_pccard_ax88x90_mii_reset(sc);
==== //depot/projects/linuxolator/src/sys/dev/firewire/fwohci_pci.c#6 (text+ko) ====
@@ -31,7 +31,7 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/sys/dev/firewire/fwohci_pci.c,v 1.58 2007/03/19 03:41:27 simokawa Exp $
+ * $FreeBSD: src/sys/dev/firewire/fwohci_pci.c,v 1.59 2007/03/30 22:25:26 simokawa Exp $
*/
#define BOUNCE_BUFFER_TEST 0
@@ -424,19 +424,18 @@
FWOHCI_INTMASKCLR, OHCI_INT_EN);
if (sc->irq_res) {
- int err = bus_teardown_intr(self, sc->irq_res, sc->ih);
- if (err)
- /* XXX or should we panic? */
- device_printf(self, "Could not tear down irq, %d\n",
- err);
+ int err;
+ if (sc->ih) {
+ err = bus_teardown_intr(self, sc->irq_res, sc->ih);
+ if (err)
+ device_printf(self,
+ "Could not tear down irq, %d\n", err);
#if defined(__DragonFly__) || __FreeBSD_version < 500000
- bus_teardown_intr(self, sc->irq_res, sc->ih_cam);
- bus_teardown_intr(self, sc->irq_res, sc->ih_bio);
+ bus_teardown_intr(self, sc->irq_res, sc->ih_cam);
+ bus_teardown_intr(self, sc->irq_res, sc->ih_bio);
#endif
- sc->ih = NULL;
- }
-
- if (sc->irq_res) {
+ sc->ih = NULL;
+ }
bus_release_resource(self, SYS_RES_IRQ, 0, sc->irq_res);
sc->irq_res = NULL;
}
==== //depot/projects/linuxolator/src/sys/dev/ipmi/ipmi_pci.c#3 (text) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ipmi/ipmi_pci.c,v 1.2 2006/09/22 22:11:29 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ipmi/ipmi_pci.c,v 1.4 2007/03/31 21:39:02 jhb Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -185,7 +185,7 @@
{
if (pci_get_class(dev) == PCIC_SERIALBUS &&
- pci_get_subclass(dev) == 0x07) {
+ pci_get_subclass(dev) == PCIS_SERIALBUS_IPMI) {
device_set_desc(dev, "IPMI System Interface");
return (BUS_PROBE_GENERIC);
}
@@ -204,13 +204,13 @@
/* Interface is determined by progif. */
switch (pci_get_progif(dev)) {
- case 0:
+ case PCIP_SERIALBUS_IPMI_SMIC:
iface = SMIC_MODE;
break;
- case 1:
+ case PCIP_SERIALBUS_IPMI_KCS:
iface = KCS_MODE;
break;
- case 2:
+ case PCIP_SERIALBUS_IPMI_BT:
iface = BT_MODE;
device_printf(dev, "BT interface unsupported\n");
return (ENXIO);
@@ -220,12 +220,9 @@
return (ENXIO);
}
- /*
- * Bottom bit of bar indicates resouce type. There should be
- * constants in pcireg.h for fields in a BAR.
- */
+ /* Check the BAR to determine our resource type. */
sc->ipmi_io_rid = PCIR_BAR(0);
- if (pci_read_config(dev, PCIR_BAR(0), 4) & 0x1)
+ if (PCI_BAR_IO(pci_read_config(dev, PCIR_BAR(0), 4)))
type = SYS_RES_IOPORT;
else
type = SYS_RES_MEMORY;
==== //depot/projects/linuxolator/src/sys/dev/isp/isp_freebsd.c#11 (text+ko) ====
@@ -28,7 +28,7 @@
* Platform (FreeBSD) dependent common attachment code for Qlogic adapters.
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/isp/isp_freebsd.c,v 1.136 2007/03/12 04:54:30 mjacob Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/isp/isp_freebsd.c,v 1.137 2007/04/02 01:04:20 mjacob Exp $");
#include <dev/isp/isp_freebsd.h>
#include <sys/unistd.h>
#include <sys/kthread.h>
@@ -382,6 +382,14 @@
retval = EINVAL;
break;
}
+ /*
+ * XXX: Current
+ */
+ if (nr == ISP_ROLE_BOTH) {
+ isp_prt(isp, ISP_LOGERR, "dual roles not supported");
+ retval = EINVAL;
+ break;
+ }
*(int *)addr = isp->isp_role;
isp->isp_role = nr;
/* FALLTHROUGH */
@@ -1133,7 +1141,7 @@
static void
isp_ledone(ispsoftc_t *isp, lun_entry_t *lep)
{
- const char lfmt[] = "now %sabled for target mode";
+ const char lfmt[] = "now %sabled for target mode\n";
union ccb *ccb;
uint32_t seq;
tstate_t *tptr;
==== //depot/projects/linuxolator/src/sys/dev/isp/isp_freebsd.h#11 (text+ko) ====
@@ -1,4 +1,4 @@
-/* $FreeBSD: src/sys/dev/isp/isp_freebsd.h,v 1.102 2007/03/13 06:46:08 mjacob Exp $ */
+/* $FreeBSD: src/sys/dev/isp/isp_freebsd.h,v 1.104 2007/04/02 01:04:20 mjacob Exp $ */
/*-
* Qlogic ISP SCSI Host Adapter FreeBSD Wrapper Definitions
*
@@ -532,4 +532,10 @@
#include <dev/isp/isp_library.h>
+/*
+ * XXX: Temp
+ */
+#if ISP_DEFAULT_ROLES == ISP_ROLE_BOTH
+#error "Dual Role Temporarily Unsupported"
+#endif
#endif /* _ISP_FREEBSD_H */
==== //depot/projects/linuxolator/src/sys/dev/isp/isp_library.c#8 (text) ====
@@ -34,7 +34,7 @@
#endif
#ifdef __FreeBSD__
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/isp/isp_library.c,v 1.12 2007/03/22 23:38:31 mjacob Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/isp/isp_library.c,v 1.13 2007/04/02 01:04:20 mjacob Exp $");
#include <dev/isp/isp_freebsd.h>
#endif
#ifdef __OpenBSD__
@@ -1499,12 +1499,12 @@
void *
isp_find_xs_tgt(ispsoftc_t *isp, uint32_t handle)
{
- if (handle == 0 || (handle & 0x8000) == 0 ||
- (handle & 0x7fff) > isp->isp_maxcmds) {
+ if (handle == 0 || IS_TARGET_HANDLE(handle) == 0 ||
+ (handle & ISP_HANDLE_MASK) > isp->isp_maxcmds) {
isp_prt(isp, ISP_LOGERR, "bad handle in isp_find_xs_tgt");
return (NULL);
} else {
- return (isp->isp_tgtlist[(handle & 0x7fff) - 1]);
+ return (isp->isp_tgtlist[(handle & ISP_HANDLE_MASK) - 1]);
}
}
@@ -1515,7 +1515,7 @@
if (xs != NULL) {
for (i = 0; i < isp->isp_maxcmds; i++) {
if (isp->isp_tgtlist[i] == xs) {
- return ((i+1) & 0x7fff);
+ return ((i+1) & ISP_HANDLE_MASK);
}
}
}
@@ -1525,12 +1525,12 @@
void
isp_destroy_tgt_handle(ispsoftc_t *isp, uint32_t handle)
{
- if (handle == 0 || (handle & 0x8000) == 0 ||
- (handle & 0x7fff) > isp->isp_maxcmds) {
+ if (handle == 0 || IS_TARGET_HANDLE(handle) == 0 ||
+ (handle & ISP_HANDLE_MASK) > isp->isp_maxcmds) {
isp_prt(isp, ISP_LOGERR,
"bad handle in isp_destroy_tgt_handle");
} else {
- isp->isp_tgtlist[(handle & 0x7fff) - 1] = NULL;
+ isp->isp_tgtlist[(handle & ISP_HANDLE_MASK) - 1] = NULL;
}
}
==== //depot/projects/linuxolator/src/sys/dev/isp/isp_library.h#7 (text) ====
@@ -1,4 +1,4 @@
-/* $FreeBSD: src/sys/dev/isp/isp_library.h,v 1.7 2007/03/22 23:38:31 mjacob Exp $ */
+/* $FreeBSD: src/sys/dev/isp/isp_library.h,v 1.8 2007/04/02 01:04:20 mjacob Exp $ */
/*-
* Copyright (c) 1997-2007 by Matthew Jacob
* All rights reserved.
@@ -128,6 +128,8 @@
extern void isp_get_ct_hdr(ispsoftc_t *isp, ct_hdr_t *, ct_hdr_t *);
extern void isp_put_ct_hdr(ispsoftc_t *isp, ct_hdr_t *, ct_hdr_t *);
+#define ISP_HANDLE_MASK 0x7fff
+
#ifdef ISP_TARGET_MODE
#if defined(__NetBSD__) || defined(__OpenBSD__)
#include <dev/ic/isp_target.h>
==== //depot/projects/linuxolator/src/sys/dev/isp/isp_pci.c#16 (text+ko) ====
@@ -28,7 +28,7 @@
* FreeBSD Version.
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/isp/isp_pci.c,v 1.141 2007/03/22 23:38:32 mjacob Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/isp/isp_pci.c,v 1.142 2007/04/02 01:04:20 mjacob Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -1994,7 +1994,7 @@
cto->ct_scsi_status = 0;
pcs = (struct isp_pcisoftc *)isp;
- dp = &pcs->dmaps[isp_handle_index(handle)];
+ dp = &pcs->dmaps[isp_handle_index(handle & ISP_HANDLE_MASK)];
if ((csio->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) {
bus_dmamap_sync(pcs->dmat, *dp, BUS_DMASYNC_PREREAD);
} else {
@@ -2388,7 +2388,7 @@
isp = mp->isp;
rq = mp->rq;
pcs = (struct isp_pcisoftc *)mp->isp;
- dp = &pcs->dmaps[isp_handle_index(rq->req_handle)];
+ dp = &pcs->dmaps[isp_handle_index(rq->req_handle & ISP_HANDLE_MASK)];
nxti = *mp->nxtip;
if ((csio->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) {
@@ -2494,7 +2494,7 @@
isp = mp->isp;
rq = mp->rq;
pcs = (struct isp_pcisoftc *)mp->isp;
- dp = &pcs->dmaps[isp_handle_index(rq->req_handle)];
+ dp = &pcs->dmaps[isp_handle_index(rq->req_handle & ISP_HANDLE_MASK)];
nxti = *mp->nxtip;
if ((csio->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) {
@@ -2628,7 +2628,7 @@
isp = mp->isp;
rq = mp->rq;
pcs = (struct isp_pcisoftc *)mp->isp;
- dp = &pcs->dmaps[isp_handle_index(rq->req_handle)];
+ dp = &pcs->dmaps[isp_handle_index(rq->req_handle & ISP_HANDLE_MASK)];
nxti = *mp->nxtip;
if ((csio->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) {
@@ -2795,7 +2795,8 @@
if ((csio->ccb_h.flags & CAM_SCATTER_VALID) == 0) {
if ((csio->ccb_h.flags & CAM_DATA_PHYS) == 0) {
int error, s;
- dp = &pcs->dmaps[isp_handle_index(rq->req_handle)];
+ dp = &pcs->dmaps[isp_handle_index(
+ rq->req_handle & ISP_HANDLE_MASK)];
s = splsoftvm();
error = bus_dmamap_load(pcs->dmat, *dp,
csio->data_ptr, csio->dxfer_len, eptr, mp, 0);
@@ -2880,7 +2881,8 @@
isp_pci_dmateardown(ispsoftc_t *isp, XS_T *xs, uint32_t handle)
{
struct isp_pcisoftc *pcs = (struct isp_pcisoftc *)isp;
- bus_dmamap_t *dp = &pcs->dmaps[isp_handle_index(handle)];
+ bus_dmamap_t *dp;
+ dp = &pcs->dmaps[isp_handle_index(handle & ISP_HANDLE_MASK)];
if ((xs->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) {
bus_dmamap_sync(pcs->dmat, *dp, BUS_DMASYNC_POSTREAD);
} else {
==== //depot/projects/linuxolator/src/sys/dev/isp/isp_sbus.c#10 (text+ko) ====
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/isp/isp_sbus.c,v 1.31 2007/03/28 16:34:11 mjacob Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/isp/isp_sbus.c,v 1.32 2007/04/02 01:04:20 mjacob Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -624,7 +624,7 @@
isp = mp->isp;
rq = mp->rq;
sbs = (struct isp_sbussoftc *)mp->isp;
- dp = &sbs->dmaps[isp_handle_index(rq->req_handle)];
+ dp = &sbs->dmaps[isp_handle_index(rq->req_handle & ISP_HANDLE_MASK)];
nxti = *mp->nxtip;
if ((csio->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) {
@@ -735,7 +735,8 @@
if ((csio->ccb_h.flags & CAM_SCATTER_VALID) == 0) {
if ((csio->ccb_h.flags & CAM_DATA_PHYS) == 0) {
int error, s;
- dp = &sbs->dmaps[isp_handle_index(rq->req_handle)];
+ dp = &sbs->dmaps[isp_handle_index(
+ rq->req_handle & ISP_HANDLE_MASK)];
s = splsoftvm();
error = bus_dmamap_load(sbs->dmat, *dp,
csio->data_ptr, csio->dxfer_len, eptr, mp, 0);
@@ -809,7 +810,8 @@
isp_sbus_dmateardown(ispsoftc_t *isp, XS_T *xs, uint32_t handle)
{
struct isp_sbussoftc *sbs = (struct isp_sbussoftc *)isp;
- bus_dmamap_t *dp = &sbs->dmaps[isp_handle_index(handle)];
+ bus_dmamap_t *dp;
+ dp = &sbs->dmaps[isp_handle_index(handle & ISP_HANDLE_MASK)];
if ((xs->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) {
bus_dmamap_sync(sbs->dmat, *dp, BUS_DMASYNC_POSTREAD);
} else {
==== //depot/projects/linuxolator/src/sys/dev/mxge/if_mxge.c#10 (text+ko) ====
@@ -32,7 +32,7 @@
***************************************************************************/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/mxge/if_mxge.c,v 1.24 2007/03/27 15:55:32 gallatin Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/mxge/if_mxge.c,v 1.25 2007/03/31 23:23:41 jhb Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -44,6 +44,7 @@
#include <sys/malloc.h>
#include <sys/kdb.h>
#include <sys/kernel.h>
+#include <sys/lock.h>
#include <sys/module.h>
#include <sys/memrange.h>
#include <sys/socket.h>
==== //depot/projects/linuxolator/src/sys/dev/pci/pci.c#21 (text+ko) ====
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/pci/pci.c,v 1.345 2007/03/26 20:18:52 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/pci/pci.c,v 1.348 2007/03/31 21:39:02 jhb Exp $");
#include "opt_bus.h"
@@ -72,7 +72,7 @@
#endif
static uint32_t pci_mapbase(unsigned mapreg);
-static int pci_maptype(unsigned mapreg);
+static const char *pci_maptype(unsigned mapreg);
static int pci_mapsize(unsigned testval);
static int pci_maprange(unsigned mapreg);
static void pci_fixancient(pcicfgregs *cfg);
@@ -305,29 +305,24 @@
static uint32_t
pci_mapbase(uint32_t mapreg)
{
- int mask = 0x03;
- if ((mapreg & 0x01) == 0)
- mask = 0x0f;
- return (mapreg & ~mask);
+
+ if (PCI_BAR_MEM(mapreg))
+ return (mapreg & PCIM_BAR_MEM_BASE);
+ else
+ return (mapreg & PCIM_BAR_IO_BASE);
}
/* return map type of memory or port map */
-static int
+static const char *
pci_maptype(unsigned mapreg)
{
- static uint8_t maptype[0x10] = {
- PCI_MAPMEM, PCI_MAPPORT,
- PCI_MAPMEM, 0,
- PCI_MAPMEM, PCI_MAPPORT,
- 0, 0,
- PCI_MAPMEM|PCI_MAPMEMP, PCI_MAPPORT,
- PCI_MAPMEM|PCI_MAPMEMP, 0,
- PCI_MAPMEM|PCI_MAPMEMP, PCI_MAPPORT,
- 0, 0,
- };
- return (maptype[mapreg & 0x0f]);
+ if (PCI_BAR_IO(mapreg))
+ return ("I/O Port");
+ if (mapreg & PCIM_BAR_MEM_PREFETCH)
+ return ("Prefetchable Memory");
+ return ("Memory");
}
/* return log2 of map size decoded for memory or port map */
@@ -355,19 +350,21 @@
pci_maprange(unsigned mapreg)
{
int ln2range = 0;
- switch (mapreg & 0x07) {
- case 0x00:
- case 0x01:
- case 0x05:
+
+ if (PCI_BAR_IO(mapreg))
ln2range = 32;
- break;
- case 0x02:
- ln2range = 20;
- break;
- case 0x04:
- ln2range = 64;
- break;
- }
+ else
+ switch (mapreg & PCIM_BAR_MEM_TYPE) {
+ case PCIM_BAR_MEM_32:
+ ln2range = 32;
+ break;
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list