204void arch_halt(
void) __attribute__((noreturn));
void arch_stack_trace(void)
Prints the stack trace of the running code, for a panic: the return address of each frame.
int arch_msi_alloc(irq_handler_t handler, void *arg, uint64_t *addr, uint32_t *data)
Gets an IRQ for a device's MSI, and installs its handler.
void arch_exec_start(struct thread *thread, uintptr_t entry, uintptr_t sp)
Sets up a thread to start a new program when it next returns to user mode: at its entry point,...
int arch_proc_fork(struct thread *thread, struct proc *fork)
Sets up the CPU state of a fork() child's thread: a copy of the parent's kernel stack,...
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,...
void arch_yield(void)
Puts the current thread at the end of the ready list, and runs the next ready thread.
void arch_idle(void)
Makes this CPU idle, on its idle stack, until an interrupt makes a thread ready.
void arch_sleep(void)
Puts the current thread to sleep.
void arch_cur_thread_kill(void)
Ends the current thread.
void arch_sched_init(void)
Starts the timer tick on every CPU, and the clock where it needs to be started.
void arch_sigreturn(void)
Returns from a signal handler, for sigreturn(): restores the registers, the signal mask and the FPU s...
int arch_sigcode_map(struct proc *proc)
Maps the page with the code that calls sigreturn() (the sigcode) into a process's new address space.
void arch_syscall_return(struct thread *thread, uintptr_t val)
Sets the result of a thread's system call, in the register that returns it to user mode.
int arch_thread_create(struct thread *thread, uintptr_t stack, uintptr_t entry, uintptr_t uentry, uintptr_t arg)
Sets up a new user thread's CPU state and kernel stack, for pthread_create().
void arch_kthread_create(struct thread *thread, uintptr_t entry)
Sets up a kernel thread's CPU state.
void arch_thread_switch(struct thread *thread)
Switches to a thread that has run before: its address space, its kernel stack, then where it stopped.
void arch_thread_kill(struct thread *thread)
Frees a thread's CPU state and kernel stack.
void arch_thread_spawn(struct thread *thread)
Runs a thread for the first time: switches to its address space and kernel stack, and starts it.
void(*) irq_handler_t(void *arg)
paddr_t arch_page_get_mapping(struct pmap *pmap, vaddr_t vaddr)
Finds the page mapped at a virtual address of an address space.
void * arch_phys_map(uintptr_t paddr, size_t size)
Returns a kernel address for a range of physical memory: its address in the direct map if it's there,...
void arch_mm_setup(void)
Finishes setting up memory at boot, once mm_setup() has set up the page structures and the buddy allo...
void * arch_mmio_map(uintptr_t paddr, size_t size)
Maps a device's registers into the kernel's address space, uncached (memory-mapped I/O).
void arch_reboot(void)
Restarts the machine.
void arch_halt(void)
Stops the CPU for good, with interrupts off.
void arch_poweroff(void)
Powers the machine off, or halts it if it can't be powered off.
int arch_time_get(struct timespec *ts)
Reads the date and time from the real time clock.
unsigned long long int uint64_t
An installed handler, on its interrupt's list.
An address space's page tables, on x86.
uint64_t arch_rtime_ns(void)
Reads the monotonic clock, which starts at boot.
uint64_t arch_rtime_us(void)
Reads the monotonic clock, in microseconds.
uint64_t arch_rtime_ms(void)
Reads the monotonic clock, in milliseconds.
uint64_t arch_cycles(void)
Reads a counter that changes as fast as the CPU runs, which the kernel uses as a source of randomness...