1 // Copyright 2018 The Fuchsia Authors
2 //
3 // Use of this source code is governed by a MIT-style
4 // license that can be found in the LICENSE file or at
5 // https://opensource.org/licenses/MIT
6 
7 #pragma once
8 
9 // clang-format off
10 
11 #define ICH_LR_VIRTUAL_ID(id)   (id & UINT32_MAX)
12 #define ICH_LR_PHYSICAL_ID(id)  ((id & 0x3fful) << 32)
13 #define ICH_LR_PRIORITY(prio)   ((prio & 0xfful) << 48)
14 #define ICH_LR_GROUP1           (1ul << 60)
15 #define ICH_LR_HARDWARE         (1ul << 61)
16 #define ICH_LR_PENDING          (1ul << 62)
17 #define ICH_VMCR_VENG1          (1u << 1)
18 #define ICH_VMCR_VFIQEN         (1u << 3)
19 #define ICH_VMCR_VPMR           (0xffu << 24)
20 #define ICH_VTR_PRES(vtr)       (((vtr & (0x7u << 26)) >> 26) + 1)
21 #define ICH_VTR_LRS(vtr)        ((vtr & 0x1fu) + 1)
22 
23 // clang-format on
24 
25 void gicv3_hw_interface_register();
26