Date: Sat, 8 May 2004 11:20:02 -0700 (PDT) From: Marcel Moolenaar <marcel@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 52510 for review Message-ID: <200405081820.i48IK23s054501@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=52510 Change 52510 by marcel@marcel_nfs on 2004/05/08 11:19:04 IFC @52509 Affected files ... .. //depot/projects/gdb/include/fts.h#2 integrate .. //depot/projects/gdb/lib/libc/gen/fts.c#3 integrate .. //depot/projects/gdb/sys/conf/files.sparc64#5 integrate .. //depot/projects/gdb/sys/conf/options.sparc64#3 integrate .. //depot/projects/gdb/sys/dev/an/if_an_pccard.c#2 integrate .. //depot/projects/gdb/sys/dev/awi/if_awi_pccard.c#4 integrate .. //depot/projects/gdb/sys/dev/cs/if_cs_pccard.c#2 integrate .. //depot/projects/gdb/sys/dev/ed/if_ed_pccard.c#2 integrate .. //depot/projects/gdb/sys/dev/sn/if_sn_pccard.c#2 integrate .. //depot/projects/gdb/sys/dev/snc/if_snc_pccard.c#2 integrate .. //depot/projects/gdb/sys/dev/sound/pcm/ac97.c#3 integrate .. //depot/projects/gdb/sys/dev/wi/if_wi_pccard.c#3 integrate .. //depot/projects/gdb/sys/kern/kern_resource.c#5 integrate .. //depot/projects/gdb/sys/kern/uipc_syscalls.c#10 integrate .. //depot/projects/gdb/sys/kern/vfs_bio.c#6 integrate .. //depot/projects/gdb/sys/sparc64/conf/GENERIC#5 integrate .. //depot/projects/gdb/sys/sparc64/conf/NOTES#3 integrate .. //depot/projects/gdb/sys/sparc64/ebus/ebus.c#5 integrate .. //depot/projects/gdb/sys/sparc64/include/ofw_bus.h#2 integrate .. //depot/projects/gdb/sys/sparc64/isa/isa.c#3 integrate .. //depot/projects/gdb/sys/sparc64/isa/ofw_isa.c#3 integrate .. //depot/projects/gdb/sys/sparc64/isa/ofw_isa.h#3 integrate .. //depot/projects/gdb/sys/sparc64/pci/apb.c#2 integrate .. //depot/projects/gdb/sys/sparc64/pci/ofw_pci.c#2 integrate .. //depot/projects/gdb/sys/sparc64/pci/ofw_pci.h#2 integrate .. //depot/projects/gdb/sys/sparc64/pci/ofw_pci_if.m#2 integrate .. //depot/projects/gdb/sys/sparc64/pci/ofw_pcib.c#2 integrate .. //depot/projects/gdb/sys/sparc64/pci/ofw_pcib_subr.c#2 integrate .. //depot/projects/gdb/sys/sparc64/pci/ofw_pcib_subr.h#2 integrate .. //depot/projects/gdb/sys/sparc64/pci/psycho.c#4 integrate .. //depot/projects/gdb/sys/sparc64/pci/psychovar.h#3 integrate .. //depot/projects/gdb/sys/sparc64/sparc64/ofw_bus.c#2 integrate .. //depot/projects/gdb/sys/sparc64/sparc64/ofw_machdep.c#3 integrate Differences ... ==== //depot/projects/gdb/include/fts.h#2 (text+ko) ==== @@ -31,12 +31,14 @@ * SUCH DAMAGE. * * @(#)fts.h 8.3 (Berkeley) 8/14/94 - * $FreeBSD: src/include/fts.h,v 1.7 2002/09/21 01:28:36 wollman Exp $ + * $FreeBSD: src/include/fts.h,v 1.8 2004/05/08 15:09:01 peadar Exp $ */ #ifndef _FTS_H_ #define _FTS_H_ +struct _fts_private; /* implementation data */ + typedef struct { struct _ftsent *fts_cur; /* current node */ struct _ftsent *fts_child; /* linked list of children */ @@ -63,6 +65,7 @@ #define FTS_STOP 0x200 /* (private) unrecoverable error */ int fts_options; /* fts_open options, global flags */ void *fts_clientptr; /* thunk for sort function */ + struct _fts_private *fts_priv; /* Implementation data */ } FTS; typedef struct _ftsent { ==== //depot/projects/gdb/lib/libc/gen/fts.c#3 (text+ko) ==== @@ -37,12 +37,13 @@ static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94"; #endif /* LIBC_SCCS and not lint */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/lib/libc/gen/fts.c,v 1.23 2004/05/05 06:33:00 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/gen/fts.c,v 1.24 2004/05/08 15:09:02 peadar Exp $"); #include "namespace.h" #include <sys/types.h> #include <sys/param.h> #include <sys/stat.h> +#include <sys/mount.h> #include <dirent.h> #include <errno.h> @@ -63,6 +64,7 @@ static FTSENT *fts_sort(FTS *, FTSENT *, int); static u_short fts_stat(FTS *, FTSENT *, int); static int fts_safe_changedir(FTS *, FTSENT *, int, char *); +static int fts_ufslinks(FTS *sp, const FTSENT *ent); #define ISDOT(a) (a[0] == '.' && (!a[1] || (a[1] == '.' && !a[2]))) @@ -77,12 +79,43 @@ #define BNAMES 2 /* fts_children, names only */ #define BREAD 3 /* fts_read */ +/* + * Internal representation of FTS, including extra implementation details. + * The FTS returned from fts_open is ftsp_fts from this structure, and it's + * fts_priv in turn points back to this internal version. i.e. for a given + * fts_private *priv: &priv->fts_fts == (FTS *)f == priv->fts_fts.fts_priv + */ +struct _fts_private { + FTS ftsp_fts; + struct statfs ftsp_statfs; + dev_t ftsp_dev; + int ftsp_linksreliable; +}; + +/* + * The "FTS_NOSTAT" option can avoid a lot of calls to stat(2) if it knows + * that a directory could not possibly have subdirectories. This is decided + * by looking at the link count: A subdirectory would increment its parent's + * link count by virtue of its own ".." entry. + * This assumption only holds for UFS-like filesystems that implement links + * and directories this way, so we must punt for others. + */ + +static const char *ufslike_filesystems[] = { + "ufs", + "nfs", + "nfs4", + "ext2fs", + 0 +}; + FTS * fts_open(argv, options, compar) char * const *argv; int options; int (*compar)(const FTSENT * const *, const FTSENT * const *); { + struct _fts_private *priv; FTS *sp; FTSENT *p, *root; int nitems; @@ -96,11 +129,13 @@ } /* Allocate/initialize the stream */ - if ((sp = malloc(sizeof(FTS))) == NULL) + if ((priv = malloc(sizeof(struct _fts_private))) == NULL) return (NULL); - memset(sp, 0, sizeof(FTS)); + memset(priv, 0, sizeof(struct _fts_private)); + sp = &priv->ftsp_fts; sp->fts_compar = compar; sp->fts_options = options; + sp->fts_priv = priv; /* Shush, GCC. */ tmp = NULL; @@ -637,7 +672,10 @@ /* Be quiet about nostat, GCC. */ nostat = 0; } else if (ISSET(FTS_NOSTAT) && ISSET(FTS_PHYSICAL)) { - nlinks = cur->fts_nlink - (ISSET(FTS_SEEDOT) ? 0 : 2); + if (fts_ufslinks(sp, cur)) + nlinks = cur->fts_nlink - (ISSET(FTS_SEEDOT) ? 0 : 2); + else + nlinks = -1; nostat = 1; } else { nlinks = -1; @@ -1154,3 +1192,37 @@ errno = oerrno; return (ret); } + +/* + * Check if the filesystem for "ent" has UFS-style links. + */ +static int +fts_ufslinks(FTS *sp, const FTSENT *ent) +{ + struct _fts_private *priv; + const char **cpp; + + priv = sp->fts_priv; + /* + * If this node's device is different from the previous, grab + * the filesystem information, and decide on the reliability + * of the link information from this filesystem for stat(2) + * avoidance. + */ + if (priv->ftsp_dev != ent->fts_dev) { + if (statfs(ent->fts_path, &priv->ftsp_statfs) != -1) { + priv->ftsp_dev = ent->fts_dev; + priv->ftsp_linksreliable = 0; + for (cpp = ufslike_filesystems; *cpp; cpp++) { + if (strcmp(priv->ftsp_statfs.f_fstypename, + *cpp) == 0) { + priv->ftsp_linksreliable = 1; + break; + } + } + } else { + priv->ftsp_linksreliable = 0; + } + } + return priv->ftsp_linksreliable; +} ==== //depot/projects/gdb/sys/conf/files.sparc64#5 (text+ko) ==== @@ -1,7 +1,7 @@ # This file tells config what files go into building a kernel, # files marked standard are always included. # -# $FreeBSD: src/sys/conf/files.sparc64,v 1.52 2004/04/30 15:00:40 marius Exp $ +# $FreeBSD: src/sys/conf/files.sparc64,v 1.53 2004/05/08 13:53:46 marius Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -54,9 +54,9 @@ sparc64/isa/ofw_isa.c optional isa sparc64/pci/apb.c optional pci sparc64/pci/ofw_pci.c optional pci -sparc64/pci/ofw_pcib.c optional pci ofw_newpci -sparc64/pci/ofw_pcib_subr.c optional pci ofw_newpci -sparc64/pci/ofw_pcibus.c optional pci ofw_newpci +sparc64/pci/ofw_pcib.c optional pci +sparc64/pci/ofw_pcib_subr.c optional pci +sparc64/pci/ofw_pcibus.c optional pci sparc64/pci/ofw_pci_if.m optional pci sparc64/pci/psycho.c optional pci sparc64/sbus/sbus.c optional sbus ==== //depot/projects/gdb/sys/conf/options.sparc64#3 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/options.sparc64,v 1.9 2004/04/30 15:21:25 tmm Exp $ +# $FreeBSD: src/sys/conf/options.sparc64,v 1.10 2004/05/08 13:53:46 marius Exp $ SUN4U opt_global.h @@ -9,7 +9,6 @@ PSYCHO_DEBUG opt_psycho.h DEBUGGER_ON_POWERFAIL opt_psycho.h OFW_PCI_DEBUG opt_ofw_pci.h -OFW_NEWPCI opt_ofw_pci.h # Debug IOMMU inserts/removes using diagnostic accesses. Very loud. IOMMU_DIAG opt_iommu.h PMAP_STATS opt_pmap.h ==== //depot/projects/gdb/sys/dev/an/if_an_pccard.c#2 (text+ko) ==== @@ -38,7 +38,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/an/if_an_pccard.c,v 1.23 2003/12/30 01:07:12 ambrisko Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/an/if_an_pccard.c,v 1.24 2004/05/08 06:04:05 imp Exp $"); #include "opt_inet.h" @@ -105,7 +105,6 @@ DRIVER_MODULE(an, pccard, an_pccard_driver, an_pccard_devclass, 0, 0); MODULE_DEPEND(an, wlan, 1, 1, 1); -MODULE_DEPEND(an, pccard, 1, 1, 1); static const struct pccard_product an_pccard_products[] = { PCMCIA_CARD(AIRONET, PC4800, 0), ==== //depot/projects/gdb/sys/dev/awi/if_awi_pccard.c#4 (text+ko) ==== @@ -24,7 +24,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/awi/if_awi_pccard.c,v 1.16 2004/03/17 17:50:28 njl Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/awi/if_awi_pccard.c,v 1.17 2004/05/08 06:04:05 imp Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -301,4 +301,3 @@ DRIVER_MODULE(awi, pccard, awi_pccard_driver, awi_devclass, 0, 0); MODULE_DEPEND(awi, wlan, 1, 1, 1); -MODULE_DEPEND(awi, pccard, 1, 1, 1); ==== //depot/projects/gdb/sys/dev/cs/if_cs_pccard.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/cs/if_cs_pccard.c,v 1.8 2003/10/31 18:31:58 brooks Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/cs/if_cs_pccard.c,v 1.9 2004/05/08 06:06:13 imp Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -125,5 +125,4 @@ extern devclass_t cs_devclass; DRIVER_MODULE(cs, pccard, cs_pccard_driver, cs_devclass, 0, 0); -MODULE_DEPEND(cs, pccard, 1, 1, 1); MODULE_DEPEND(cs, ether, 1, 1, 1); ==== //depot/projects/gdb/sys/dev/ed/if_ed_pccard.c#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/ed/if_ed_pccard.c,v 1.55 2003/12/31 04:25:00 kato Exp $ + * $FreeBSD: src/sys/dev/ed/if_ed_pccard.c,v 1.56 2004/05/08 06:04:06 imp Exp $ */ #include "opt_ed.h" @@ -65,7 +65,6 @@ MODULE_DEPEND(ed, miibus, 1, 1, 1); #endif MODULE_DEPEND(ed, ether, 1, 1, 1); -MODULE_DEPEND(ed, pccard, 1, 1, 1); /* * PC-Card (PCMCIA) specific code. ==== //depot/projects/gdb/sys/dev/sn/if_sn_pccard.c#2 (text+ko) ==== @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/sn/if_sn_pccard.c,v 1.20 2003/10/25 19:56:19 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/sn/if_sn_pccard.c,v 1.21 2004/05/08 06:04:06 imp Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -169,5 +169,4 @@ extern devclass_t sn_devclass; DRIVER_MODULE(sn, pccard, sn_pccard_driver, sn_devclass, 0, 0); -MODULE_DEPEND(sn, pccard, 1, 1, 1); MODULE_DEPEND(sn, ether, 1, 1, 1); ==== //depot/projects/gdb/sys/dev/snc/if_snc_pccard.c#2 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/snc/if_snc_pccard.c,v 1.4 2003/08/24 18:03:45 obrien Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/snc/if_snc_pccard.c,v 1.5 2004/05/08 06:04:06 imp Exp $"); /* * National Semiconductor DP8393X SONIC Driver @@ -80,7 +80,6 @@ DRIVER_MODULE(snc, pccard, snc_pccard_driver, snc_devclass, 0, 0); MODULE_DEPEND(snc, ether, 1, 1, 1); -MODULE_DEPEND(snc, pccard, 1, 1, 1); /* * snc_pccard_detach - unload the driver and clear the table. ==== //depot/projects/gdb/sys/dev/sound/pcm/ac97.c#3 (text+ko) ==== @@ -30,7 +30,7 @@ #include "mixer_if.h" -SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pcm/ac97.c,v 1.50 2004/01/23 16:38:54 matk Exp $"); +SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pcm/ac97.c,v 1.51 2004/05/08 03:41:40 sanpei Exp $"); MALLOC_DEFINE(M_AC97, "ac97", "ac97 codec"); @@ -150,6 +150,7 @@ { 0x43525900, 0x07, 0, "CS4297", 0 }, { 0x43525910, 0x07, 0, "CS4297A", 0 }, { 0x43525920, 0x07, 0, "CS4294/98", 0 }, + { 0x4352592d, 0x07, 0, "CS4294", 0 }, { 0x43525930, 0x07, 0, "CS4299", 0 }, { 0x43525940, 0x07, 0, "CS4201", 0 }, { 0x43525958, 0x07, 0, "CS4205", 0 }, ==== //depot/projects/gdb/sys/dev/wi/if_wi_pccard.c#3 (text+ko) ==== @@ -39,7 +39,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/wi/if_wi_pccard.c,v 1.43 2004/03/25 21:58:55 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/wi/if_wi_pccard.c,v 1.44 2004/05/08 06:04:06 imp Exp $"); #include "opt_wi.h" @@ -120,7 +120,6 @@ DRIVER_MODULE(wi, pccard, wi_pccard_driver, wi_devclass, 0, 0); MODULE_DEPEND(wi, wlan, 1, 1, 1); -MODULE_DEPEND(wi, pccard, 1, 1, 1); #if __FreeBSD_version >= 500000 static const struct pccard_product wi_pccard_products[] = { ==== //depot/projects/gdb/sys/kern/kern_resource.c#5 (text+ko) ==== @@ -35,7 +35,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/kern/kern_resource.c,v 1.136 2004/04/10 11:08:16 mux Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_resource.c,v 1.137 2004/05/08 08:56:05 julian Exp $"); #include "opt_compat.h" @@ -313,11 +313,12 @@ int rtprio(td, uap) - struct thread *td; + struct thread *td; /* curthread */ register struct rtprio_args *uap; { struct proc *curp; - register struct proc *p; + struct proc *p; + struct ksegrp *kg; struct rtprio rtp; int cierror, error; @@ -342,7 +343,33 @@ if ((error = p_cansee(td, p))) break; mtx_lock_spin(&sched_lock); - pri_to_rtp(FIRST_KSEGRP_IN_PROC(p), &rtp); + /* + * Return OUR priority if no pid specified, + * or if one is, report the highest priority + * in the process. There isn't much more you can do as + * there is only room to return a single priority. + * XXXKSE Maybe need a new interface to report + * priorities of multiple system scope threads. + * Note: specifying our own pid is not the same + * as leaving it zero. + */ + if (uap->pid == 0) { + pri_to_rtp(td->td_ksegrp, &rtp); + } else { + struct rtprio rtp2; + + rtp.type = RTP_PRIO_IDLE; + rtp.prio = RTP_PRIO_MAX; + FOREACH_KSEGRP_IN_PROC(p, kg) { + pri_to_rtp(kg, &rtp2); + if ((rtp2.type < rtp.type) || + ((rtp2.type == rtp.type) && + (rtp2.prio < rtp.prio))) { + rtp.type = rtp2.type; + rtp.prio = rtp2.prio; + } + } + } mtx_unlock_spin(&sched_lock); PROC_UNLOCK(p); return (copyout(&rtp, uap->rtp, sizeof(struct rtprio))); @@ -373,7 +400,21 @@ } } mtx_lock_spin(&sched_lock); - error = rtp_to_pri(&rtp, FIRST_KSEGRP_IN_PROC(p)); + /* + * If we are setting our own priority, set just our + * KSEGRP but if we are doing another process, + * do all the groups on that process. If we + * specify our own pid we do the latter. + */ + if (uap->pid == 0) { + error = rtp_to_pri(&rtp, td->td_ksegrp); + } else { + FOREACH_KSEGRP_IN_PROC(p, kg) { + if ((error = rtp_to_pri(&rtp, kg)) != 0) { + break; + } + } + } mtx_unlock_spin(&sched_lock); break; default: ==== //depot/projects/gdb/sys/kern/uipc_syscalls.c#10 (text+ko) ==== @@ -33,7 +33,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/kern/uipc_syscalls.c,v 1.182 2004/05/06 05:03:22 alc Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/uipc_syscalls.c,v 1.183 2004/05/08 02:24:21 rwatson Exp $"); #include "opt_compat.h" #include "opt_ktrace.h" @@ -1705,7 +1705,7 @@ int error, s, headersize = 0, headersent = 0; struct iovec *hdr_iov = NULL; - NET_LOCK_GIANT(); + mtx_lock(&Giant); hdtr_size = 0; @@ -2070,7 +2070,7 @@ if (m_header) m_freem(m_header); - NET_UNLOCK_GIANT(); + mtx_unlock(&Giant); if (error == ERESTART) error = EINTR; ==== //depot/projects/gdb/sys/kern/vfs_bio.c#6 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/kern/vfs_bio.c,v 1.433 2004/05/06 05:03:22 alc Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/vfs_bio.c,v 1.434 2004/05/08 06:46:40 alc Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -3522,7 +3522,7 @@ void vfs_bio_clrbuf(struct buf *bp) { - int i, mask = 0; + int i, j, mask = 0; caddr_t sa, ea; GIANT_REQUIRED; @@ -3533,9 +3533,10 @@ VM_OBJECT_LOCK(bp->b_object); if( (bp->b_npages == 1) && (bp->b_bufsize < PAGE_SIZE) && (bp->b_offset & PAGE_MASK) == 0) { + if (bp->b_pages[0] == bogus_page) + goto unlock; mask = (1 << (bp->b_bufsize / DEV_BSIZE)) - 1; - if (bp->b_pages[0] != bogus_page) - VM_OBJECT_LOCK_ASSERT(bp->b_pages[0]->object, MA_OWNED); + VM_OBJECT_LOCK_ASSERT(bp->b_pages[0]->object, MA_OWNED); if ((bp->b_pages[0]->valid & mask) == mask) goto unlock; if (((bp->b_pages[0]->flags & PG_ZERO) == 0) && @@ -3547,14 +3548,15 @@ } ea = sa = bp->b_data; for(i=0;i<bp->b_npages;i++,sa=ea) { - int j = ((vm_offset_t)sa & PAGE_MASK) / DEV_BSIZE; + if (bp->b_pages[i] == bogus_page) + continue; + j = ((vm_offset_t)sa & PAGE_MASK) / DEV_BSIZE; ea = (caddr_t)trunc_page((vm_offset_t)sa + PAGE_SIZE); ea = (caddr_t)(vm_offset_t)ulmin( (u_long)(vm_offset_t)ea, (u_long)(vm_offset_t)bp->b_data + bp->b_bufsize); mask = ((1 << ((ea - sa) / DEV_BSIZE)) - 1) << j; - if (bp->b_pages[i] != bogus_page) - VM_OBJECT_LOCK_ASSERT(bp->b_pages[i]->object, MA_OWNED); + VM_OBJECT_LOCK_ASSERT(bp->b_pages[i]->object, MA_OWNED); if ((bp->b_pages[i]->valid & mask) == mask) continue; if ((bp->b_pages[i]->valid & mask) == 0) { ==== //depot/projects/gdb/sys/sparc64/conf/GENERIC#5 (text+ko) ==== @@ -18,7 +18,7 @@ # # For hardware specific information check HARDWARE.TXT # -# $FreeBSD: src/sys/sparc64/conf/GENERIC,v 1.71 2004/05/02 20:40:19 marcel Exp $ +# $FreeBSD: src/sys/sparc64/conf/GENERIC,v 1.72 2004/05/08 13:53:46 marius Exp $ machine sparc64 cpu SUN4U @@ -76,14 +76,6 @@ device central device fhc -# New OpenFirmware PCI framework. This fixes a number of interrupt- -# routing problems and changes the device enumeration to be hopefully -# closer to Solaris. Be aware that, because of the latter, enabling or -# disabling this option may require reconfiguration, and can even -# cause the machine to not boot without manual intervention before the -# fstab is adjusted. -options OFW_NEWPCI - # Floppy drives #device fdc ==== //depot/projects/gdb/sys/sparc64/conf/NOTES#3 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/sparc64/conf/NOTES,v 1.5 2004/04/30 15:00:41 marius Exp $ +# $FreeBSD: src/sys/sparc64/conf/NOTES,v 1.6 2004/05/08 13:53:46 marius Exp $ # # This file contains machine dependent kernel configuration notes. For # machine independent notes, look in /sys/conf/NOTES. @@ -31,14 +31,6 @@ device central device fhc -# New OpenFirmware PCI framework. This fixes a number of interrupt- -# routing problems and changes the device enumeration to be hopefully -# closer to Solaris. Be aware that, because of the latter, enabling or -# disabling this option may require reconfiguration, and can even -# cause the machine to not boot without manual intervention before the -# fstab is adjusted. -#options OFW_NEWPCI - ##################################################################### # HARDWARE DEVICE CONFIGURATION ==== //depot/projects/gdb/sys/sparc64/ebus/ebus.c#5 (text+ko) ==== @@ -28,7 +28,7 @@ * * from: NetBSD: ebus.c,v 1.26 2001/09/10 16:27:53 eeh Exp * - * $FreeBSD: src/sys/sparc64/ebus/ebus.c,v 1.14 2004/04/30 19:19:55 tmm Exp $ + * $FreeBSD: src/sys/sparc64/ebus/ebus.c,v 1.15 2004/05/08 13:53:46 marius Exp $ */ /* @@ -46,8 +46,6 @@ * there are machines with both ISA and EBus. */ -#include "opt_ofw_pci.h" - #include <sys/param.h> #include <sys/systm.h> #include <sys/bus.h> @@ -59,7 +57,6 @@ #include <sys/rman.h> #include <dev/ofw/openfirm.h> -#include <dev/ofw/ofw_pci.h> #include <machine/ofw_bus.h> #include <machine/resource.h> @@ -99,9 +96,7 @@ int sc_nrange; int sc_nimap; -#ifdef OFW_NEWPCI struct ofw_bus_iinfo sc_iinfo; -#endif }; static device_probe_t ebus_probe; @@ -151,25 +146,13 @@ DRIVER_MODULE(ebus, pci, ebus_driver, ebus_devclass, 0, 0); -static phandle_t -ebus_get_busnode(device_t dev) -{ - -#ifdef OFW_NEWPCI - return (ofw_pci_get_node(dev)); -#else - return (ofw_pci_find_node(pci_get_bus(dev), pci_get_slot(dev), - pci_get_function(dev))); -#endif -} - static int ebus_probe(device_t dev) { char name[10]; phandle_t node; - if ((node = ebus_get_busnode(dev)) == 0) + if ((node = ofw_pci_get_node(dev)) == 0) return (ENXIO); OF_getprop(node, "name", &name, sizeof(name)); @@ -200,7 +183,7 @@ int i, rnum, rid; sc = device_get_softc(dev); - sc->sc_node = node = ebus_get_busnode(dev); + sc->sc_node = node = ofw_pci_get_node(dev); sc->sc_nrange = OF_getprop_alloc(node, "ranges", sizeof(*sc->sc_range), (void **)&sc->sc_range); @@ -239,9 +222,7 @@ } } -#ifdef OFW_NEWPCI ofw_bus_setup_iinfo(node, &sc->sc_iinfo, sizeof(ofw_isa_intr_t)); -#endif /* * Now attach our children. @@ -490,17 +471,10 @@ nintr = OF_getprop_alloc(node, "interrupts", sizeof(*intrs), (void **)&intrs); for (i = 0; i < nintr; i++) { -#ifdef OFW_NEWPCI rintr = ofw_isa_route_intr(dev, node, &sc->sc_iinfo, intrs[i]); - if (rintr == PCI_INVALID_IRQ) { -#else - rintr = ofw_bus_route_intr(node, intrs[i], ofw_pci_orb_callback, - dev); - if (rintr == ORIR_NOTFOUND) { -#endif + if (rintr == PCI_INVALID_IRQ) panic("ebus_setup_dinfo: could not map ebus " "interrupt %d", intrs[i]); - } resource_list_add(&edi->edi_rl, SYS_RES_IRQ, i, rintr, rintr, 1); } ==== //depot/projects/gdb/sys/sparc64/include/ofw_bus.h#2 (text+ko) ==== @@ -22,7 +22,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/sparc64/include/ofw_bus.h,v 1.5 2003/07/01 14:52:46 tmm Exp $ + * $FreeBSD: src/sys/sparc64/include/ofw_bus.h,v 1.6 2004/05/08 13:53:46 marius Exp $ */ #ifndef _MACHINE_OFW_BUS_H_ @@ -37,8 +37,6 @@ */ typedef u_int32_t pcell_t; -#ifdef OFW_NEWPCI - struct ofw_bus_iinfo { u_int8_t *opi_imap; u_int8_t *opi_imapmsk; @@ -52,13 +50,4 @@ int ofw_bus_search_intrmap(void *, int, void *, int, void *, int, void *, void *, void *, int); -#else - -typedef int obr_callback_t(phandle_t, u_int8_t *, int, u_int8_t *, int, - u_int8_t **, int *, void *); - -u_int32_t ofw_bus_route_intr(phandle_t, int, obr_callback_t *, void *); - -#endif - #endif /* !_MACHINE_OFW_BUS_H_ */ ==== //depot/projects/gdb/sys/sparc64/isa/isa.c#3 (text+ko) ==== @@ -26,36 +26,28 @@ * * from: FreeBSD: src/sys/alpha/isa/isa.c,v 1.26 2001/07/11 * - * $FreeBSD: src/sys/sparc64/isa/isa.c,v 1.11 2004/03/17 21:45:55 jmg Exp $ + * $FreeBSD: src/sys/sparc64/isa/isa.c,v 1.12 2004/05/08 13:53:47 marius Exp $ */ -#include "opt_ofw_pci.h" - #include <sys/param.h> #include <sys/systm.h> -#include <sys/kernel.h> -#include <sys/module.h> #include <sys/bus.h> + #include <machine/bus.h> -#include <sys/malloc.h> -#include <sys/proc.h> + #include <sys/rman.h> -#include <sys/interrupt.h> #include <isa/isareg.h> #include <isa/isavar.h> #include <isa/isa_common.h> -#include <dev/pci/pcireg.h> -#include <dev/pci/pcivar.h> - -#include <dev/ofw/ofw_pci.h> #include <dev/ofw/openfirm.h> -#include <machine/intr_machdep.h> -#include <machine/ofw_bus.h> #include <machine/resource.h> +#include <dev/pci/pcireg.h> +#include <dev/pci/pcivar.h> + #include <sparc64/pci/ofw_pci.h> #include <sparc64/isa/ofw_isa.h> @@ -65,19 +57,16 @@ bus_space_tag_t isa_mem_bt = NULL; bus_space_handle_t isa_mem_hdl; -u_int64_t isa_io_base; -u_int64_t isa_io_limit; -u_int64_t isa_mem_base; -u_int64_t isa_mem_limit; +static u_int64_t isa_io_base; +static u_int64_t isa_io_limit; +static u_int64_t isa_mem_base; +static u_int64_t isa_mem_limit; device_t isa_bus_device; static phandle_t isab_node; static ofw_pci_intr_t isa_ino[8]; - -#ifdef OFW_NEWPCI struct ofw_bus_iinfo isa_iinfo; -#endif /* * XXX: This is really partly partly PCI-specific, but unfortunately is @@ -117,26 +106,17 @@ device_t bridge; phandle_t node; ofw_isa_intr_t ino; -#ifndef OFW_NEWPCI - ofw_pci_intr_t rino; -#endif struct isa_ranges *br; int nbr, i; /* The parent of the bus must be a PCI-ISA bridge. */ bridge = device_get_parent(dev); -#ifdef OFW_NEWPCI isab_node = ofw_pci_get_node(bridge); -#else - isab_node = ofw_pci_node(bridge); -#endif nbr = OF_getprop_alloc(isab_node, "ranges", sizeof(*br), (void **)&br); if (nbr <= 0) panic("isa_init: cannot get bridge range property"); -#ifdef OFW_NEWPCI ofw_bus_setup_iinfo(isab_node, &isa_iinfo, sizeof(ofw_isa_intr_t)); -#endif /* * This is really a bad kludge; however, it is needed to provide @@ -150,13 +130,8 @@ continue; if (ino > 7) panic("isa_init: XXX: ino too large"); -#ifdef OFW_NEWPCI isa_ino[ino] = ofw_isa_route_intr(bridge, node, &isa_iinfo, ino); -#else - rino = ofw_bus_route_intr(node, ino, ofw_pci_orb_callback, dev); - isa_ino[ino] = rino == ORIR_NOTFOUND ? PCI_INVALID_IRQ : rino; -#endif } for (nbr -= 1; nbr >= 0; nbr--) { ==== //depot/projects/gdb/sys/sparc64/isa/ofw_isa.c#3 (text+ko) ==== @@ -28,21 +28,18 @@ * * from: NetBSD: ebus.c,v 1.26 2001/09/10 16:27:53 eeh Exp * - * $FreeBSD: src/sys/sparc64/isa/ofw_isa.c,v 1.7 2004/04/28 13:06:45 tmm Exp $ + * $FreeBSD: src/sys/sparc64/isa/ofw_isa.c,v 1.8 2004/05/08 13:53:47 marius Exp $ */ /* * Helper functions which can be used in both ISA and EBus code. */ -#include "opt_ofw_pci.h" - #include <sys/param.h> #include <sys/systm.h> #include <sys/bus.h> #include <dev/ofw/openfirm.h> -#include <dev/ofw/ofw_pci.h> #include <machine/bus.h> #include <machine/resource.h> @@ -100,7 +97,6 @@ *start, *end); } -#ifdef OFW_NEWPCI ofw_pci_intr_t ofw_isa_route_intr(device_t bridge, phandle_t node, struct ofw_bus_iinfo *ii, ofw_isa_intr_t intr) @@ -122,4 +118,3 @@ } return (mintr); } -#endif /* OFW_NEWPCI */ ==== //depot/projects/gdb/sys/sparc64/isa/ofw_isa.h#3 (text+ko) ==== @@ -28,7 +28,7 @@ * * from: NetBSD: ebus.c,v 1.26 2001/09/10 16:27:53 eeh Exp * - * $FreeBSD: src/sys/sparc64/isa/ofw_isa.h,v 1.3 2004/04/28 13:06:45 tmm Exp $ + * $FreeBSD: src/sys/sparc64/isa/ofw_isa.h,v 1.4 2004/05/08 13:53:47 marius Exp $ */ #ifndef _SPARC64_ISA_OFW_ISA_H_ @@ -64,27 +64,11 @@ typedef u_int32_t ofw_isa_intr_t; -struct isa_imap { - u_int32_t phys_hi; /* high phys addr mask */ - u_int32_t phys_lo; /* low phys addr mask */ - ofw_isa_intr_t intr; /* interrupt mask */ - phandle_t cnode; /* child node */ - ofw_pci_intr_t cintr; /* child interrupt */ -}; - -struct isa_imap_msk { - u_int32_t phys_hi; /* high phys addr */ - u_int32_t phys_lo; /* low phys addr */ - ofw_isa_intr_t intr; /* interrupt */ -}; - int ofw_isa_range_restype(struct isa_ranges *); /* Map an IO range. Returns the resource type of the range. */ int ofw_isa_range_map(struct isa_ranges *, int, u_long *, u_long *, int *); -#ifdef OFW_NEWPCI ofw_pci_intr_t ofw_isa_route_intr(device_t, phandle_t, struct ofw_bus_iinfo *, ofw_isa_intr_t); -#endif #endif /* !_SPARC64_ISA_OFW_ISA_H_ */ ==== //depot/projects/gdb/sys/sparc64/pci/apb.c#2 (text+ko) ==== @@ -30,14 +30,14 @@ * * from: FreeBSD: src/sys/dev/pci/pci_pci.c,v 1.3 2000/12/13 * - * $FreeBSD: src/sys/sparc64/pci/apb.c,v 1.7 2003/08/22 07:38:07 imp Exp $ + * $FreeBSD: src/sys/sparc64/pci/apb.c,v 1.8 2004/05/08 13:53:47 marius Exp $ */ /* * Support for the Sun APB (Advanced PCI Bridge) PCI-PCI bridge. * This bridge does not fully comply to the PCI bridge specification, and is * therefore not supported by the generic driver. - * We can use some pf the pcib methods anyway. + * We can use some of the pcib methods anyway. */ #include "opt_ofw_pci.h" @@ -45,11 +45,9 @@ #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> -#include <sys/malloc.h> #include <sys/bus.h> #include <dev/ofw/openfirm.h> -#include <dev/ofw/ofw_pci.h> #include <machine/bus.h> #include <machine/ofw_bus.h> @@ -76,9 +74,6 @@ static device_probe_t apb_probe; static device_attach_t apb_attach; static bus_alloc_resource_t apb_alloc_resource; -#ifndef OFW_NEWPCI -static pcib_route_interrupt_t apb_route_interrupt; -#endif static device_method_t apb_methods[] = { /* Device interface */ @@ -103,17 +98,11 @@ DEVMETHOD(pcib_maxslots, pcib_maxslots), DEVMETHOD(pcib_read_config, pcib_read_config), DEVMETHOD(pcib_write_config, pcib_write_config), -#ifdef OFW_NEWPCI DEVMETHOD(pcib_route_interrupt, ofw_pcib_gen_route_interrupt), -#else - DEVMETHOD(pcib_route_interrupt, apb_route_interrupt), -#endif /* ofw_pci interface */ >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200405081820.i48IK23s054501>