exec: introduce MAPBASE as distinguished from PROGBASE
authorAlan Cox <alan@linux.intel.com>
Sat, 24 Jan 2015 21:22:19 +0000 (21:22 +0000)
committerAlan Cox <alan@linux.intel.com>
Sat, 24 Jan 2015 21:22:19 +0000 (21:22 +0000)
PROGBASE is where the code starts
MAPBASE is where the memory mapping begins

This is needed for systems with a low mapped common

Kernel/include/kernel.h
Kernel/syscall_exec.c

index 86c3b5f..054cf7e 100644 (file)
@@ -39,6 +39,10 @@ From UZI by Doug Braun and UZI280 by Stefan Nitschke.
 #define PTABSIZE 15      /* Process table size. */
 #endif
 
+#ifndef MAPBASE                /* Usually the start of program and map match */
+#define MAPBASE PROGBASE
+#endif
+
 #define MAXTICKS     10   /* Max ticks before switching out (time slice)
                             default process time slice */
 // #define MAXBACK      3   /* Process time slice for tasks not connected
index 7968386..3b32572 100644 (file)
@@ -158,7 +158,7 @@ int16_t _execve(void)
                goto nogood3;   /* SN */
 
        /* This must be the last test as it makes changes if it works */
-       if (pagemap_realloc(top - PROGBASE))
+       if (pagemap_realloc(top - MAPBASE))
                goto nogood3;
 
        /* From this point on we are commmited to the exec() completing */