[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2] syscalls: memory_info wird falsch aufgerufen



! Die Aufruf-Funktion des Syscalls "memory_info" erwartet, dass das
  Ergebnis ueber das EAX und EDX Register übergeben wird. Der Kernel
  erwartet aber zwei Referenzen als Parameter, in denen das Ergebnis
  geschrieben wird. Dieser Commit aendert die Aufruf-Funktion fuer den
  Syscall "memory_info" und behebt hierdurch das Problem.

Signed-off-by: Nico Mayer <mayerNico256@xxxxxxxxx>
---
 src/kernel/src/syscall.c               | 2 +-
 src/modules/lib/syscalls/memory_info.c | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/kernel/src/syscall.c b/src/kernel/src/syscall.c
index 21d1115b..d4812844 100644
--- a/src/kernel/src/syscall.c
+++ b/src/kernel/src/syscall.c
@@ -53,7 +53,7 @@ void syscall_init()
             &syscall_mem_allocate_physical, 3);
     syscall_register(SYSCALL_MEM_FREE, &syscall_mem_free, 2);
     syscall_register(SYSCALL_MEM_FREE_PHYSICAL, &syscall_mem_free_physical, 2);
-    syscall_register(SYSCALL_MEM_INFO, &syscall_mem_info, 0);
+    syscall_register(SYSCALL_MEM_INFO, &syscall_mem_info, 2);
 
     syscall_register(SYSCALL_PM_GET_PID, (void*) &syscall_pm_get_pid, 0);
     syscall_register(SYSCALL_PM_GET_PARENT_PID, (void*)
diff --git a/src/modules/lib/syscalls/memory_info.c b/src/modules/lib/syscalls/memory_info.c
index 107623bb..4ec5169f 100644
--- a/src/modules/lib/syscalls/memory_info.c
+++ b/src/modules/lib/syscalls/memory_info.c
@@ -32,8 +32,9 @@
 memory_info_t memory_info()
 {
     memory_info_t result;
+    int ret;
 
-    SYSCALL0_TWO_RESULTS(SYSCALL_MEM_INFO, result.total, result.free);
+    SYSCALL2(SYSCALL_MEM_INFO, &result.total, &result.free, ret);
 
     return result;
 }
-- 
2.29.2