From a3e45d5dcaf1bf3a9e684b5fcc301413ec994a9b Mon Sep 17 00:00:00 2001 From: Kimplul Date: Wed, 9 Nov 2022 16:27:23 +0200 Subject: add basic IPI structure --- include/arch/cpu.h | 7 +++++++ include/arch/proc.h | 21 +++++++++++++++++++++ 2 files changed, 28 insertions(+) (limited to 'include/arch') diff --git a/include/arch/cpu.h b/include/arch/cpu.h index 66d5d45..c5a83d5 100644 --- a/include/arch/cpu.h +++ b/include/arch/cpu.h @@ -36,4 +36,11 @@ id_t cpu_id(); */ void cpu_assign(struct tcb *t); +/** + * Send inter-processor interrupt to cpu \p cpu_id. + * + * @param cpu_id CPU to send ipi to. + */ +void cpu_send_ipi(id_t cpu_id); + #endif /* APOS_CPU_H */ diff --git a/include/arch/proc.h b/include/arch/proc.h index 5047eab..d01674d 100644 --- a/include/arch/proc.h +++ b/include/arch/proc.h @@ -48,6 +48,27 @@ struct sys_ret get_args(struct tcb *t); */ void set_thread(struct tcb *t); +/** + * Copy registers from tcb save area to address \p p. + * Intended to be used for copying thread state to rpc stack. + * + * @param t Thread whose registers to save. + * @param p Address to save to. + */ +void save_regs(struct tcb *t, void *p); + +/** + * Copy registers from address \p p to tcb save registers. + * Intended to be used for copying thread state from rpc stack. + * + * @param p Address to load from. + * @param t Thread whose registers to load. + */ +void load_regs(void *p, struct tcb *t); + +void adjust_ipi(struct tcb *t); +void adjust_syscall(struct tcb *t); + /** * Run \c init program. * -- cgit v1.3