On Thu, Aug 23, 2012 at 07:17:40PM +0200, Gerald Schaefer wrote:
> +#define __HAVE_ARCH_PMDP_TEST_AND_CLEAR_YOUNG
> +static inline int pmdp_test_and_clear_young(struct vm_area_struct *vma,
> +                                         unsigned long address,
> +                                         pmd_t *pmdp)
> +{
> +     int rc = 0;
> +     int counter = PTRS_PER_PTE;
> +     unsigned long pmd_addr = pmd_val(*pmdp) & HPAGE_MASK;
> +
> +     asm volatile(
> +             "0:     rrbe    0,%2\n"
> +             "       la      %2,0(%3,%2)\n"
> +             "       brc     12,1f\n"
> +             "       lhi     %0,1\n"
> +             "1:     brct    %1,0b\n"
> +             : "+d" (rc), "+d" (counter), "+a" (pmd_addr)
> +             : "a" (4096UL): "cc" );
> +     return rc;
> +}

Just a small side note: given that rrbe is very expensive you probably
should extend this function so it makes use of the rrbm instruction
if available.

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

Reply via email to