lkml.org 
[lkml]   [2005]   [Aug]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 5/6] i386 virtualization - Make generic set wrprotect a macro
On Mon, Aug 15, 2005 at 04:00:39PM -0700, zach@vmware.com wrote:

> Make the generic version of ptep_set_wrprotect a macro. This is good for
> code uniformity, and fixes the build for architectures which include pgtable.h
> through headers into assembly code, but do not define a ptep_set_wrprotect
> function.


This against the kernel coding style.
In fact, we are usually doing exactly the opposite.

What exactly is the technical problem this patch is trying to solve, IOW
which architectures are breaking for you?


> Signed-off-by: Zachary Amsden <zach@vmware.com>
> Index: linux-2.6.13/include/asm-generic/pgtable.h
> ===================================================================
> --- linux-2.6.13.orig/include/asm-generic/pgtable.h 2005-08-12 12:12:55.000000000 -0700
> +++ linux-2.6.13/include/asm-generic/pgtable.h 2005-08-15 13:54:42.000000000 -0700
> @@ -313,11 +313,12 @@
> #endif
>
> #ifndef __HAVE_ARCH_PTEP_SET_WRPROTECT
> -static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long address, pte_t *ptep)
> -{
> - pte_t old_pte = *ptep;
> - set_pte_at(mm, address, ptep, pte_wrprotect(old_pte));
> -}
> +#define ptep_set_wrprotect(__mm, __address, __ptep) \
> +({ \
> + pte_t __old_pte = *(__ptep); \
> + set_pte_at((__mm), (__address), (__ptep), \
> + pte_wrprotect(__old_pte)); \
> +})
> #endif
>
> #ifndef __HAVE_ARCH_PTE_SAME


cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-08-16 01:27    [W:0.038 / U:8.784 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site