kernel/x86_64: setup a new team in compatibility mode.

* in load_image_internal(), elf32_load_user_image checks whether the binary
format requires the compatibility mode.
* we then set up the flag THREAD_FLAGS_COMPAT_MODE and the address space size.
* the compatibility mode runtime_loader is hardcoded with x86/runtime_loader.
* if needed, the 64-bit flat_args structure is converted in-place to its 32-bit
layout.
* a 32-bit flat_args isn't handled yet (a 32-bit team execs a 64-bit binary).

Change-Id: Ia6a066bde8d1774d85de29b48dc500e27ae9668f
This commit is contained in:
Jérôme Duval
2018-06-12 17:56:55 +02:00
parent 458e758f37
commit 951182620e
3 changed files with 207 additions and 28 deletions
@@ -35,6 +35,10 @@ public:
addr_t Base() const { return fBase; }
addr_t EndAddress() const { return fEndAddress; }
size_t Size() const { return fEndAddress - fBase + 1; }
void SetSize(size_t size) {
fEndAddress = fBase + (size - 1);
fFreeSpace = size; }
size_t FreeSpace() const { return fFreeSpace; }
bool IsBeingDeleted() const { return fDeleting; }
+4
View File
@@ -37,6 +37,10 @@ enum {
#define THREAD_CREATION_FLAG_DEFER_SIGNALS 0x01
// create the thread with signals deferred, i.e. with
// user_thread::defer_signals set to 1
#ifdef _COMPAT_MODE
# define THREAD_CREATION_FLAG_COMPAT_MODE 0x02
// create the thread with a compatibility mode
#endif
struct thread_creation_attributes {