1/**
2 * \file
3 * \brief kernel execution and miscellany
4 */
5
6/*
7 * Copyright (c) 2007, 2008, 2010 ETH Zurich.
8 * All rights reserved.
9 *
10 * This file is distributed under the terms in the attached LICENSE file.
11 * If you do not find this file, copies can be found by writing to:
12 * ETH Zurich D-INFK, Universitaetstrasse 6, CH-8092 Zurich. Attn: Systems Group.
13 */
14
15#ifndef KERNEL_EXEC_H
16#define KERNEL_EXEC_H
17
18void reboot(void) __attribute__ ((noreturn));
19void halt(void) __attribute__ ((noreturn));
20/**
21 * \brief Go to user-space at entry point 'entry'.
22 *
23 * This function goes to user-space and starts executing the program at
24 * its entry point at virtual address 'entry'.
25 *
26 * \param entry Entry point address of program to execute.
27 */
28void __attribute__ ((noreturn)) execute(lvaddr_t entry);
29
30/**
31 * \brief Resume the given user-space snapshot.
32 *
33 * This function resumes user-space execution by restoring the CPU
34 * registers with the ones given in the array, pointed to by 'regs'.
35 */
36void __attribute__ ((noreturn)) resume(arch_registers_state_t *state);
37
38/**
39 * \brief Halt processor until an interrupt arrives.
40 *
41 * For use in the idle loop when nothing is runnable. This function
42 * puts the processor into system mode and enable interrupts on entry
43 * and makes no use of the stack.
44 */
45void __attribute__ ((noreturn)) wait_for_interrupt(void);
46extern bool waiting_for_interrupt;
47
48#endif // KERNEL_EXEC_H
49