Date: Wed, 12 Jun 2002 10:51:48 -0700 (PDT) From: Julian Elischer <julian@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 12758 for review Message-ID: <200206121751.g5CHpmc82147@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=12758 Change 12758 by julian@julian_jules1 on 2002/06/12 10:50:48 MFC Affected files ... ... //depot/projects/kse/sys/boot/alpha/boot1/Makefile#3 integrate ... //depot/projects/kse/sys/boot/alpha/boot1/boot1.c#2 integrate ... //depot/projects/kse/sys/boot/alpha/boot1/sys.c#5 delete ... //depot/projects/kse/sys/compat/svr4/svr4_stream.c#10 integrate ... //depot/projects/kse/sys/contrib/dev/acpica/acpica_prep.sh#2 integrate ... //depot/projects/kse/sys/dev/hea/eni.c#6 integrate ... //depot/projects/kse/sys/i386/i386/trap.c#47 integrate ... //depot/projects/kse/sys/kern/kern_tc.c#10 integrate ... //depot/projects/kse/sys/kern/sys_generic.c#26 integrate ... //depot/projects/kse/sys/netinet/in_pcb.c#17 integrate ... //depot/projects/kse/sys/netinet/ip_divert.c#14 integrate ... //depot/projects/kse/sys/netinet/raw_ip.c#15 integrate ... //depot/projects/kse/sys/netinet/tcp_subr.c#14 integrate ... //depot/projects/kse/sys/netinet/udp_usrreq.c#15 integrate ... //depot/projects/kse/sys/netinet6/in6_pcb.c#15 integrate ... //depot/projects/kse/sys/sys/socket.h#7 integrate ... //depot/projects/kse/sys/sys/systm.h#25 integrate ... //depot/projects/kse/sys/vm/vm_map.c#20 integrate Differences ... ==== //depot/projects/kse/sys/boot/alpha/boot1/Makefile#3 (text+ko) ==== @@ -1,5 +1,5 @@ # $NetBSD: Makefile,v 1.15 1998/03/28 00:21:35 thorpej Exp $ -# $FreeBSD: src/sys/boot/alpha/boot1/Makefile,v 1.12 2002/05/10 09:26:27 obrien Exp $ +# $FreeBSD: src/sys/boot/alpha/boot1/Makefile,v 1.13 2002/06/11 06:56:31 phk Exp $ .include <../Makefile.inc> @@ -7,7 +7,7 @@ .PATH: ${.CURDIR}/../libalpha -SRCS= start.S boot1.c sys.c +SRCS= start.S boot1.c CFLAGS+= -ffreestanding -mno-fp-regs CFLAGS+= -DSECONDARY_LOAD_ADDRESS=${SECONDARY_LOAD_ADDRESS} -DMINIMAL CFLAGS+= -DBOOT1 ==== //depot/projects/kse/sys/boot/alpha/boot1/boot1.c#2 (text+ko) ==== @@ -1,5 +1,5 @@ /* - * $FreeBSD: src/sys/boot/alpha/boot1/boot1.c,v 1.9 2000/10/25 23:24:43 dfr Exp $ + * $FreeBSD: src/sys/boot/alpha/boot1/boot1.c,v 1.11 2002/06/11 10:19:59 phk Exp $ * From $NetBSD: bootxx.c,v 1.4 1997/09/06 14:08:29 drochner Exp $ */ @@ -32,18 +32,42 @@ #include <string.h> #include <sys/param.h> +#include <sys/dirent.h> +#include <sys/disklabel.h> #include <machine/prom.h> #include <machine/rpb.h> #define DEBUGxx +void puts(const char *s); +void puthex(u_long v); +static int dskread(void *, u_int64_t, size_t); + +#define printf(...) \ +while (0) + +#define memcpy(dst, src, len) \ +bcopy(src, dst, len) + +#include "ufsread.c" + extern end[]; int errno; char *heap = (char*) end; void +bcopy(const void *src, void *dst, size_t len) +{ + const char *s; + char *d; + + for (d = dst, s = src; len; len--) + *d++ = *s++; +} + +void putchar(int c) { if (c == '\n') @@ -70,21 +94,7 @@ putchar(*s++); } -void * -malloc(size_t size) -{ - char *p = heap; - size = (size + 7) & ~7; - heap += size; - return p; -} - void -free(void * p) -{ -} - -void panic(const char *message, ...) { puts(message); @@ -124,6 +134,7 @@ int digit; char hex[] = "0123456789abcdef"; + puts("0x"); if (!v) { puts("0"); return; @@ -138,11 +149,11 @@ #endif -void -devread(char *buf, int block, size_t size) +int +dskread(void *buf, u_int64_t block, size_t size) { #ifdef DEBUG - puts("devread("); + puts("dskread("); puthex((u_long)buf); puts(","); puthex(block); @@ -151,7 +162,8 @@ puts(")\n"); #endif - prom_read(prom_fd, size, buf, block); + prom_read(prom_fd, size * DEV_BSIZE, buf, block); + return (0); } static inline void @@ -189,17 +201,22 @@ return; } +static struct dmadat __dmadat; + static inline void loadfile(char *name, char *addr) { int n; char *p; + ino_t ino; puts("Loading "); puts(name); puts("\n"); - if (openrd(name)) { + dmadat = &__dmadat; + + if (devopen() || (ino = lookup(name)) == 0) { puts("Can't open file "); puts(name); puts("\n"); @@ -208,10 +225,16 @@ p = addr; do { - n = readit(p, 1024); + n = fsread(ino, p, VBLKSIZE); + if (n < 0) { + puts("Can't read file "); + puts(name); + puts("\n"); + halt(); + } p += n; twiddle(); - } while (n > 0); + } while (n == VBLKSIZE); devclose(); } ==== //depot/projects/kse/sys/compat/svr4/svr4_stream.c#10 (text+ko) ==== @@ -27,7 +27,7 @@ * (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/svr4/svr4_stream.c,v 1.29 2002/06/07 05:36:16 jhb Exp $ + * $FreeBSD: src/sys/compat/svr4/svr4_stream.c,v 1.30 2002/06/11 21:14:02 alfred Exp $ */ /* @@ -199,7 +199,7 @@ control = 0; } #ifdef KTRACE - if (KTRPOINT(td->td_proc, KTR_GENIO)) { + if (KTRPOINT(td, KTR_GENIO)) { int iovlen = auio.uio_iovcnt * sizeof (struct iovec); MALLOC(ktriov, struct iovec *, iovlen, M_TEMP, M_WAITOK); @@ -277,7 +277,7 @@ } } #ifdef KTRACE - if (KTRPOINT(td->td_proc, KTR_GENIO)) { + if (KTRPOINT(td, KTR_GENIO)) { int iovlen = auio.uio_iovcnt * sizeof (struct iovec); MALLOC(ktriov, struct iovec *, iovlen, M_TEMP, M_WAITOK); ==== //depot/projects/kse/sys/contrib/dev/acpica/acpica_prep.sh#2 (text+ko) ==== @@ -1,15 +1,20 @@ #!/bin/sh -# $FreeBSD: src/sys/contrib/dev/acpica/acpica_prep.sh,v 1.1 2002/02/08 02:16:45 msmith Exp $ +# $FreeBSD: src/sys/contrib/dev/acpica/acpica_prep.sh,v 1.2 2002/06/12 14:55:19 iwasaki Exp $ # # Unpack an ACPI CA drop and restructure it to fit the FreeBSD layout # +if [ ! $# -eq 1 ]; then + echo "usage: $0 acpica_archive" + exit +fi + src=$1 wrk=./_acpi_ca_unpack dst=./acpi_ca_destination # files to remove -stripdirs="compiler" +stripdirs="compiler generate" stripfiles="osunixxf.c 16bit.h Makefile a16find.c a16utils.asm a16utils.obj\ acintel.h aclinux.h acmsvc.h acwin.h acwin64.h getopt.c" @@ -39,4 +44,4 @@ # post-clean echo post-clean -rm -rf ${wrk}+rm -rf ${wrk} ==== //depot/projects/kse/sys/dev/hea/eni.c#6 (text+ko) ==== @@ -23,7 +23,7 @@ * Copies of this Software may be made, however, the above copyright * notice must be reproduced on all copies. * - * @(#) $FreeBSD: src/sys/dev/hea/eni.c,v 1.20 2002/06/03 09:16:51 mdodd Exp $ + * @(#) $FreeBSD: src/sys/dev/hea/eni.c,v 1.21 2002/06/11 21:22:32 alfred Exp $ * */ @@ -35,10 +35,6 @@ * */ -#ifdef COMPILING_LINT -#warning "The eni driver is broken and is not compiled with LINT" -#else - #include <sys/param.h> #include <sys/kernel.h> #include <sys/systm.h> @@ -70,7 +66,7 @@ #include <dev/hea/eni_var.h> #ifndef lint -__RCSID("@(#) $FreeBSD: src/sys/dev/hea/eni.c,v 1.20 2002/06/03 09:16:51 mdodd Exp $"); +__RCSID("@(#) $FreeBSD: src/sys/dev/hea/eni.c,v 1.21 2002/06/11 21:22:32 alfred Exp $"); #endif /* @@ -697,4 +693,3 @@ } #endif /* BSD < 199506 */ #endif -#endif ==== //depot/projects/kse/sys/i386/i386/trap.c#47 (text+ko) ==== @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)trap.c 7.4 (Berkeley) 5/13/91 - * $FreeBSD: src/sys/i386/i386/trap.c,v 1.224 2002/06/07 05:47:34 jhb Exp $ + * $FreeBSD: src/sys/i386/i386/trap.c,v 1.225 2002/06/12 13:30:52 bde Exp $ */ /* @@ -191,7 +191,16 @@ #endif atomic_add_int(&cnt.v_trap, 1); + type = frame.tf_trapno; +#ifdef DDB + if (db_active) { + eva = (type == T_PAGEFLT ? rcr2() : 0); + trap_fatal(&frame, eva); + goto out; + } +#endif + if ((frame.tf_eflags & PSL_I) == 0) { /* * Buggy application or kernel code has disabled @@ -200,7 +209,6 @@ * interrupts disabled until they are accidentally * enabled later. */ - type = frame.tf_trapno; if (ISPL(frame.tf_cs) == SEL_UPL || (frame.tf_eflags & PSL_VM)) printf( "pid %ld (%s): trap %d with interrupts disabled\n", @@ -223,7 +231,6 @@ } eva = 0; - type = frame.tf_trapno; code = frame.tf_err; if (type == T_PAGEFLT) { /* ==== //depot/projects/kse/sys/kern/kern_tc.c#10 (text+ko) ==== @@ -6,7 +6,7 @@ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * - * $FreeBSD: src/sys/kern/kern_tc.c,v 1.135 2002/05/30 16:26:39 phk Exp $ + * $FreeBSD: src/sys/kern/kern_tc.c,v 1.136 2002/06/11 19:47:44 kbyanc Exp $ */ #include "opt_ntp.h" @@ -88,7 +88,7 @@ #define TC_STATS(foo) \ static u_int foo; \ - SYSCTL_INT(_kern_timecounter, OID_AUTO, foo, CTLFLAG_RD, &foo, 0, "") \ + SYSCTL_UINT(_kern_timecounter, OID_AUTO, foo, CTLFLAG_RD, &foo, 0, "") \ struct __hack TC_STATS(nbinuptime); TC_STATS(nnanouptime); TC_STATS(nmicrouptime); ==== //depot/projects/kse/sys/kern/sys_generic.c#26 (text+ko) ==== @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)sys_generic.c 8.5 (Berkeley) 1/21/94 - * $FreeBSD: src/sys/kern/sys_generic.c,v 1.100 2002/06/07 05:36:16 jhb Exp $ + * $FreeBSD: src/sys/kern/sys_generic.c,v 1.101 2002/06/12 02:08:18 kbyanc Exp $ */ #include "opt_ktrace.h" @@ -713,8 +713,8 @@ */ struct mtx sellock; struct cv selwait; -int nselcoll; /* Select collisions since boot */ -SYSCTL_INT(_kern, OID_AUTO, nselcoll, CTLFLAG_RD, &nselcoll, 0, ""); +u_int nselcoll; /* Select collisions since boot */ +SYSCTL_UINT(_kern, OID_AUTO, nselcoll, CTLFLAG_RD, &nselcoll, 0, ""); /* * Select system call. @@ -744,8 +744,8 @@ fd_mask s_selbits[howmany(2048, NFDBITS)]; fd_mask *ibits[3], *obits[3], *selbits, *sbp; struct timeval atv, rtv, ttv; - int ncoll, error, timo; - u_int nbufbytes, ncpbytes, nfdbits; + int error, timo; + u_int ncoll, nbufbytes, ncpbytes, nfdbits; if (uap->nd < 0) return (EINVAL); @@ -955,8 +955,8 @@ caddr_t bits; char smallbits[32 * sizeof(struct pollfd)]; struct timeval atv, rtv, ttv; - int ncoll, error = 0, timo; - u_int nfds; + int error = 0, timo; + u_int ncoll, nfds; size_t ni; nfds = SCARG(uap, nfds); ==== //depot/projects/kse/sys/netinet/in_pcb.c#17 (text+ko) ==== @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)in_pcb.c 8.4 (Berkeley) 5/24/95 - * $FreeBSD: src/sys/netinet/in_pcb.c,v 1.106 2002/06/10 20:05:36 hsu Exp $ + * $FreeBSD: src/sys/netinet/in_pcb.c,v 1.107 2002/06/12 03:08:08 hsu Exp $ */ #include "opt_ipsec.h" @@ -704,15 +704,13 @@ struct inpcbinfo *pcbinfo; struct ifnet *ifp; { - struct inpcb *head; struct inpcb *inp; struct ip_moptions *imo; int i, gap; /* why no splnet here? XXX */ INP_INFO_RLOCK(pcbinfo); - head = LIST_FIRST(pcbinfo->listhead); - for (inp = head; inp != NULL; inp = LIST_NEXT(inp, inp_list)) { + LIST_FOREACH(inp, pcbinfo->listhead, inp_list) { INP_LOCK(inp); imo = inp->inp_moptions; if ((inp->inp_vflag & INP_IPV4) && @@ -741,7 +739,7 @@ } INP_UNLOCK(inp); } - INP_INFO_RLOCK(pcbinfo); + INP_INFO_RUNLOCK(pcbinfo); } /* ==== //depot/projects/kse/sys/netinet/ip_divert.c#14 (text+ko) ==== @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/netinet/ip_divert.c,v 1.62 2002/06/10 20:05:37 hsu Exp $ + * $FreeBSD: src/sys/netinet/ip_divert.c,v 1.64 2002/06/11 10:58:57 hsu Exp $ */ #include "opt_inet.h" @@ -114,6 +114,7 @@ void div_init(void) { + INP_INFO_LOCK_INIT(&divcbinfo, "div"); LIST_INIT(&divcb); divcbinfo.listhead = &divcb; /* @@ -533,7 +534,7 @@ * the pcbinfo for in_setpeeraddr to lock. */ static int -dip_sockaddr(struct socket *so, struct sockaddr **nam) +div_sockaddr(struct socket *so, struct sockaddr **nam) { return (in_setsockaddr(so, nam, &divcbinfo)); } @@ -543,7 +544,7 @@ * the pcbinfo for in_setpeeraddr to lock. */ static int -dip_peeraddr(struct socket *so, struct sockaddr **nam) +div_peeraddr(struct socket *so, struct sockaddr **nam) { return (in_setpeeraddr(so, nam, &divcbinfo)); } ==== //depot/projects/kse/sys/netinet/raw_ip.c#15 (text+ko) ==== @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)raw_ip.c 8.7 (Berkeley) 5/15/95 - * $FreeBSD: src/sys/netinet/raw_ip.c,v 1.96 2002/06/10 20:05:37 hsu Exp $ + * $FreeBSD: src/sys/netinet/raw_ip.c,v 1.97 2002/06/11 10:58:57 hsu Exp $ */ #include "opt_inet6.h" @@ -96,6 +96,7 @@ void rip_init() { + INP_INFO_LOCK_INIT(&ripcbinfo, "rip"); LIST_INIT(&ripcb); ripcbinfo.listhead = &ripcb; /* ==== //depot/projects/kse/sys/netinet/tcp_subr.c#14 (text+ko) ==== @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp_subr.c 8.2 (Berkeley) 5/24/95 - * $FreeBSD: src/sys/netinet/tcp_subr.c,v 1.130 2002/06/10 20:05:37 hsu Exp $ + * $FreeBSD: src/sys/netinet/tcp_subr.c,v 1.131 2002/06/12 03:11:06 hsu Exp $ */ #include "opt_compat.h" @@ -853,12 +853,9 @@ for (inp = LIST_FIRST(tcbinfo.listhead), i = 0; inp && i < n; inp = LIST_NEXT(inp, inp_list)) { INP_LOCK(inp); - if (inp->inp_gencnt <= gencnt) { - if (cr_canseesocket(req->td->td_ucred, - inp->inp_socket)) - continue; + if (inp->inp_gencnt <= gencnt && + cr_canseesocket(req->td->td_ucred, inp->inp_socket) == 0) inp_list[i++] = inp; - } INP_UNLOCK(inp); } INP_INFO_RUNLOCK(&tcbinfo); ==== //depot/projects/kse/sys/netinet/udp_usrreq.c#15 (text+ko) ==== @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)udp_usrreq.c 8.6 (Berkeley) 5/23/95 - * $FreeBSD: src/sys/netinet/udp_usrreq.c,v 1.111 2002/06/10 20:05:38 hsu Exp $ + * $FreeBSD: src/sys/netinet/udp_usrreq.c,v 1.112 2002/06/12 15:21:41 hsu Exp $ */ #include "opt_ipsec.h" @@ -337,15 +337,13 @@ * for a broadcast or multicast datgram.) */ udpstat.udps_noportbcast++; - INP_INFO_RUNLOCK(&udbinfo); - goto bad; + goto badheadlocked; } #ifdef IPSEC /* check AH/ESP integrity. */ if (ipsec4_in_reject_so(m, last->inp_socket)) { ipsecstat.in_polvio++; - INP_INFO_RUNLOCK(&udbinfo); - goto bad; + goto badheadlocked; } #endif /*IPSEC*/ INP_UNLOCK(last); @@ -358,7 +356,6 @@ */ inp = in_pcblookup_hash(&udbinfo, ip->ip_src, uh->uh_sport, ip->ip_dst, uh->uh_dport, 1, m->m_pkthdr.rcvif); - INP_INFO_RUNLOCK(&udbinfo); if (inp == NULL) { if (log_in_vain) { char buf[4*sizeof "123"]; @@ -372,27 +369,27 @@ udpstat.udps_noport++; if (m->m_flags & (M_BCAST | M_MCAST)) { udpstat.udps_noportbcast++; - goto bad; + goto badheadlocked; } if (badport_bandlim(BANDLIM_ICMP_UNREACH) < 0) - goto bad; + goto badheadlocked; if (blackhole) - goto bad; + goto badheadlocked; *ip = save_ip; ip->ip_len += iphlen; icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_PORT, 0, 0); INP_INFO_RUNLOCK(&udbinfo); return; } + INP_LOCK(inp); + INP_INFO_RUNLOCK(&udbinfo); #ifdef IPSEC if (ipsec4_in_reject_so(m, inp->inp_socket)) { ipsecstat.in_polvio++; - INP_INFO_RUNLOCK(&udbinfo); goto bad; } #endif /*IPSEC*/ - INP_LOCK(inp); /* * Construct sockaddr format source address. * Stuff source address and datagram in user buffer. @@ -429,6 +426,9 @@ sorwakeup(inp->inp_socket); INP_UNLOCK(inp); return; + +badheadlocked: + INP_INFO_RUNLOCK(&udbinfo); bad: if (inp) INP_UNLOCK(inp); ==== //depot/projects/kse/sys/netinet6/in6_pcb.c#15 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/netinet6/in6_pcb.c,v 1.29 2002/06/10 20:05:46 hsu Exp $ */ +/* $FreeBSD: src/sys/netinet6/in6_pcb.c,v 1.30 2002/06/12 06:01:22 hsu Exp $ */ /* $KAME: in6_pcb.c,v 1.31 2001/05/21 05:45:10 jinmei Exp $ */ /* @@ -622,6 +622,7 @@ ip_freemoptions(inp->inp_moptions); inp->inp_vflag = 0; + INP_LOCK_DESTROY(inp); uma_zfree(ipi->ipi_zone, inp); } ==== //depot/projects/kse/sys/sys/socket.h#7 (text+ko) ==== @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)socket.h 8.4 (Berkeley) 2/21/94 - * $FreeBSD: src/sys/sys/socket.h,v 1.61 2002/06/02 04:32:52 alfred Exp $ + * $FreeBSD: src/sys/sys/socket.h,v 1.62 2002/06/11 18:23:11 wollman Exp $ */ #ifndef _SYS_SOCKET_H_ @@ -95,7 +95,6 @@ #define SO_RCVTIMEO 0x1006 /* receive timeout */ #define SO_ERROR 0x1007 /* get error status and clear */ #define SO_TYPE 0x1008 /* get socket type */ -/*efine SO_PRIVSTATE 0x1009 get/deny privileged state */ /* * Structure used for manipulating linger option. ==== //depot/projects/kse/sys/sys/systm.h#25 (text+ko) ==== @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)systm.h 8.7 (Berkeley) 3/29/95 - * $FreeBSD: src/sys/sys/systm.h,v 1.174 2002/05/29 20:24:09 phk Exp $ + * $FreeBSD: src/sys/sys/systm.h,v 1.175 2002/06/12 02:08:17 kbyanc Exp $ */ #ifndef _SYS_SYSTM_H_ @@ -57,7 +57,7 @@ extern int nswap; /* size of swap space */ -extern int nselcoll; /* select collisions since boot */ +extern u_int nselcoll; /* select collisions since boot */ extern struct mtx sellock; /* select lock variable */ extern struct cv selwait; /* select conditional variable */ ==== //depot/projects/kse/sys/vm/vm_map.c#20 (text+ko) ==== @@ -61,7 +61,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $FreeBSD: src/sys/vm/vm_map.c,v 1.247 2002/06/10 06:11:45 alc Exp $ + * $FreeBSD: src/sys/vm/vm_map.c,v 1.250 2002/06/12 08:15:52 alc Exp $ */ /* @@ -429,11 +429,13 @@ static __inline int vm_map_unlock_and_wait(vm_map_t map, boolean_t user_wait) { + int retval; - GIANT_REQUIRED; + mtx_lock(&Giant); vm_map_unlock(map); - - return (tsleep(&map->root, PVM, "vmmapw", 0)); + retval = tsleep(&map->root, PVM, "vmmapw", 0); + mtx_unlock(&Giant); + return (retval); } /* @@ -1650,7 +1652,7 @@ */ } vm_map_lock(map); - if (last_timestamp+1 != map->timestamp) { + if (last_timestamp + 1 != map->timestamp) { /* * Look again for the entry because the map was * modified while it was unlocked. @@ -1704,7 +1706,7 @@ else rv = vm_fault_wire(map, saved_start, saved_end); vm_map_lock(map); - if (last_timestamp+1 != map->timestamp) { + if (last_timestamp + 1 != map->timestamp) { /* * Look again for the entry because the map was * modified while it was unlocked. The entry @@ -1719,14 +1721,24 @@ else first_entry = NULL; entry = tmp_entry; - while (entry->end < saved_end) + while (entry->end < saved_end) { + if (rv != KERN_SUCCESS) { + KASSERT(entry->wired_count == 1, + ("vm_map_wire: bad count")); + entry->wired_count = -1; + } entry = entry->next; + } } last_timestamp = map->timestamp; if (rv != KERN_SUCCESS) { + KASSERT(entry->wired_count == 1, + ("vm_map_wire: bad count")); /* - * XXX + * Assign an out-of-range value to represent + * the failure to wire this entry. */ + entry->wired_count = -1; end = entry->end; goto done; } @@ -1757,6 +1769,12 @@ if (rv == KERN_SUCCESS) { if (user_wire) entry->eflags |= MAP_ENTRY_USER_WIRED; + } else if (entry->wired_count == -1) { + /* + * Wiring failed on this entry. Thus, unwiring is + * unnecessary. + */ + entry->wired_count = 0; } else { if (!user_wire || (entry->wired_count == 1 && (entry->eflags & MAP_ENTRY_USER_WIRED) == 0)) @@ -2374,6 +2392,37 @@ vm_offset_t s, e; vm_pindex_t offidxstart, offidxend, count; + /* + * Wait for wiring or unwiring of an entry to complete. + */ + if ((entry->eflags & MAP_ENTRY_IN_TRANSITION) != 0) { + unsigned int last_timestamp; + vm_offset_t saved_start; + vm_map_entry_t tmp_entry; + + saved_start = entry->start; + entry->eflags |= MAP_ENTRY_NEEDS_WAKEUP; + last_timestamp = map->timestamp; + (void) vm_map_unlock_and_wait(map, FALSE); + vm_map_lock(map); + if (last_timestamp + 1 != map->timestamp) { + /* + * Look again for the entry because the map was + * modified while it was unlocked. + * Specifically, the entry may have been + * clipped, merged, or deleted. + */ + if (!vm_map_lookup_entry(map, saved_start, + &tmp_entry)) + entry = tmp_entry->next; + else { + entry = tmp_entry; + vm_map_clip_start(map, entry, + saved_start); + } + } + continue; + } vm_map_clip_end(map, entry, end); s = entry->start; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200206121751.g5CHpmc82147>