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

Re: [Xen-devel] [PATCH] x86/page: Implement {get, set}_pte_flags() as static inlines



>>> On 07.09.17 at 15:39, <andrew.cooper3@xxxxxxxxxx> wrote:
> --- a/xen/include/asm-x86/x86_64/page.h
> +++ b/xen/include/asm-x86/x86_64/page.h
> @@ -121,8 +121,16 @@ typedef l4_pgentry_t root_pgentry_t;
>   */
>  
>  /* Extract flags into 24-bit integer, or turn 24-bit flags into a pte mask. 
> */
> -#define get_pte_flags(x) (((int)((x) >> 40) & ~0xFFF) | ((int)(x) & 0xFFF))
> -#define put_pte_flags(x) (((intpte_t)((x) & ~0xFFF) << 40) | ((x) & 0xFFF))
> +#ifndef __ASSEMBLY__
> +static inline unsigned int get_pte_flags(intpte_t x)
> +{
> +    return ((x >> 40) & ~0xfff) | (x & 0xfff);
> +}
> +static inline intpte_t put_pte_flags(unsigned int x)
> +{
> +    return (((intpte_t)x & ~0xfff) << 40) | (x & 0xfff);
> +}
> +#endif

With ideally a blank line added between the two
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

Jan


_______________________________________________
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®.