Message ID | f0a4566c185469fa9f5de41b5bbbc7234cfa9912.1707146506.git.oleksii.kurochko@gmail.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | Enable build of full Xen for RISC-V | expand |
On 05.02.2024 16:32, Oleksii Kurochko wrote: > Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com> > Acked-by: Jan Beulich <jbeulich@suse.com> Nevertheless ... > --- /dev/null > +++ b/xen/arch/riscv/include/asm/time.h > @@ -0,0 +1,29 @@ > +/* SPDX-License-Identifier: GPL-2.0-only */ > +#ifndef __ASM_RISCV_TIME_H__ > +#define __ASM_RISCV_TIME_H__ > + > +#include <xen/bug.h> > +#include <asm/csr.h> > + > +struct vcpu; > + > +/* TODO: implement */ > +static inline void force_update_vcpu_system_time(struct vcpu *v) { BUG_ON("unimplemented"); } ... nit: Too long line. The comment also doesn't look to serve any purpose anymore, with the BUG_ON() now taking uniform shape. Jan
On Mon, 2024-02-12 at 16:18 +0100, Jan Beulich wrote: > On 05.02.2024 16:32, Oleksii Kurochko wrote: > > Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com> > > Acked-by: Jan Beulich <jbeulich@suse.com> > > Nevertheless ... > > > --- /dev/null > > +++ b/xen/arch/riscv/include/asm/time.h > > @@ -0,0 +1,29 @@ > > +/* SPDX-License-Identifier: GPL-2.0-only */ > > +#ifndef __ASM_RISCV_TIME_H__ > > +#define __ASM_RISCV_TIME_H__ > > + > > +#include <xen/bug.h> > > +#include <asm/csr.h> > > + > > +struct vcpu; > > + > > +/* TODO: implement */ > > +static inline void force_update_vcpu_system_time(struct vcpu *v) { > > BUG_ON("unimplemented"); } > > ... nit: Too long line. The comment also doesn't look to serve any > purpose > anymore, with the BUG_ON() now taking uniform shape. I'll drop the comment and move "BUG_ON(...)" to new line. ~ Oleksii
diff --git a/xen/arch/riscv/include/asm/time.h b/xen/arch/riscv/include/asm/time.h new file mode 100644 index 0000000000..2e359fa046 --- /dev/null +++ b/xen/arch/riscv/include/asm/time.h @@ -0,0 +1,29 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_RISCV_TIME_H__ +#define __ASM_RISCV_TIME_H__ + +#include <xen/bug.h> +#include <asm/csr.h> + +struct vcpu; + +/* TODO: implement */ +static inline void force_update_vcpu_system_time(struct vcpu *v) { BUG_ON("unimplemented"); } + +typedef unsigned long cycles_t; + +static inline cycles_t get_cycles(void) +{ + return csr_read(CSR_TIME); +} + +#endif /* __ASM_RISCV_TIME_H__ */ + +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */