-#include <sys/abi.h>
-#include <sys/mm/mempart.h>
+#include <asm/abi.h>
+#include <asm/mempart.h>
-#include <sys/cpu.h>
+#include <asm/cpu.h>
#include <lunaix/fs/taskfs.h>
#include <lunaix/mm/cake.h>
#include <lunaix/hart_state.h>
#include <lunaix/kpreempt.h>
-#include <lunaix/generic/isrm.h>
+#include <asm-generic/isrm.h>
#include <klibc/string.h>
clean-up on these thread, in the preemptible kernel thread.
*/
-void _preemptible
-cleanup_detached_threads() {
- ensure_preempt_caller();
-
+void
+cleanup_detached_threads()
+{
// XXX may be a lock on sched_context will ben the most appropriate?
cpu_disable_interrupt();
;
if (unlikely(i == MAX_PROCESS)) {
- panick("Panic in Ponyville shimmer!");
+ fail("Panic in Ponyville shimmer!");
}
return i;
pid_t
destroy_process(pid_t pid)
-{
+{
int index = pid;
if (index <= 0 || index > sched_ctx.ptable_len) {
syscall_result(EINVAL);
static void
terminate_proc_only(struct proc_info* proc, int exit_code) {
+ assert(proc->pid != 0);
+
proc->state = PS_TERMNAT;
proc->exit_code = exit_code;
assert(!kernel_process(proc));
if (proc->pid == 1) {
- panick("Attempt to kill init");
+ fail("Attempt to kill init");
}
terminate_proc_only(proc, exit_code);
struct thread *pos, *n;
- llist_for_each(pos, n, &__current->threads, proc_sibs) {
+ llist_for_each(pos, n, &proc->threads, proc_sibs) {
pos->state = PS_TERMNAT;
}
}