diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2022-11-09 16:27:23 +0200 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2022-11-09 17:27:11 +0200 |
| commit | a3e45d5dcaf1bf3a9e684b5fcc301413ec994a9b (patch) | |
| tree | ae319c8f389e7ca39bbdd4b114655f8604563305 /include/arch | |
| parent | 2b5533aefef026fe7bada314ebdb2651b809979a (diff) | |
| download | kmi-a3e45d5dcaf1bf3a9e684b5fcc301413ec994a9b.tar.gz kmi-a3e45d5dcaf1bf3a9e684b5fcc301413ec994a9b.zip | |
add basic IPI structure
Diffstat (limited to 'include/arch')
| -rw-r--r-- | include/arch/cpu.h | 7 | ||||
| -rw-r--r-- | include/arch/proc.h | 21 |
2 files changed, 28 insertions, 0 deletions
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 @@ -49,6 +49,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. * * @param t Thread that \c init is attached to. |
