Source-Changes-HG archive

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

[src/netbsd-1-5]: src/sys/kern Pullup 1.114 by patcxh [matt]:



details:   https://anonhg.NetBSD.org/src/rev/cb02deec93ec
branches:  netbsd-1-5
changeset: 490122:cb02deec93ec
user:      tv <tv%NetBSD.org@localhost>
date:      Fri Nov 03 19:59:41 2000 +0000

description:
Pullup 1.114 by patcxh [matt]:
Extend the vmcmd stuff a bit.  Add a flags field and define
VMCMD_BASE & VMCMD_RELATIVE.  This allows one to add vmcmds
which are relative to previous entries.  This is needed for
loading the VAX ld.elf_so
[releng: fixes problems with new i386 ld.elf_so too]

diffstat:

 sys/kern/kern_exec.c |  24 +++++++++++++++++++++++-
 1 files changed, 23 insertions(+), 1 deletions(-)

diffs (46 lines):

diff -r 4057094785ee -r cb02deec93ec sys/kern/kern_exec.c
--- a/sys/kern/kern_exec.c      Fri Nov 03 19:24:08 2000 +0000
+++ b/sys/kern/kern_exec.c      Fri Nov 03 19:59:41 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_exec.c,v 1.110.4.3 2000/10/18 16:23:59 tv Exp $   */
+/*     $NetBSD: kern_exec.c,v 1.110.4.4 2000/11/03 19:59:41 tv Exp $   */
 
 /*-
  * Copyright (C) 1993, 1994, 1996 Christopher G. Demetriou
@@ -229,6 +229,7 @@
        struct vmspace *vm;
        char **tmpfap;
        int szsigcode;
+       struct exec_vmcmd *base_vcp = NULL;
        extern struct emul emul_netbsd;
 
        /*
@@ -390,7 +391,28 @@
                struct exec_vmcmd *vcp;
 
                vcp = &pack.ep_vmcmds.evs_cmds[i];
+               if (vcp->ev_flags & VMCMD_RELATIVE) {
+#ifdef DIAGNOSTIC
+                       if (base_vcp == NULL)
+                               panic("execve: relative vmcmd with no base");
+                       if (vcp->ev_flags & VMCMD_BASE)
+                               panic("execve: illegal base & relative vmcmd");
+#endif
+                       vcp->ev_addr += base_vcp->ev_addr;
+               }
                error = (*vcp->ev_proc)(p, vcp);
+#ifdef DEBUG
+               if (error) {
+                       if (i > 0)
+                               printf("vmcmd[%d] = %#lx/%#lx @ %#lx\n", i-1,
+                                      vcp[-1].ev_addr, vcp[-1].ev_len,
+                                      vcp[-1].ev_offset);
+                       printf("vmcmd[%d] = %#lx/%#lx @ %#lx\n", i,
+                              vcp->ev_addr, vcp->ev_len, vcp->ev_offset);
+               }
+#endif
+               if (vcp->ev_flags & VMCMD_BASE)
+                       base_vcp = vcp;
        }
 
        /* free the vmspace-creation commands, and release their references */



Home | Main Index | Thread Index | Old Index