Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/compat/ibcs2 If we loaded an nmagic on a subpage boundar...



details:   https://anonhg.NetBSD.org/src/rev/58fceb18b3ba
branches:  trunk
changeset: 493962:58fceb18b3ba
user:      matt <matt%NetBSD.org@localhost>
date:      Wed Jun 28 00:14:44 2000 +0000

description:
If we loaded an nmagic on a subpage boundary, adjust epp->ep_d{addr,size} so
that they start on a page boundary.  This is needed so that obreak(2) works
properly.

diffstat:

 sys/compat/ibcs2/ibcs2_exec.c |  10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diffs (24 lines):

diff -r 57a43fe03952 -r 58fceb18b3ba sys/compat/ibcs2/ibcs2_exec.c
--- a/sys/compat/ibcs2/ibcs2_exec.c     Tue Jun 27 23:51:51 2000 +0000
+++ b/sys/compat/ibcs2/ibcs2_exec.c     Wed Jun 28 00:14:44 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ibcs2_exec.c,v 1.32 2000/06/26 14:38:55 mrg Exp $      */
+/*     $NetBSD: ibcs2_exec.c,v 1.33 2000/06/28 00:14:44 matt Exp $     */
 
 /*
  * Copyright (c) 1994, 1995, 1998 Scott Bartram
@@ -498,6 +498,14 @@
                epp->ep_dsize += ap->a_bsize;
        }
        DPRINTF(("\n"));
+       /* The following is to make obreak(2) happy.  It expects daddr
+        * to on a page boundary and will round up dsize to a page
+        * address.
+        */
+       if (trunc_page(epp->ep_daddr) != epp->ep_daddr) {
+               epp->ep_dsize += epp->ep_daddr - trunc_page(epp->ep_daddr);
+               epp->ep_daddr = trunc_page(epp->ep_daddr);
+       }
 
        return exec_ibcs2_coff_setup_stack(p, epp);
 }



Home | Main Index | Thread Index | Old Index