From 6828075a97200d3ec91f1eae893f774798834666 Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Sat, 17 Jan 2015 03:57:48 +0100 Subject: add patch series --- debian/patches/0001-XXX.patch | 101 ++++++++++++++++++++++++++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 102 insertions(+) create mode 100644 debian/patches/0001-XXX.patch diff --git a/debian/patches/0001-XXX.patch b/debian/patches/0001-XXX.patch new file mode 100644 index 0000000..bae7574 --- /dev/null +++ b/debian/patches/0001-XXX.patch @@ -0,0 +1,101 @@ +From 270c3cd23333668696da3e81c3f60ff5d4fc1ad8 Mon Sep 17 00:00:00 2001 +From: Justus Winter <4winter@informatik.uni-hamburg.de> +Date: Fri, 21 Nov 2014 00:23:39 +0100 +Subject: [PATCH gnumach] XXX + +--- + kern/bootstrap.c | 36 ++++++++++++++++++++++++++++++------ + 1 file changed, 30 insertions(+), 6 deletions(-) + +diff --git a/kern/bootstrap.c b/kern/bootstrap.c +index 4edae7b..9c2eb87 100644 +--- a/kern/bootstrap.c ++++ b/kern/bootstrap.c +@@ -35,6 +35,7 @@ + + #include + #include ++#include + #include + #include + #include +@@ -422,23 +423,19 @@ boot_read(void *handle, vm_offset_t file_ofs, void *buf, vm_size_t size, + } + + static int +-read_exec(void *handle, vm_offset_t file_ofs, vm_size_t file_size, ++read_in(void *handle, vm_offset_t file_ofs, vm_size_t file_size, + vm_offset_t mem_addr, vm_size_t mem_size, +- exec_sectype_t sec_type) ++ vm_prot_t mem_prot) + { + struct multiboot_module *mod = handle; + + vm_map_t user_map = current_task()->map; + vm_offset_t start_page, end_page; +- vm_prot_t mem_prot = sec_type & EXEC_SECTYPE_PROT_MASK; + int err; + + if (mod->mod_start + file_ofs + file_size > mod->mod_end) + return -1; + +- if (!(sec_type & EXEC_SECTYPE_ALLOC)) +- return 0; +- + assert(mem_size > 0); + assert(mem_size >= file_size); + +@@ -470,6 +467,19 @@ read_exec(void *handle, vm_offset_t file_ofs, vm_size_t file_size, + return 0; + } + ++static int ++read_exec(void *handle, vm_offset_t file_ofs, vm_size_t file_size, ++ vm_offset_t mem_addr, vm_size_t mem_size, ++ exec_sectype_t sec_type) ++{ ++ if (!(sec_type & EXEC_SECTYPE_ALLOC)) ++ return 0; ++ ++ return read_in (handle, file_ofs, file_size, ++ mem_addr, mem_size, ++ sec_type & EXEC_SECTYPE_PROT_MASK); ++} ++ + static void copy_bootstrap(void *e, exec_info_t *boot_exec_info) + { + //register vm_map_t user_map = current_task()->map; +@@ -746,9 +756,20 @@ static void user_bootstrap(void) + exec_info_t boot_exec_info; + int err; + char **av; ++ boolean_t executable = TRUE; + + /* Load this task up from the executable file in the module. */ + err = exec_load(boot_read, read_exec, info->mod, &boot_exec_info); ++ if (err == EX_NOT_EXECUTABLE) ++ { ++ struct multiboot_module *mod = info->mod; ++ printf("reading %d bytes into map %p\n", mod->mod_end - mod->mod_start, current_task()->map); ++ err = read_in (mod, ++ 0, mod->mod_end - mod->mod_start, ++ 0, mod->mod_end - mod->mod_start, ++ VM_PROT_READ); ++ executable = FALSE; ++ } + if (err) + panic ("Cannot load user executable module (error code %d): %s", + err, info->argv[0]); +@@ -770,6 +791,9 @@ static void user_bootstrap(void) + info->done = 1; + thread_wakeup ((event_t) info); + ++ if (! executable) ++ thread_terminate (current_thread ()); ++ + /* + * Exit to user thread. + */ +-- +2.1.4 + diff --git a/debian/patches/series b/debian/patches/series index 52021c2..bfc5f00 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -6,3 +6,4 @@ Add-some-padding-to-make-objects-fit-a-single-cache-.patch vm_cache_policy.patch +0001-XXX.patch -- cgit v1.2.3