]> git.corax.cc Git - corax/commitdiff
Add dummy process_suspend() function
authorMatthias Kruk <m@m10k.eu>
Wed, 6 Nov 2019 06:38:47 +0000 (15:38 +0900)
committerMatthias Kruk <m@m10k.eu>
Wed, 6 Nov 2019 06:38:47 +0000 (15:38 +0900)
kernel/core/process.c
kernel/include/process.h

index 4e7f8c99091a1d01c409b3690a0593b785a08b3d..58890c35f3ead935874d7e68f0c10202bc00faeb 100644 (file)
@@ -653,7 +653,12 @@ int process_detach(process_t *proc)
 
 int process_kill(process_t pid, int signal)
 {
+       int ret_val;
+
+       /* FIXME: Implement sending of signals to processes */
+       ret_val = -ENOSYS;
 
+       return(ret_val);
 }
 
 int process_signal_deliver(process_t *proc, int signal)
@@ -669,6 +674,7 @@ int process_signal_deliver(process_t *proc, int signal)
                task_t *task;
 
                /* FIXME: Need to suspend the process in order to deliver the signal safely */
+               process_suspend(proc);
 
                /*
                 * Elect a task to handle the signal - right now, this is simple since the
@@ -698,6 +704,15 @@ int process_signal_deliver(process_t *proc, int signal)
                         * pesp3, pesp3 - 1, and pesp3 - 2 may not be on the same page, which would
                         * be an atrociously hard-to-find bug.
                         */
+
+                       /*
+                        * TODO: Take mixed page sizes into account
+                        *
+                        * It's no harm to do the lookup, but it might be more efficient if we
+                        * take into account that page sizes might be larger than PAGE_SIZE. For
+                        * example, the kernel is almost certainly using 4M pages, so this will
+                        * result in more expensive lookups than is necessary.
+                        */
 #define PAGE_BASE(__addr) ((u32_t)__addr & ~(PAGE_SIZE - 1))
 #define SAME_PAGE(__x,__y) (PAGE_BASE(__x) == PAGE_BASE(__y))
 
@@ -808,3 +823,14 @@ static void _sig_cont(int sig)
         */
        return;
 }
+
+int process_suspend(process_t *proc)
+{
+       int ret_val;
+
+       ret_val = -ENOSYS;
+
+       /* FIXME: Send IPIs to all processors executing tasks from proc */
+
+       return(ret_val);
+}
index 4ac66d2a2579d1bddbb7486bd33ac233bc615354..03067e142e6cebb8e556fbaec3b5f937627bf19d 100644 (file)
@@ -52,5 +52,6 @@ pid_t         process_get_id(process_t*);
 int           process_exit(process_t*, int);
 int           process_fork(int);
 int           process_detach(process_t*);
+int           process_suspend(process_t*);
 
 #endif /* __PROCESS_H */