Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-6]: src/sys/compat Pull up revision 1.10 (requested by junyoung...
details: https://anonhg.NetBSD.org/src/rev/f3002bb1ea98
branches: netbsd-1-6
changeset: 530776:f3002bb1ea98
user: tron <tron%NetBSD.org@localhost>
date: Thu Oct 02 09:52:04 2003 +0000
description:
Pull up revision 1.10 (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/compat/m68k4k/m68k4k_exec.c | 22 ++++++----------------
sys/compat/netbsd32/netbsd32_exec_aout.c | 22 ++++++----------------
2 files changed, 12 insertions(+), 32 deletions(-)
diffs (100 lines):
diff -r 222aca176623 -r f3002bb1ea98 sys/compat/m68k4k/m68k4k_exec.c
--- a/sys/compat/m68k4k/m68k4k_exec.c Thu Oct 02 09:51:56 2003 +0000
+++ b/sys/compat/m68k4k/m68k4k_exec.c Thu Oct 02 09:52:04 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: m68k4k_exec.c,v 1.8.10.1 2003/09/27 15:52:31 tron Exp $ */
+/* $NetBSD: m68k4k_exec.c,v 1.8.10.2 2003/10/02 09:52:04 tron Exp $ */
/*
* Copyright (c) 1993, 1994 Christopher G. Demetriou
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: m68k4k_exec.c,v 1.8.10.1 2003/09/27 15:52:31 tron Exp $");
+__KERNEL_RCSID(0, "$NetBSD: m68k4k_exec.c,v 1.8.10.2 2003/10/02 09:52:04 tron Exp $");
#if !defined(__m68k__)
#error YOU GOTTA BE KIDDING!
@@ -133,6 +133,7 @@
struct exec_package *epp;
{
struct exec *execp = epp->ep_hdr;
+ int error;
epp->ep_taddr = M68K4K_USRTEXT;
epp->ep_tsize = execp->a_text;
@@ -140,20 +141,9 @@
epp->ep_dsize = execp->a_data + execp->a_bss;
epp->ep_entry = execp->a_entry;
- /*
- * 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 ((execp->a_text != 0 || execp->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;
+ error = vn_marktext(epp->ep_vp);
+ if (error)
+ return (error);
/* set up command for text segment */
NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_pagedvn, execp->a_text,
diff -r 222aca176623 -r f3002bb1ea98 sys/compat/netbsd32/netbsd32_exec_aout.c
--- a/sys/compat/netbsd32/netbsd32_exec_aout.c Thu Oct 02 09:51:56 2003 +0000
+++ b/sys/compat/netbsd32/netbsd32_exec_aout.c Thu Oct 02 09:52:04 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_exec_aout.c,v 1.8.10.1 2003/09/27 15:52:31 tron Exp $ */
+/* $NetBSD: netbsd32_exec_aout.c,v 1.8.10.2 2003/10/02 09:52:04 tron Exp $ */
/* from: NetBSD: exec_aout.c,v 1.15 1996/09/26 23:34:46 cgd Exp */
/*
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_exec_aout.c,v 1.8.10.1 2003/09/27 15:52:31 tron Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_exec_aout.c,v 1.8.10.2 2003/10/02 09:52:04 tron Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -134,6 +134,7 @@
struct exec_package *epp;
{
struct netbsd32_exec *execp = epp->ep_hdr;
+ int error;
epp->ep_taddr = USRTEXT;
epp->ep_tsize = execp->a_text;
@@ -143,20 +144,9 @@
epp->ep_vm_minaddr = VM_MIN_ADDRESS;
epp->ep_vm_maxaddr = VM_MAXUSER_ADDRESS32;
- /*
- * 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 ((execp->a_text != 0 || execp->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;
+ error = vn_marktext(epp->ep_vp);
+ if (error)
+ return (error);
/* set up command for text segment */
NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_pagedvn, execp->a_text,
Home |
Main Index |
Thread Index |
Old Index