|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v4 15/18] xen/riscv: implement put_page()
On 17.09.2025 23:55, Oleksii Kurochko wrote:
> Implement put_page(), as it will be used by p2m_put_*-related code.
>
> Although CONFIG_STATIC_MEMORY has not yet been introduced for RISC-V,
> a stub for PGC_static is added to avoid cluttering the code of
> put_page() with #ifdefs.
>
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
with ...
> @@ -627,3 +622,23 @@ void flush_page_to_ram(unsigned long mfn, bool
> sync_icache)
> if ( sync_icache )
> invalidate_icache();
> }
> +
> +void put_page(struct page_info *page)
> +{
> + unsigned long nx, x, y = page->count_info;
> +
> + do {
> + ASSERT((y & PGC_count_mask) >= 1);
> + x = y;
> + nx = x - 1;
> + }
> + while ( unlikely((y = cmpxchg(&page->count_info, x, nx)) != x) );
... style corrected here (just like for "do" the figure brace here also doesn't
want to go onto its own line).
Jan
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |