| 1 |
/* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 |
/* |
| 3 |
* Trap handler helpers. |
| 4 |
* |
| 5 |
* Copyright (C) 2020 - Google LLC |
| 6 |
* Author: Marc Zyngier <[email protected]> |
| 7 |
*/ |
| 8 |
|
| 9 |
#ifndef __ARM64_KVM_NVHE_TRAP_HANDLER_H__ |
| 10 |
#define __ARM64_KVM_NVHE_TRAP_HANDLER_H__ |
| 11 |
|
| 12 |
#include <asm/kvm_host.h> |
| 13 |
|
| 14 |
#define cpu_reg(ctxt, r) (ctxt)->regs.regs[r] |
| 15 |
#define DECLARE_REG(type, name, ctxt, reg) \ |
| 16 |
__always_unused int ___check_reg_ ## reg; \ |
| 17 |
type name = (type)cpu_reg(ctxt, (reg)) |
| 18 |
|
| 19 |
#endif /* __ARM64_KVM_NVHE_TRAP_HANDLER_H__ */ |