]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/um/os-Linux/skas/process.c
uml: remove user_util.h
[karo-tx-linux.git] / arch / um / os-Linux / skas / process.c
index cb9ab54146cc6126ac5a6344a520f4e0e8a8f25c..6554ff5301281c30876bb628172a9cce9041669f 100644 (file)
 #include <sys/mman.h>
 #include <sys/user.h>
 #include <sys/time.h>
-#include <asm/unistd.h>
+#include <sys/syscall.h>
 #include <asm/types.h>
 #include "user.h"
 #include "sysdep/ptrace.h"
-#include "user_util.h"
 #include "kern_util.h"
 #include "skas.h"
 #include "stub-data.h"
@@ -67,7 +66,7 @@ void wait_stub_done(int pid, int sig, char * fname)
 
        if((n < 0) || !WIFSTOPPED(status) ||
           (WSTOPSIG(status) != SIGUSR1 && WSTOPSIG(status) != SIGTRAP)){
-               unsigned long regs[HOST_FRAME_SIZE];
+               unsigned long regs[MAX_REG_NR];
 
                if(ptrace(PTRACE_GETREGS, pid, 0, regs) < 0)
                        printk("Failed to get registers from stub, "
@@ -76,7 +75,7 @@ void wait_stub_done(int pid, int sig, char * fname)
                        int i;
 
                        printk("Stub registers -\n");
-                       for(i = 0; i < HOST_FRAME_SIZE; i++)
+                       for(i = 0; i < ARRAY_SIZE(regs); i++)
                                printk("\t%d - %lx\n", i, regs[i]);
                }
                panic("%s : failed to wait for SIGUSR1/SIGTRAP, "
@@ -328,7 +327,7 @@ void userspace(union uml_pt_regs *regs)
 int copy_context_skas0(unsigned long new_stack, int pid)
 {
        int err;
-       unsigned long regs[HOST_FRAME_SIZE];
+       unsigned long regs[MAX_REG_NR];
        unsigned long fp_regs[HOST_FP_SIZE];
        unsigned long current_stack = current_stub_stack();
        struct stub_data *data = (struct stub_data *) current_stack;
@@ -419,9 +418,12 @@ void map_stub_pages(int fd, unsigned long code,
                                          .offset  = code_offset
        } } });
        n = os_write_file(fd, &mmop, sizeof(mmop));
-       if(n != sizeof(mmop))
+       if(n != sizeof(mmop)){
+               printk("mmap args - addr = 0x%lx, fd = %d, offset = %llx\n",
+                      code, code_fd, (unsigned long long) code_offset);
                panic("map_stub_pages : /proc/mm map for code failed, "
                      "err = %d\n", -n);
+       }
 
        if ( stack ) {
                __u64 map_offset;