[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH XTF] Implement pv_read



On Mon, Jul 17, 2017 at 12:28:20PM +0200, Felix Schmoll wrote:
> Implement reading from PV console. Making use of polling.
> 
> Signed-off-by: Felix Schmoll <eggi.innovations@xxxxxxxxx>
> 
> ---
> This is based on the console-branch of andyhhp, so that one has to
> be merged before applying this patch.
> ---
>  common/console.c      | 27 ++++++++++++++++++++++-----
>  include/xtf/console.h |  2 ++
>  2 files changed, 24 insertions(+), 5 deletions(-)
> 
> diff --git a/common/console.c b/common/console.c
> index 5b4305e..66a5a06 100644
> --- a/common/console.c
> +++ b/common/console.c
> @@ -7,6 +7,8 @@
>  #include <xtf/libc.h>
>  #include <xtf/traps.h>
>  
> +#include <xen/sched.h>
> +
>  /*
>   * Output functions, registered if/when available.
>   * Possibilities:
> @@ -45,6 +47,24 @@ static size_t pv_console_write_some(const char *buf, 
> size_t len)
>      return s;
>  }
>  
> +extern shared_info_t shared_info;
> +size_t pv_console_read(char *buf, size_t len)
> +{
> +    while ( !test_and_clear_bit(pv_evtchn, shared_info.evtchn_pending) ||
> +            (pv_ring->in_cons == pv_ring->in_prod ) )

Extraneous space after in_prod.

> +        hypercall_poll(pv_evtchn);
> +
> +    size_t s = 0;
> +    uint32_t cons = pv_ring->in_cons, prod = LOAD_ACQUIRE(&pv_ring->in_prod);

Please move the declarations to the beginning of this function.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.