iPXE
arch-ppc.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3  * Copyright (C) IBM Corp. 2005, 2006
4  * Copyright (C) Raptor Engineering, LLC 2023
5  *
6  * Authors: Hollis Blanchard <hollisb@us.ibm.com>
7  * Timothy Pearson <tpearson@raptorengineering.com>
8  * Shawn Anastasio <sanastasio@raptorengineering.com>
9  */
10 
11 #ifndef __XEN_PUBLIC_ARCH_PPC_H__
12 #define __XEN_PUBLIC_ARCH_PPC_H__
13 
14 FILE_LICENCE ( MIT );
15 FILE_SECBOOT ( PERMITTED );
16 
17 #if defined(__XEN__) || defined(__XEN_TOOLS__)
18 #define int64_aligned_t int64_t __attribute__((__aligned__(8)))
19 #define uint64_aligned_t uint64_t __attribute__((__aligned__(8)))
20 #endif
21 
22 #ifndef __ASSEMBLY__
23 #define ___DEFINE_XEN_GUEST_HANDLE(name, type) \
24  typedef union { type *p; unsigned long q; } \
25  __guest_handle_ ## name; \
26  typedef union { type *p; uint64_aligned_t q; } \
27  __guest_handle_64_ ## name
28 
29 #define __DEFINE_XEN_GUEST_HANDLE(name, type) \
30  ___DEFINE_XEN_GUEST_HANDLE(name, type); \
31  ___DEFINE_XEN_GUEST_HANDLE(const_##name, const type)
32 #define DEFINE_XEN_GUEST_HANDLE(name) __DEFINE_XEN_GUEST_HANDLE(name, name)
33 #define __XEN_GUEST_HANDLE(name) __guest_handle_64_ ## name
34 #define XEN_GUEST_HANDLE(name) __XEN_GUEST_HANDLE(name)
35 #define XEN_GUEST_HANDLE_PARAM(name) __guest_handle_ ## name
36 #define set_xen_guest_handle_raw(hnd, val) \
37  do { \
38  __typeof__(&(hnd)) sxghr_tmp_ = &(hnd); \
39  sxghr_tmp_->q = 0; \
40  sxghr_tmp_->p = (val); \
41  } while ( 0 )
42 #define set_xen_guest_handle(hnd, val) set_xen_guest_handle_raw(hnd, val)
43 
44 #ifdef __XEN_TOOLS__
45 #define get_xen_guest_handle(val, hnd) do { val = (hnd).p; } while (0)
46 #endif
47 
49 #define PRI_xen_pfn PRIx64
50 #define PRIu_xen_pfn PRIu64
51 
52 /*
53  * Maximum number of virtual CPUs in legacy multi-processor guests.
54  * Only one. All other VCPUS must use VCPUOP_register_vcpu_info.
55  */
56 #define XEN_LEGACY_MAX_VCPUS 1
57 
59 #define PRI_xen_ulong PRIx64
60 
61 /*
62  * User-accessible registers: most of these need to be saved/restored
63  * for every nested Xen invocation.
64  */
66 {
74  uint64_t fpscr; /* XXX Is this necessary */
76  uint64_t hid4; /* debug only */
77  uint64_t dar; /* debug only */
78  uint32_t dsisr; /* debug only */
80  uint32_t __pad; /* good spot for another 32bit reg */
82 };
84 
85 typedef uint64_t tsc_timestamp_t; /* RDTSC timestamp */ /* XXX timebase */
86 
87 /* ONLY used to communicate with dom0! See also struct exec_domain. */
89  vcpu_guest_core_regs_t user_regs; /* User-level CPU registers */
90  uint64_t sdr1; /* Pagetable base */
91  /* XXX etc */
92 };
95 
96 struct arch_shared_info {
98 };
99 
100 struct arch_vcpu_info {
101 };
102 
104 };
105 
106 typedef struct xen_pmu_arch { uint8_t dummy; } xen_pmu_arch_t;
107 
108 #endif /* !__ASSEMBLY__ */
109 
110 #endif /* __XEN_PUBLIC_ARCH_PPC_H__ */
#define DEFINE_XEN_GUEST_HANDLE(name)
Definition: arch-ppc.h:32
unsigned long long uint64_t
Definition: stdint.h:13
uint64_t gprs[32]
Definition: arch-ppc.h:67
uint64_t xen_ulong_t
Definition: arch-ppc.h:58
struct xen_pmu_arch xen_pmu_arch_t
vcpu_guest_core_regs_t user_regs
Definition: arch-ppc.h:89
uint8_t dummy
Definition: arch-arm.h:550
uint64_t xen_pfn_t
Definition: arch-ppc.h:48
unsigned char uint8_t
Definition: stdint.h:10
unsigned int uint32_t
Definition: stdint.h:12
uint64_t boot_timebase
Definition: arch-ppc.h:97
uint32_t entry_vector
Definition: arch-ppc.h:81
uint64_t tsc_timestamp_t
Definition: arch-ppc.h:85
uint64_t sdr1
Definition: arch-ppc.h:90
FILE_SECBOOT(PERMITTED)
FILE_LICENCE(MIT)