Core-mm requires few helpers to support unaccepted memory:...
- accept_memory() checks the range of addresses against the bitmap and
accept memory if needed;
- maybe_set_page_offline() checks the bitmap and marks a page with
PageOffline() if memory acceptance required on the first
allocation of the page.
- accept_and_clear_page_offline() accepts memory for the page and clears
PageOffline().
+void accept_memory(phys_addr_t start, phys_addr_t end)
+{
+ unsigned long flags;
+ if (!boot_params.unaccepted_memory)
+ return;
+
+ spin_lock_irqsave(&unaccepted_memory_lock, flags);
+ __accept_memory(start, end);
+ spin_unlock_irqrestore(&unaccepted_memory_lock, flags);
+}