1 /*
2  * Copyright (C) 2016      Linaro Ltd.
3  *
4  * Author: Shannon Zhao <shannon.zhao@linaro.org>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License as published
8  * by the Free Software Foundation; version 2.1 only. with the special
9  * exception on linking described in file LICENSE.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU Lesser General Public License for more details.
15  */
16 
17 #include "libxl_internal.h"
18 #include "libxl_arch.h"
19 
20 #include <xc_dom.h>
21 
22 _hidden
23 int libxl__prepare_acpi(libxl__gc *gc, libxl_domain_build_info *info,
24                         struct xc_dom_image *dom);
25 
26 _hidden
27 int libxl__get_acpi_size(libxl__gc *gc,
28                          const libxl_domain_build_info *info,
29                          uint64_t *out);
30 
libxl__compute_mpdir(unsigned int cpuid)31 static inline uint64_t libxl__compute_mpdir(unsigned int cpuid)
32 {
33     /*
34      * According to ARM CPUs bindings, the reg field should match
35      * the MPIDR's affinity bits. We will use AFF0 and AFF1 when
36      * constructing the reg value of the guest at the moment, for it
37      * is enough for the current max vcpu number.
38      */
39     return (cpuid & 0x0f) | (((cpuid >> 4) & 0xff) << 8);
40 }
41 
42 /*
43  * Local variables:
44  * mode: C
45  * c-basic-offset: 4
46  * indent-tabs-mode: nil
47  * End:
48  */
49