Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-6]: src/sys/arch/mips/mips Pull up revision 1.34 (requested by ...
details: https://anonhg.NetBSD.org/src/rev/70a6e9f279b8
branches: netbsd-1-6
changeset: 530771:70a6e9f279b8
user: tron <tron%NetBSD.org@localhost>
date: Thu Oct 02 09:51:33 2003 +0000
description:
Pull up revision 1.34 (requested by junyoung in ticket #1488):
count executable image pages as executable for vm-usage purposes.
also, always do the VTEXT vs. v_writecount mutual exclusion
(which we previously skipped if the text or data segment was empty).
diffstat:
sys/arch/mips/mips/cpu_exec.c | 43 ++++++++++---------------------------------
1 files changed, 10 insertions(+), 33 deletions(-)
diffs (77 lines):
diff -r 5b5bd3921782 -r 70a6e9f279b8 sys/arch/mips/mips/cpu_exec.c
--- a/sys/arch/mips/mips/cpu_exec.c Thu Oct 02 09:51:28 2003 +0000
+++ b/sys/arch/mips/mips/cpu_exec.c Thu Oct 02 09:51:33 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu_exec.c,v 1.32.8.1 2003/09/27 15:53:26 tron Exp $ */
+/* $NetBSD: cpu_exec.c,v 1.32.8.2 2003/10/02 09:51:33 tron Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -94,30 +94,17 @@
return error;
}
-
+#ifdef COMPAT_09
+ error = vn_marktext(epp->ep_vp);
+ if (error)
+ return (error);
-#ifdef COMPAT_09
epp->ep_taddr = 0x1000;
epp->ep_entry = hdr->a_entry;
epp->ep_tsize = hdr->a_text;
epp->ep_daddr = epp->ep_taddr + hdr->a_text;
epp->ep_dsize = hdr->a_data + hdr->a_bss;
- /*
- * check if vnode is in open for writing, because we want to
- * demand-page out of it. if it is, don't do it, for various
- * reasons
- */
- if ((hdr->a_text != 0 || hdr->a_data != 0)
- && epp->ep_vp->v_writecount != 0) {
-#ifdef DIAGNOSTIC
- if (epp->ep_vp->v_flag & VTEXT)
- panic("exec: a VTEXT vnode has writecount != 0");
-#endif
- return ETXTBSY;
- }
- epp->ep_vp->v_flag |= VTEXT;
-
/* set up command for text segment */
NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_pagedvn, hdr->a_text,
epp->ep_taddr, epp->ep_vp, 0, VM_PROT_READ|VM_PROT_EXECUTE);
@@ -202,27 +189,17 @@
return ENOEXEC;
}
- /* See if we got any program header information... */
+ /* See if we got any program header information... */
if (!ex->e_phoff || !ex->e_phnum) {
return ENOEXEC;
}
+ error = vn_marktext(epp->ep_vp);
+ if (error)
+ return (error);
+
/* Set the entry point... */
epp->ep_entry = ex->e_entry;
-
- /*
- * Check if vnode is open for writing, because we want to
- * demand-page out of it. If it is, don't do it.
- */
- if (epp->ep_vp->v_writecount != 0) {
-#ifdef DIAGNOSTIC
- if (epp->ep_vp->v_flag & VTEXT)
- panic("exec: a VTEXT vnode has writecount != 0");
-#endif
- return ETXTBSY;
- }
- epp->ep_vp->v_flag |= VTEXT;
-
epp->ep_taddr = 0;
epp->ep_tsize = 0;
epp->ep_daddr = 0;
Home |
Main Index |
Thread Index |
Old Index