m1n1/src/exception.h
Hector Martin 4d64c33ca6 hv: Implement basic exception handling
Allows Python to handle hypervisor exceptions, and implements exception
info display and basic debug commands.

Signed-off-by: Hector Martin <marcan@marcan.st>
2021-05-04 19:36:23 +09:00

30 lines
618 B
C

/* SPDX-License-Identifier: MIT */
#ifndef __EXCEPTION_H__
#define __EXCEPTION_H__
#include <stdint.h>
#include "types.h"
enum exc_guard_t {
GUARD_OFF = 0,
GUARD_SKIP,
GUARD_MARK,
GUARD_RETURN,
GUARD_TYPE_MASK = 0xff,
GUARD_SILENT = 0x100,
};
extern volatile enum exc_guard_t exc_guard;
extern volatile int exc_count;
void exception_initialize(void);
void exception_shutdown(void);
void print_regs(u64 *regs, int el12);
uint64_t el0_call(void *func, uint64_t a, uint64_t b, uint64_t c, uint64_t d);
uint64_t el1_call(void *func, uint64_t a, uint64_t b, uint64_t c, uint64_t d);
#endif