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 <[email protected]>
Acked-by: Jan Beulich <[email protected]> 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
