/* Copyright 2019, Adrien Destugues, pulkomandy@pulkomandy.tk * Distributed under the terms of the MIT License. */ #include #include #include #include #include #include #include status_t arch_thread_init(struct kernel_args *args) { // Initialize the static initial arch_thread state (sInitialState). // Currently nothing to do, i.e. zero initialized is just fine. return B_OK; } status_t arch_team_init_team_struct(Team *team, bool kernel) { // Nothing to do. The structure is empty. return B_OK; } status_t arch_thread_init_thread_struct(Thread *thread) { // set up an initial state (stack & fpu) //memcpy(&thread->arch_info, &sInitialState, sizeof(struct arch_thread)); return B_OK; } void arch_thread_init_kthread_stack(Thread* thread, void* _stack, void* _stackTop, void (*function)(void*), const void* data) { #warning RISCV64: Implement thread init kthread panic("arch_thread_init_kthread_stack(): Implement me!"); } status_t arch_thread_init_tls(Thread *thread) { // TODO: Implement! return B_OK; } void arch_thread_context_switch(Thread *from, Thread *to) { } void arch_thread_dump_info(void *info) { } status_t arch_thread_enter_userspace(Thread *thread, addr_t entry, void *arg1, void *arg2) { panic("arch_thread_enter_uspace(): not yet implemented\n"); return B_ERROR; } bool arch_on_signal_stack(Thread *thread) { return false; } status_t arch_setup_signal_frame(Thread *thread, struct sigaction *sa, struct signal_frame_data *signalFrameData) { return B_ERROR; } int64 arch_restore_signal_frame(struct signal_frame_data* signalFrameData) { return 0; } void arch_check_syscall_restart(Thread *thread) { } /** Saves everything needed to restore the frame in the child fork in the * arch_fork_arg structure to be passed to arch_restore_fork_frame(). * Also makes sure to return the right value. */ void arch_store_fork_frame(struct arch_fork_arg *arg) { } /** Restores the frame from a forked team as specified by the provided * arch_fork_arg structure. * Needs to be called from within the child team, ie. instead of * arch_thread_enter_uspace() as thread "starter". * This function does not return to the caller, but will enter userland * in the child team at the same position where the parent team left of. */ void arch_restore_fork_frame(struct arch_fork_arg *arg) { }