PERFORCE change 56594 for review
Julian Elischer
julian at FreeBSD.org
Tue Jul 6 00:06:06 PDT 2004
http://perforce.freebsd.org/chv.cgi?CH=56594
Change 56594 by julian at julian_jules1 on 2004/07/06 07:05:14
IFC
still need to do kern_switch.c by hand
Affected files ...
.. //depot/projects/nsched/sys/alpha/alpha/pmap.c#6 integrate
.. //depot/projects/nsched/sys/alpha/include/pmap.h#6 integrate
.. //depot/projects/nsched/sys/amd64/amd64/pmap.c#12 integrate
.. //depot/projects/nsched/sys/arm/arm/pmap.c#3 integrate
.. //depot/projects/nsched/sys/boot/common/ufsread.c#2 integrate
.. //depot/projects/nsched/sys/coda/coda_subr.c#2 integrate
.. //depot/projects/nsched/sys/conf/NOTES#9 integrate
.. //depot/projects/nsched/sys/conf/files#15 integrate
.. //depot/projects/nsched/sys/conf/options#10 integrate
.. //depot/projects/nsched/sys/dev/acpica/acpi_pcib_acpi.c#6 integrate
.. //depot/projects/nsched/sys/dev/fdc/fdc.c#4 integrate
.. //depot/projects/nsched/sys/dev/hifn/hifn7751.c#3 integrate
.. //depot/projects/nsched/sys/dev/nmdm/nmdm.c#7 integrate
.. //depot/projects/nsched/sys/dev/pcf/pcfvar.h#2 integrate
.. //depot/projects/nsched/sys/dev/re/if_re.c#6 integrate
.. //depot/projects/nsched/sys/dev/sound/pci/via82c686.c#2 integrate
.. //depot/projects/nsched/sys/dev/usb/usbdevs#8 integrate
.. //depot/projects/nsched/sys/fs/msdosfs/msdosfs_fileno.c#1 branch
.. //depot/projects/nsched/sys/fs/msdosfs/msdosfs_vfsops.c#3 integrate
.. //depot/projects/nsched/sys/fs/msdosfs/msdosfs_vnops.c#2 integrate
.. //depot/projects/nsched/sys/fs/msdosfs/msdosfsmount.h#3 integrate
.. //depot/projects/nsched/sys/geom/concat/g_concat.c#4 integrate
.. //depot/projects/nsched/sys/geom/concat/g_concat.h#3 integrate
.. //depot/projects/nsched/sys/geom/geom_slice.c#4 integrate
.. //depot/projects/nsched/sys/geom/label/g_label.c#2 integrate
.. //depot/projects/nsched/sys/geom/label/g_label.h#2 integrate
.. //depot/projects/nsched/sys/geom/stripe/g_stripe.c#2 integrate
.. //depot/projects/nsched/sys/geom/stripe/g_stripe.h#2 integrate
.. //depot/projects/nsched/sys/geom/vinum/geom_vinum.c#4 integrate
.. //depot/projects/nsched/sys/gnu/ext2fs/ext2_vfsops.c#4 integrate
.. //depot/projects/nsched/sys/i386/acpica/acpi_wakeup.c#3 integrate
.. //depot/projects/nsched/sys/i386/i386/busdma_machdep.c#2 integrate
.. //depot/projects/nsched/sys/i386/i386/nexus.c#5 integrate
.. //depot/projects/nsched/sys/i386/i386/pmap.c#10 integrate
.. //depot/projects/nsched/sys/i386/isa/isa.c#3 integrate
.. //depot/projects/nsched/sys/i386/isa/isa.h#3 integrate
.. //depot/projects/nsched/sys/i386/isa/isa_dma.c#3 integrate
.. //depot/projects/nsched/sys/i386/linux/linux_ptrace.c#2 integrate
.. //depot/projects/nsched/sys/i386/pci/pci_cfgreg.c#3 integrate
.. //depot/projects/nsched/sys/i4b/driver/i4b_ing.c#4 integrate
.. //depot/projects/nsched/sys/ia64/ia64/pmap.c#7 integrate
.. //depot/projects/nsched/sys/isa/orm.c#2 integrate
.. //depot/projects/nsched/sys/isofs/cd9660/cd9660_lookup.c#3 integrate
.. //depot/projects/nsched/sys/isofs/cd9660/cd9660_node.c#4 integrate
.. //depot/projects/nsched/sys/isofs/cd9660/cd9660_rrip.c#4 integrate
.. //depot/projects/nsched/sys/isofs/cd9660/cd9660_rrip.h#3 integrate
.. //depot/projects/nsched/sys/isofs/cd9660/cd9660_vfsops.c#4 integrate
.. //depot/projects/nsched/sys/kern/kern_event.c#4 integrate
.. //depot/projects/nsched/sys/kern/sched_4bsd.c#23 edit
.. //depot/projects/nsched/sys/kern/sched_ule.c#11 integrate
.. //depot/projects/nsched/sys/kern/uipc_socket.c#9 integrate
.. //depot/projects/nsched/sys/kern/vfs_bio.c#5 integrate
.. //depot/projects/nsched/sys/kern/vfs_default.c#3 integrate
.. //depot/projects/nsched/sys/kern/vfs_mount.c#5 integrate
.. //depot/projects/nsched/sys/kern/vfs_subr.c#8 integrate
.. //depot/projects/nsched/sys/modules/msdosfs/Makefile#2 integrate
.. //depot/projects/nsched/sys/net/bpf.c#6 integrate
.. //depot/projects/nsched/sys/net/bridge.c#5 integrate
.. //depot/projects/nsched/sys/net/if_disc.c#4 integrate
.. //depot/projects/nsched/sys/net/if_faith.c#6 integrate
.. //depot/projects/nsched/sys/net/if_gif.c#6 integrate
.. //depot/projects/nsched/sys/net/if_gre.c#5 integrate
.. //depot/projects/nsched/sys/net/if_vlan.c#6 integrate
.. //depot/projects/nsched/sys/net/rtsock.c#5 integrate
.. //depot/projects/nsched/sys/netgraph/ng_async.c#3 integrate
.. //depot/projects/nsched/sys/netgraph/ng_eiface.c#5 integrate
.. //depot/projects/nsched/sys/netgraph/ng_fec.c#6 integrate
.. //depot/projects/nsched/sys/netgraph/ng_gif_demux.c#3 integrate
.. //depot/projects/nsched/sys/netgraph/ng_iface.c#4 integrate
.. //depot/projects/nsched/sys/netgraph/ng_sppp.c#4 integrate
.. //depot/projects/nsched/sys/nfs4client/nfs4_vfsops.c#3 integrate
.. //depot/projects/nsched/sys/nfsclient/nfs_subs.c#5 integrate
.. //depot/projects/nsched/sys/nfsclient/nfs_vfsops.c#3 integrate
.. //depot/projects/nsched/sys/nfsserver/nfs_srvcache.c#4 integrate
.. //depot/projects/nsched/sys/pci/if_dc.c#6 integrate
.. //depot/projects/nsched/sys/pci/if_de.c#5 integrate
.. //depot/projects/nsched/sys/pci/if_devar.h#2 integrate
.. //depot/projects/nsched/sys/pci/if_rl.c#7 integrate
.. //depot/projects/nsched/sys/pci/if_rlreg.h#4 integrate
.. //depot/projects/nsched/sys/pci/if_sf.c#5 integrate
.. //depot/projects/nsched/sys/pci/if_ti.c#4 integrate
.. //depot/projects/nsched/sys/pci/if_xl.c#6 integrate
.. //depot/projects/nsched/sys/pci/if_xlreg.h#2 integrate
.. //depot/projects/nsched/sys/powerpc/ofw/ofw_syscons.c#3 integrate
.. //depot/projects/nsched/sys/powerpc/ofw/ofw_syscons.h#3 integrate
.. //depot/projects/nsched/sys/powerpc/powerpc/pmap.c#5 integrate
.. //depot/projects/nsched/sys/sparc64/ebus/ebus.c#5 integrate
.. //depot/projects/nsched/sys/sparc64/fhc/fhc.c#3 integrate
.. //depot/projects/nsched/sys/sparc64/pci/psycho.c#5 integrate
.. //depot/projects/nsched/sys/sparc64/sbus/sbus.c#5 integrate
.. //depot/projects/nsched/sys/sparc64/sparc64/iommu.c#5 integrate
.. //depot/projects/nsched/sys/sparc64/sparc64/nexus.c#5 integrate
.. //depot/projects/nsched/sys/sys/event.h#2 integrate
.. //depot/projects/nsched/sys/sys/mount.h#5 integrate
.. //depot/projects/nsched/sys/sys/vnode.h#6 integrate
.. //depot/projects/nsched/sys/ufs/ffs/ffs_snapshot.c#5 integrate
.. //depot/projects/nsched/sys/ufs/ffs/ffs_vfsops.c#5 integrate
.. //depot/projects/nsched/sys/ufs/ufs/ufs_quota.c#3 integrate
.. //depot/projects/nsched/sys/vm/swap_pager.c#6 integrate
.. //depot/projects/nsched/sys/vm/uma_core.c#4 integrate
Differences ...
==== //depot/projects/nsched/sys/alpha/alpha/pmap.c#6 (text+ko) ====
@@ -148,7 +148,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/alpha/alpha/pmap.c,v 1.150 2004/06/15 19:28:39 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/alpha/alpha/pmap.c,v 1.152 2004/07/05 23:18:48 alc Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -520,6 +520,7 @@
/*
* Initialize the kernel pmap (which is statically allocated).
*/
+ PMAP_LOCK_INIT(kernel_pmap);
kernel_pmap->pm_lev1 = Lev1map;
kernel_pmap->pm_active = ~0;
kernel_pmap->pm_asn[alpha_pal_whami()].asn = 0;
@@ -741,10 +742,8 @@
* Extract the physical page address associated
* with the given map/virtual_address pair.
*/
-vm_offset_t
-pmap_extract(pmap, va)
- register pmap_t pmap;
- vm_offset_t va;
+vm_paddr_t
+pmap_extract(pmap_t pmap, vm_offset_t va)
{
pt_entry_t* pte = pmap_lev3pte(pmap, va);
if (pte)
@@ -988,6 +987,7 @@
{
int i;
+ PMAP_LOCK_INIT(pmap);
pmap->pm_lev1 = Lev1map;
pmap->pm_ptphint = NULL;
pmap->pm_active = 0;
@@ -1012,6 +1012,8 @@
vm_page_t lev1pg;
int i;
+ PMAP_LOCK_INIT(pmap);
+
/*
* allocate object for the ptes
*/
@@ -1294,6 +1296,7 @@
mtx_lock_spin(&allpmaps_lock);
LIST_REMOVE(pmap, pm_list);
mtx_unlock_spin(&allpmaps_lock);
+ PMAP_LOCK_DESTROY(pmap);
}
/*
@@ -1618,6 +1621,7 @@
s = splvm();
while ((pv = TAILQ_FIRST(&m->md.pv_list)) != NULL) {
+ PMAP_LOCK(pv->pv_pmap);
pte = pmap_lev3pte(pv->pv_pmap, pv->pv_va);
pv->pv_pmap->pm_stats.resident_count--;
@@ -1647,6 +1651,7 @@
TAILQ_REMOVE(&m->md.pv_list, pv, pv_list);
m->md.pv_list_count--;
pmap_unuse_pt(pv->pv_pmap, pv->pv_va, pv->pv_ptem);
+ PMAP_UNLOCK(pv->pv_pmap);
free_pv_entry(pv);
}
@@ -2033,6 +2038,7 @@
if (pmap == NULL)
return;
+ PMAP_LOCK(pmap);
pte = pmap_lev3pte(pmap, va);
if (wired && !pmap_pte_w(pte))
@@ -2045,6 +2051,7 @@
* invalidate TLB.
*/
pmap_pte_set_w(pte, wired);
+ PMAP_UNLOCK(pmap);
}
@@ -2186,6 +2193,7 @@
#endif
s = splvm();
+ PMAP_LOCK(pmap);
for(pv = TAILQ_FIRST(&pmap->pm_pvlist);
pv;
pv = npv) {
@@ -2232,6 +2240,7 @@
}
splx(s);
pmap_invalidate_all(pmap);
+ PMAP_UNLOCK(pmap);
}
/*
@@ -2273,6 +2282,7 @@
}
#endif
+ PMAP_LOCK(pv->pv_pmap);
pte = pmap_lev3pte(pv->pv_pmap, pv->pv_va);
changed = 0;
@@ -2288,6 +2298,7 @@
}
if (changed)
pmap_invalidate_page(pv->pv_pmap, pv->pv_va);
+ PMAP_UNLOCK(pv->pv_pmap);
}
if (!setem && bit == (PG_UWE|PG_KWE))
vm_page_flag_clear(m, PG_WRITEABLE);
@@ -2340,6 +2351,7 @@
*/
count = 0;
TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) {
+ PMAP_LOCK(pv->pv_pmap);
pte = pmap_lev3pte(pv->pv_pmap, pv->pv_va);
if (!(*pte & PG_FOR)) {
@@ -2347,6 +2359,7 @@
*pte |= PG_FOR | PG_FOE;
pmap_invalidate_page(pv->pv_pmap, pv->pv_va);
}
+ PMAP_UNLOCK(pv->pv_pmap);
}
return count;
@@ -2416,12 +2429,14 @@
* Loop over current mappings setting PG_FOW where needed.
*/
TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) {
+ PMAP_LOCK(pv->pv_pmap);
pte = pmap_lev3pte(pv->pv_pmap, pv->pv_va);
if (!(*pte & PG_FOW)) {
*pte |= PG_FOW;
pmap_invalidate_page(pv->pv_pmap, pv->pv_va);
}
+ PMAP_UNLOCK(pv->pv_pmap);
}
}
@@ -2443,12 +2458,14 @@
* Loop over current mappings setting PG_FOR and PG_FOE where needed.
*/
TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) {
+ PMAP_LOCK(pv->pv_pmap);
pte = pmap_lev3pte(pv->pv_pmap, pv->pv_va);
if (!(*pte & (PG_FOR | PG_FOE))) {
*pte |= (PG_FOR | PG_FOE);
pmap_invalidate_page(pv->pv_pmap, pv->pv_va);
}
+ PMAP_UNLOCK(pv->pv_pmap);
}
}
==== //depot/projects/nsched/sys/alpha/include/pmap.h#6 (text+ko) ====
@@ -39,7 +39,7 @@
* from: hp300: @(#)pmap.h 7.2 (Berkeley) 12/16/90
* from: @(#)pmap.h 7.4 (Berkeley) 5/12/91
* from: i386 pmap.h,v 1.54 1997/11/20 19:30:35 bde Exp
- * $FreeBSD: src/sys/alpha/include/pmap.h,v 1.31 2004/06/23 08:06:52 alc Exp $
+ * $FreeBSD: src/sys/alpha/include/pmap.h,v 1.32 2004/07/05 16:59:56 alc Exp $
*/
#ifndef _MACHINE_PMAP_H_
@@ -95,6 +95,8 @@
#ifndef LOCORE
#include <sys/queue.h>
+#include <sys/_lock.h>
+#include <sys/_mutex.h>
typedef alpha_pt_entry_t pt_entry_t;
@@ -165,6 +167,7 @@
#define ASNGEN_MASK ((1 << ASNGEN_BITS) - 1)
struct pmap {
+ struct mtx pm_mtx;
pt_entry_t *pm_lev1; /* KVA of lev0map */
vm_object_t pm_pteobj; /* Container for pte's */
TAILQ_HEAD(,pv_entry) pm_pvlist; /* list of mappings in pmap */
@@ -183,6 +186,17 @@
#ifdef _KERNEL
extern struct pmap kernel_pmap_store;
#define kernel_pmap (&kernel_pmap_store)
+
+#define PMAP_LOCK(pmap) mtx_lock(&(pmap)->pm_mtx)
+#define PMAP_LOCK_ASSERT(pmap, type) \
+ mtx_assert(&(pmap)->pm_mtx, (type))
+#define PMAP_LOCK_DESTROY(pmap) mtx_destroy(&(pmap)->pm_mtx)
+#define PMAP_LOCK_INIT(pmap) mtx_init(&(pmap)->pm_mtx, "pmap", \
+ NULL, MTX_DEF)
+#define PMAP_LOCKED(pmap) mtx_owned(&(pmap)->pm_mtx)
+#define PMAP_MTX(pmap) (&(pmap)->pm_mtx)
+#define PMAP_TRYLOCK(pmap) mtx_trylock(&(pmap)->pm_mtx)
+#define PMAP_UNLOCK(pmap) mtx_unlock(&(pmap)->pm_mtx)
#endif
/*
==== //depot/projects/nsched/sys/amd64/amd64/pmap.c#12 (text+ko) ====
@@ -75,7 +75,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.479 2004/06/23 04:37:14 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.480 2004/07/06 02:33:11 alc Exp $");
/*
* Manages physical address maps.
@@ -760,15 +760,13 @@
* with the given map/virtual_address pair.
*/
vm_paddr_t
-pmap_extract(pmap, va)
- register pmap_t pmap;
- vm_offset_t va;
+pmap_extract(pmap_t pmap, vm_offset_t va)
{
vm_paddr_t rtval;
pt_entry_t *pte;
pd_entry_t pde, *pdep;
- if (pmap == 0)
+ if (pmap == NULL)
return 0;
PMAP_LOCK(pmap);
pdep = pmap_pde(pmap, va);
@@ -781,7 +779,7 @@
return rtval;
}
pte = pmap_pte(pmap, va);
- rtval = ((*pte & PG_FRAME) | (va & PAGE_MASK));
+ rtval = (*pte & PG_FRAME) | (va & PAGE_MASK);
PMAP_UNLOCK(pmap);
return rtval;
}
==== //depot/projects/nsched/sys/arm/arm/pmap.c#3 (text+ko) ====
@@ -144,7 +144,7 @@
*/
/* Include header files */
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/arm/pmap.c,v 1.3 2004/06/19 20:50:50 cognet Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/arm/pmap.c,v 1.4 2004/07/05 23:08:27 alc Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
@@ -3488,7 +3488,7 @@
* Extract the physical page address associated
* with the given map/virtual_address pair.
*/
-vm_offset_t
+vm_paddr_t
pmap_extract(pmap_t pm, vm_offset_t va)
{
struct l2_dtable *l2;
==== //depot/projects/nsched/sys/boot/common/ufsread.c#2 (text+ko) ====
@@ -23,7 +23,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/boot/common/ufsread.c,v 1.12 2003/08/25 23:30:41 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/boot/common/ufsread.c,v 1.13 2004/07/04 16:11:01 stefanf Exp $");
#include <ufs/ufs/dinode.h>
#include <ufs/ffs/fs.h>
@@ -68,7 +68,7 @@
static int ls, dsk_meta;
static uint32_t fs_off;
-static __inline__ int
+static __inline int
fsfind(const char *name, ino_t * ino)
{
char buf[DEV_BSIZE];
==== //depot/projects/nsched/sys/coda/coda_subr.c#2 (text+ko) ====
@@ -52,7 +52,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/coda/coda_subr.c,v 1.28 2003/11/05 04:30:06 kan Exp $");
+__FBSDID("$FreeBSD: src/sys/coda/coda_subr.c,v 1.29 2004/07/04 08:52:33 phk Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -308,15 +308,12 @@
coda_checkunmounting(mp)
struct mount *mp;
{
- register struct vnode *vp, *nvp;
+ struct vnode *vp, *nvp;
struct cnode *cp;
int count = 0, bad = 0;
MNT_ILOCK(mp);
- for (vp = TAILQ_FIRST(&mp->mnt_nvnodelist); vp; vp = nvp) {
- nvp = TAILQ_NEXT(vp, v_nmntvnodes);
- if (vp->v_mount != mp)
- continue;
+ MNT_VNODE_FOREACH(vp, mp, nvp) {
VI_LOCK(vp);
if (vp->v_iflag & VI_XLOCK) {
VI_UNLOCK(vp);
==== //depot/projects/nsched/sys/conf/NOTES#9 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/NOTES,v 1.1240 2004/07/02 20:21:41 jhb Exp $
+# $FreeBSD: src/sys/conf/NOTES,v 1.1241 2004/07/03 13:22:38 tjr Exp $
#
# NOTES -- Lines that can be cut/pasted into kernel and hints configs.
#
@@ -843,6 +843,18 @@
options NTFS_ICONV
options UDF_ICONV
+# Experimental support for large MS-DOS filesystems.
+#
+# WARNING: This uses at least 32 bytes of kernel memory (which is not
+# reclaimed until the FS is unmounted) for each file on disk to map
+# between the 32-bit inode numbers used by VFS and the 64-bit pseudo-inode
+# numbers used internally by msdosfs. This is only safe to use in certain
+# controlled situations (e.g. read-only FS with less than 1 million files).
+# Since the mappings do not persist across unmounts (or reboots), these
+# filesystems are not suitable for exporting through NFS, or any other
+# application that requires fixed inode numbers.
+options MSDOSFS_LARGE
+
#####################################################################
# POSIX P1003.1B
==== //depot/projects/nsched/sys/conf/files#15 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/files,v 1.922 2004/07/02 19:40:36 pjd Exp $
+# $FreeBSD: src/sys/conf/files,v 1.923 2004/07/03 13:22:38 tjr Exp $
#
# The long compile-with and dependency lines are required because of
# limitations in config: backslash-newline doesn't work in strings, and
@@ -880,6 +880,7 @@
fs/msdosfs/msdosfs_lookup.c optional msdosfs
fs/msdosfs/msdosfs_vfsops.c optional msdosfs
fs/msdosfs/msdosfs_vnops.c optional msdosfs
+fs/msdosfs/msdosfs_fileno.c optional msdosfs_large
fs/msdosfs/msdosfs_iconv.c optional msdosfs_iconv
fs/ntfs/ntfs_compr.c optional ntfs
fs/ntfs/ntfs_ihash.c optional ntfs
==== //depot/projects/nsched/sys/conf/options#10 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/options,v 1.459 2004/07/02 20:21:42 jhb Exp $
+# $FreeBSD: src/sys/conf/options,v 1.460 2004/07/03 13:22:38 tjr Exp $
#
# On the handling of kernel options
#
@@ -219,6 +219,9 @@
NETSMB opt_netsmb.h
NETSMBCRYPTO opt_netsmb.h
+# Experimental support for large MS-DOS filesystems; SEE WARNING IN "NOTES"!
+MSDOSFS_LARGE opt_msdosfs.h
+
# Options used only in subr_param.c.
HZ opt_param.h
MAXFILES opt_param.h
==== //depot/projects/nsched/sys/dev/acpica/acpi_pcib_acpi.c#6 (text+ko) ====
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/dev/acpica/acpi_pcib_acpi.c,v 1.37 2004/06/30 16:08:03 njl Exp $
+ * $FreeBSD: src/sys/dev/acpica/acpi_pcib_acpi.c,v 1.38 2004/07/04 16:23:25 imp Exp $
*/
#include "opt_acpi.h"
#include <sys/param.h>
@@ -309,14 +309,16 @@
u_long start, u_long end, u_long count, u_int flags)
{
/*
- * If no memory preference is given, use upper 256MB slot most
+ * If no memory preference is given, use upper 2GB slot most
* bioses use for their memory window. Typically other bridges
* before us get in the way to assert their preferences on memory.
* Hardcoding like this sucks, so a more MD/MI way needs to be
- * found to do it.
+ * found to do it. This is typically only used on older laptops
+ * that don't have pci busses behind pci bridge, so assuming < 2GB
+ * is liekly OK.
*/
if (type == SYS_RES_MEMORY && start == 0UL && end == ~0UL)
- start = 0xf0000000;
+ start = 0x80000000;
return (bus_generic_alloc_resource(dev, child, type, rid, start, end,
count, flags));
}
==== //depot/projects/nsched/sys/dev/fdc/fdc.c#4 (text+ko) ====
@@ -49,7 +49,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/fdc/fdc.c,v 1.273 2004/06/16 09:46:43 phk Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/fdc/fdc.c,v 1.275 2004/07/05 20:56:06 phk Exp $");
#include "opt_fdc.h"
#include "card.h"
@@ -132,6 +132,7 @@
{
int fdcu; /* our unit number */
int dmachan;
+ int dmacnt;
int flags;
#define FDC_ATTACHED 0x01
#define FDC_STAT_VALID 0x08
@@ -770,7 +771,8 @@
}
fdc->res_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ,
- &fdc->rid_irq, RF_ACTIVE);
+ &fdc->rid_irq,
+ RF_ACTIVE | RF_SHAREABLE);
if (fdc->res_irq == 0) {
device_printf(dev, "cannot reserve interrupt line\n");
return ENXIO;
@@ -778,13 +780,12 @@
if ((fdc->flags & FDC_NODMA) == 0) {
fdc->res_drq = bus_alloc_resource_any(dev, SYS_RES_DRQ,
- &fdc->rid_drq,
- RF_ACTIVE);
+ &fdc->rid_drq, RF_ACTIVE | RF_SHAREABLE);
if (fdc->res_drq == 0) {
device_printf(dev, "cannot reserve DMA request line\n");
- return ENXIO;
- }
- fdc->dmachan = rman_get_start(fdc->res_drq);
+ fdc->flags |= FDC_NODMA;
+ } else
+ fdc->dmachan = rman_get_start(fdc->res_drq);
}
return 0;
@@ -964,9 +965,6 @@
/* reset controller, turn motor off */
fdout_wr(fdc, 0);
- if ((fdc->flags & FDC_NODMA) == 0)
- isa_dma_release(fdc->dmachan);
-
if ((fdc->flags & FDC_ATTACHED) == 0) {
device_printf(dev, "already unloaded\n");
return (0);
@@ -1030,15 +1028,6 @@
fdc->fdcu = device_get_unit(dev);
fdc->flags |= FDC_ATTACHED | FDC_NEEDS_RESET;
- if ((fdc->flags & FDC_NODMA) == 0) {
- /*
- * Acquire the DMA channel forever, the driver will do
- * the rest
- * XXX should integrate with rman
- */
- isa_dma_acquire(fdc->dmachan);
- isa_dmainit(fdc->dmachan, MAX_SEC_SIZE);
- }
fdc->state = DEVIDLE;
/* reset controller, turn motor off, clear fdout mirror reg */
@@ -1574,6 +1563,14 @@
return (rv);
}
fd->flags |= FD_OPEN;
+
+ if ((fdc->flags & FDC_NODMA) == 0) {
+ if (fdc->dmacnt++ == 0) {
+ isa_dma_acquire(fdc->dmachan);
+ isa_dmainit(fdc->dmachan, MAX_SEC_SIZE);
+ }
+ }
+
/*
* Clearing the DMA overrun counter at open time is a bit messy.
* Since we're only managing one counter per controller, opening
@@ -1594,11 +1591,17 @@
fdclose(struct cdev *dev, int flags, int mode, struct thread *td)
{
struct fd_data *fd;
+ fdc_p fdc;
fd = dev->si_drv1;
+ fdc = fd->fdc;
fd->flags &= ~(FD_OPEN | FD_NONBLOCK);
fd->options &= ~(FDOPT_NORETRY | FDOPT_NOERRLOG | FDOPT_NOERROR);
+ if ((fdc->flags & FDC_NODMA) == 0)
+ if (--fdc->dmacnt == 0)
+ isa_dma_release(fdc->dmachan);
+
return (0);
}
==== //depot/projects/nsched/sys/dev/hifn/hifn7751.c#3 (text+ko) ====
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/hifn/hifn7751.c,v 1.27 2004/05/30 20:08:33 phk Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/hifn/hifn7751.c,v 1.28 2004/07/04 16:11:01 stefanf Exp $");
/*
* Driver for various Hifn encryption processors.
@@ -151,7 +151,7 @@
static void hifn_write_reg_0(struct hifn_softc *, bus_size_t, u_int32_t);
static void hifn_write_reg_1(struct hifn_softc *, bus_size_t, u_int32_t);
-static __inline__ u_int32_t
+static __inline u_int32_t
READ_REG_0(struct hifn_softc *sc, bus_size_t reg)
{
u_int32_t v = bus_space_read_4(sc->sc_st0, sc->sc_sh0, reg);
@@ -160,7 +160,7 @@
}
#define WRITE_REG_0(sc, reg, val) hifn_write_reg_0(sc, reg, val)
-static __inline__ u_int32_t
+static __inline u_int32_t
READ_REG_1(struct hifn_softc *sc, bus_size_t reg)
{
u_int32_t v = bus_space_read_4(sc->sc_st1, sc->sc_sh1, reg);
==== //depot/projects/nsched/sys/dev/nmdm/nmdm.c#7 (text+ko) ====
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/nmdm/nmdm.c,v 1.28 2004/06/17 17:16:45 phk Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/nmdm/nmdm.c,v 1.29 2004/07/04 16:27:58 phk Exp $");
/*
* Pseudo-nulmodem driver
@@ -48,6 +48,7 @@
#include <sys/poll.h>
#include <sys/kernel.h>
#include <sys/module.h>
+#include <sys/serial.h>
#include <sys/vnode.h>
#include <sys/signalvar.h>
#include <sys/malloc.h>
@@ -58,6 +59,7 @@
static void nmdmstart(struct tty *tp);
static void nmdmstop(struct tty *tp, int rw);
static void nmdminit(struct cdev *dev);
+static t_modem_t nmdmmodem;
static d_open_t nmdmopen;
static d_close_t nmdmclose;
@@ -76,9 +78,9 @@
#define BFLAG CLONE_FLAG0
struct softpart {
- struct tty *nm_tty;
- struct cdev *dev;
- int dcd;
+ struct tty *nm_tty;
+ struct cdev *dev;
+ int nm_dcd;
struct task pt_task;
struct softpart *other;
};
@@ -151,14 +153,14 @@
otp = sp->other->nm_tty;
KASSERT(otp != NULL, ("NULL otp in nmdmstart"));
KASSERT(otp != tp, ("NULL otp == tp nmdmstart"));
- if (sp->other->dcd) {
+ if (sp->other->nm_dcd) {
if (!(tp->t_state & TS_ISOPEN)) {
- sp->other->dcd = 0;
+ sp->other->nm_dcd = 0;
(void)ttyld_modem(otp, 0);
}
} else {
if (tp->t_state & TS_ISOPEN) {
- sp->other->dcd = 1;
+ sp->other->nm_dcd = 1;
(void)ttyld_modem(otp, 1);
}
}
@@ -200,6 +202,7 @@
pt->part1.nm_tty = ttymalloc(pt->part1.nm_tty);
pt->part1.nm_tty->t_oproc = nmdmstart;
pt->part1.nm_tty->t_stop = nmdmstop;
+ pt->part1.nm_tty->t_modem = nmdmmodem;
pt->part1.nm_tty->t_dev = dev1;
pt->part1.nm_tty->t_sc = &pt->part1;
TASK_INIT(&pt->part1.pt_task, 0, nmdm_task_tty, pt->part1.nm_tty);
@@ -207,6 +210,7 @@
pt->part2.nm_tty = ttymalloc(pt->part2.nm_tty);
pt->part2.nm_tty->t_oproc = nmdmstart;
pt->part2.nm_tty->t_stop = nmdmstop;
+ pt->part2.nm_tty->t_modem = nmdmmodem;
pt->part2.nm_tty->t_dev = dev2;
pt->part2.nm_tty->t_sc = &pt->part2;
TASK_INIT(&pt->part2.pt_task, 0, nmdm_task_tty, pt->part2.nm_tty);
@@ -260,6 +264,33 @@
}
static int
+nmdmmodem(struct tty *tp, int sigon, int sigoff)
+{
+ struct softpart *sp;
+ int i;
+
+ sp = tp->t_sc;
+ if (sigon || sigoff) {
+ if (sigon & SER_DTR) {
+ sp->other->nm_dcd = 1;
+ ttyld_modem(sp->other->nm_tty, sp->other->nm_dcd);
+ }
+ if (sigoff & SER_DTR) {
+ sp->other->nm_dcd = 0;
+ ttyld_modem(sp->other->nm_tty, sp->other->nm_dcd);
+ }
+ return (0);
+ } else {
+ i = 0;
+ if (sp->nm_dcd)
+ i |= SER_DCD;
+ if (sp->other->nm_dcd)
+ i |= SER_DTR;
+ return (i);
+ }
+}
+
+static int
nmdmclose(struct cdev *dev, int flag, int mode, struct thread *td)
{
==== //depot/projects/nsched/sys/dev/pcf/pcfvar.h#2 (text+ko) ====
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/dev/pcf/pcfvar.h,v 1.1 2004/05/25 07:42:45 joerg Exp $
+ * $FreeBSD: src/sys/dev/pcf/pcfvar.h,v 1.2 2004/07/04 16:11:01 stefanf Exp $
*/
#define IO_PCFSIZE 2
@@ -86,7 +86,7 @@
/*
* Specific register access to PCF8584
*/
-static __inline__ void
+static __inline void
pcf_set_S0(struct pcf_softc *sc, int data)
{
bus_space_write_1(sc->res_ioport->r_bustag,
@@ -95,7 +95,7 @@
pcf_nops();
}
-static __inline__ void
+static __inline void
pcf_set_S1(struct pcf_softc *sc, int data)
{
bus_space_write_1(sc->res_ioport->r_bustag,
@@ -104,7 +104,7 @@
pcf_nops();
}
-static __inline__ char
+static __inline char
pcf_get_S0(struct pcf_softc *sc)
{
char data;
@@ -116,7 +116,7 @@
return (data);
}
-static __inline__ char
+static __inline char
pcf_get_S1(struct pcf_softc *sc)
{
char data;
==== //depot/projects/nsched/sys/dev/re/if_re.c#6 (text+ko) ====
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/re/if_re.c,v 1.26 2004/06/28 20:09:02 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/re/if_re.c,v 1.28 2004/07/06 02:48:29 bms Exp $");
/*
* RealTek 8139C+/8169/8169S/8110S PCI NIC driver
@@ -79,11 +79,11 @@
*
* o Jumbo frames
*
- * o GMII and TBI ports/registers for interfacing with copper
+ * o GMII and TBI ports/registers for interfacing with copper
* or fiber PHYs
*
- * o RX and TX DMA rings can have up to 1024 descriptors
- * (the 8139C+ allows a maximum of 64)
+ * o RX and TX DMA rings can have up to 1024 descriptors
+ * (the 8139C+ allows a maximum of 64)
*
* o Slight differences in register layout from the 8139C+
*
@@ -98,7 +98,7 @@
* programming API as the older 8169, but also have some vendor-specific
* registers for the on-board PHY. The 8110S is a LAN-on-motherboard
* part designed to be pin-compatible with the RealTek 8100 10/100 chip.
- *
+ *
* This driver takes advantage of the RX and TX checksum offload and
* VLAN tag insertion/extraction features. It also implements TX
* interrupt moderation using the timer interrupt registers, which
@@ -307,8 +307,6 @@
EE_CLR(RL_EE_CLK);
DELAY(100);
}
-
- return;
}
/*
@@ -349,8 +347,6 @@
CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_OFF);
*dest = word;
-
- return;
}
/*
@@ -375,8 +371,6 @@
else
*ptr = word;
}
-
- return;
}
static int
@@ -389,7 +383,7 @@
int i;
if (phy != 1)
- return(0);
+ return (0);
sc = device_get_softc(dev);
@@ -397,7 +391,7 @@
if (reg == RL_GMEDIASTAT) {
rval = CSR_READ_1(sc, RL_GMEDIASTAT);
- return(rval);
+ return (rval);
}
CSR_WRITE_4(sc, RL_PHYAR, reg << 16);
@@ -469,9 +463,9 @@
/* Pretend the internal PHY is only at address 0 */
if (phy) {
RL_UNLOCK(sc);
- return(0);
+ return (0);
}
- switch(reg) {
+ switch (reg) {
case MII_BMCR:
re8139_reg = RL_BMCR;
break;
@@ -490,7 +484,7 @@
case MII_PHYIDR1:
case MII_PHYIDR2:
RL_UNLOCK(sc);
- return(0);
+ return (0);
/*
* Allow the rlphy driver to read the media status
* register. If we have a link partner which does not
@@ -500,15 +494,15 @@
case RL_MEDIASTAT:
rval = CSR_READ_1(sc, RL_MEDIASTAT);
RL_UNLOCK(sc);
- return(rval);
+ return (rval);
default:
printf("re%d: bad phy register\n", sc->rl_unit);
RL_UNLOCK(sc);
- return(0);
+ return (0);
}
rval = CSR_READ_2(sc, re8139_reg);
RL_UNLOCK(sc);
- return(rval);
+ return (rval);
}
static int
@@ -532,9 +526,9 @@
/* Pretend the internal PHY is only at address 0 */
if (phy) {
RL_UNLOCK(sc);
- return(0);
+ return (0);
}
- switch(reg) {
+ switch (reg) {
case MII_BMCR:
re8139_reg = RL_BMCR;
break;
@@ -553,23 +547,23 @@
case MII_PHYIDR1:
case MII_PHYIDR2:
RL_UNLOCK(sc);
- return(0);
+ return (0);
break;
default:
printf("re%d: bad phy register\n", sc->rl_unit);
RL_UNLOCK(sc);
- return(0);
+ return (0);
}
CSR_WRITE_2(sc, re8139_reg, data);
RL_UNLOCK(sc);
- return(0);
+ return (0);
}
static void
re_miibus_statchg(dev)
device_t dev;
{
- return;
+
}
/*
@@ -623,8 +617,6 @@
CSR_WRITE_4(sc, RL_RXCFG, rxfilt);
CSR_WRITE_4(sc, RL_MAR0, hashes[0]);
CSR_WRITE_4(sc, RL_MAR4, hashes[1]);
-
- return;
}
static void
@@ -644,8 +636,6 @@
printf("re%d: reset never completed!\n", sc->rl_unit);
CSR_WRITE_1(sc, 0x82, 1);
-
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list