AquilaOS documentation
How it works, and its code
Toggle main menu visibility
Loading...
Searching...
No Matches
proc.c
Go to the documentation of this file.
1
5
6
#include <
core/system.h
>
7
#include <
core/arch.h
>
8
#include <
core/panic.h
>
9
#include <
mm/pmap.h
>
10
#include <
sys/proc.h
>
11
#include <
sys/sched.h
>
12
13
struct
aarch64_thread
*
aarch64_thread_new
(
void
);
14
15
/*
16
* Sets up the architecture's part of init's thread, to start at its
17
* program's entry point. Panics if there's no memory.
18
*/
19
void
arch_proc_init
(
struct
proc
*
proc
)
20
{
21
struct
aarch64_thread
*arch =
aarch64_thread_new
();
22
23
if
(!arch)
24
panic
(
"no memory for init's thread"
);
25
26
arch->
pc
=
proc
->
entry
;
27
arch->
sp
=
USER_STACK
;
28
29
struct
thread
*
thread
= (
struct
thread
*)
proc
->
threads
.
head
->
value
;
30
thread
->
arch
=
arch
;
31
}
USER_STACK
#define USER_STACK
Definition
arch.h:60
aarch64_thread_new
struct aarch64_thread * aarch64_thread_new(void)
Makes a thread's aarch64 state, with its kernel stack.
Definition
thread.c:30
arch_proc_init
void arch_proc_init(struct proc *proc)
Sets up the architecture's part of a new process's thread (init's, at boot): its kernel stack,...
Definition
proc.c:19
panic
#define panic(s)
Definition
panic.h:15
arch.h
panic.h
system.h
pmap.h
proc.h
sched.h
aarch64_thread
A thread's aarch64 state (thread->arch).
Definition
arch.h:25
aarch64_thread::sp
uint64_t sp
Definition
arch.h:37
aarch64_thread::pc
uint64_t pc
Definition
arch.h:37
proc
A process.
Definition
proc.h:75
proc::threads
struct queue threads
its threads
Definition
proc.h:136
proc::entry
uintptr_t entry
its program's entry point
Definition
proc.h:126
qnode::value
void * value
Definition
queue.h:20
queue::head
struct qnode * head
Definition
queue.h:31
thread
A thread.
Definition
thread.h:23
thread::arch
void * arch
the architecture's own data: its registers, its kernel stack
Definition
thread.h:84
kernel
arch
aarch64
sys
proc.c
Generated by
1.18.0