blob: af12e0bdfd81dfb62cabdad55862850799d46f72 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
/* SPDX-License-Identifier: copyleft-next-0.3.1 */
/* Copyright 2021 - 2022, Kim Kuparinen < kimi.h.kuparinen@gmail.com > */
#ifndef KMI_ARCH_TCB_H
#define KMI_ARCH_TCB_H
/**
* @file lock.h
* Arch-specific tcb stuff.
*/
#if defined(riscv64)
#include "../../arch/riscv64/include/tcb.h"
#elif defined(riscv32)
#include "../../arch/riscv32/include/tcb.h"
#endif
/**
* Force store tcb \p t in arch-specific way.
* cpu_assign() is allowed to assume there's always a valid tcb
* set, so during init we have to force set a tcb before cpu_assign() can be
* used.
*
* @param t tcb to set.
*/
void tcb_assign(struct tcb *t);
void setup_rpc_stack(struct tcb *t);
size_t max_rpc_size();
vm_t rpc_position(struct tcb *t);
void mark_rpc_valid(struct tcb *t, vm_t top);
void mark_rpc_invalid(struct tcb *t, vm_t bottom);
#endif /* KMI_ARCH_TCB_H */
|