31#ifndef HOME_CORE_ARCH_H
32#define HOME_CORE_ARCH_H
34#if defined(__cplusplus)
265#if defined(__cplusplus)
void arch_yield(void)
Set PendSV pending to request rescheduling.
void * arch_stack_init(void *stack_mem, size_t stack_size, arch_thread_entry_t entry, void *arg, arch_thread_exit_t exit)
Build the initial stack frame for a new thread.
uintptr_t arch_irq_key_t
Saved interrupt mask state returned by arch_irq_lock().
Definition arch.h:99
arch_irq_key_t arch_irq_lock(void)
Mask all configurable-priority interrupts.
void arch_init(void)
Point the vector table at the linked image and set core exception priorities.
void arch_irq_set_priority(int irq, int priority)
Set the priority of an interrupt or core exception.
void arch_cpu_idle(void)
Wait for an interrupt.
void arch_irq_set_pending(int irq)
Set a peripheral interrupt pending.
void arch_context_switch_to(void *new_sp)
Start the first thread through a supervisor call.
void(* arch_thread_exit_t)(void)
Function the thread runs if its entry point returns.
Definition arch.h:218
void arch_irq_entry(void)
Common entry for every peripheral interrupt.
void arch_context_switch(void **old_sp, void *new_sp)
Request a switch from the current thread to another one.
bool arch_irq_is_locked(void)
Report whether interrupts are masked.
int arch_cpu_timer_init(uint32_t cpu_hz, uint32_t tick_hz)
Start the periodic system timer.
void arch_cpu_timer_stop(void)
Stop the system timer and its interrupt.
void arch_irq_clear_pending(int irq)
Clear a pending peripheral interrupt.
void arch_cpu_halt(void)
Mask interrupts and stop permanently.
void arch_irq_disable(int irq)
Disable a peripheral interrupt in the interrupt controller.
void arch_cpu_reset(void)
Request a system reset.
void arch_irq_enable(int irq)
Enable a peripheral interrupt in the interrupt controller.
void arch_panic(void)
Halt permanently after a fatal error, without reporting a message.
void arch_irq_unlock(arch_irq_key_t key)
Restore the interrupt mask saved by arch_irq_lock().
void(* arch_thread_entry_t)(void *arg)
Thread entry point.
Definition arch.h:215