From: Alan Cox Date: Sat, 24 Jan 2015 21:22:19 +0000 (+0000) Subject: exec: introduce MAPBASE as distinguished from PROGBASE X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=a7ccb63c1e17cb218428469449429ad1065666a4;p=FUZIX.git exec: introduce MAPBASE as distinguished from PROGBASE PROGBASE is where the code starts MAPBASE is where the memory mapping begins This is needed for systems with a low mapped common --- diff --git a/Kernel/include/kernel.h b/Kernel/include/kernel.h index 86c3b5f0..054cf7e3 100644 --- a/Kernel/include/kernel.h +++ b/Kernel/include/kernel.h @@ -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 diff --git a/Kernel/syscall_exec.c b/Kernel/syscall_exec.c index 79683866..3b325725 100644 --- a/Kernel/syscall_exec.c +++ b/Kernel/syscall_exec.c @@ -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 */