Message ID | 073c9a03abe429c1e45f6f66b648a25aff87e9f3.1700761381.git.oleksii.kurochko@gmail.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | Enable build of full Xen for RISC-V | expand |
On 24.11.2023 11:30, Oleksii Kurochko wrote: > --- /dev/null > +++ b/xen/arch/riscv/include/asm/regs.h > @@ -0,0 +1,26 @@ > +#ifndef __ARM_RISCV_REGS_H__ > +#define __ARM_RISCV_REGS_H__ > + > +#ifndef __ASSEMBLY__ > + > +#include <xen/bug.h> > +#include <asm/current.h> Does one of these bring in asm/processor.h, for ... > +#define hyp_mode(r) (0) > + > +static inline bool guest_mode(const struct cpu_user_regs *r) ... struct cpu_user_regs to be available? Else a forward declaration would be needed here. Acked-by: Jan Beulich <jbeulich@suse.com> Jan
On Thu, 2023-12-14 at 16:05 +0100, Jan Beulich wrote: > On 24.11.2023 11:30, Oleksii Kurochko wrote: > > --- /dev/null > > +++ b/xen/arch/riscv/include/asm/regs.h > > @@ -0,0 +1,26 @@ > > +#ifndef __ARM_RISCV_REGS_H__ > > +#define __ARM_RISCV_REGS_H__ > > + > > +#ifndef __ASSEMBLY__ > > + > > +#include <xen/bug.h> > > +#include <asm/current.h> > > Does one of these bring in asm/processor.h, for ... > > > +#define hyp_mode(r) (0) > > + > > +static inline bool guest_mode(const struct cpu_user_regs *r) > > ... struct cpu_user_regs to be available? Else a forward declaration > would be needed here. Agreed. It will be better to use a forward declaration. I'll change that in next patch series. > > Acked-by: Jan Beulich <jbeulich@suse.com> Thanks. ~ Oleksii
diff --git a/xen/arch/riscv/include/asm/regs.h b/xen/arch/riscv/include/asm/regs.h new file mode 100644 index 0000000000..8556837c65 --- /dev/null +++ b/xen/arch/riscv/include/asm/regs.h @@ -0,0 +1,26 @@ +#ifndef __ARM_RISCV_REGS_H__ +#define __ARM_RISCV_REGS_H__ + +#ifndef __ASSEMBLY__ + +#include <xen/bug.h> +#include <asm/current.h> + +#define hyp_mode(r) (0) + +static inline bool guest_mode(const struct cpu_user_regs *r) +{ + BUG(); +} + +#endif /* __ASSEMBLY__ */ + +#endif /* __ARM_RISCV_REGS_H__ */ +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com> --- Changes in V2: - change xen/lib.h to xen/bug.h - remove unnecessary empty line --- xen/arch/riscv/include/asm/regs.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 xen/arch/riscv/include/asm/regs.h