mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-05-09 21:42:09 +02:00
0510bdab53
free_reserved_area() is related to memblock as it frees reserved memory back to the buddy allocator, similar to what memblock_free_late() does. Move free_reserved_area() to mm/memblock.c to prepare for further consolidation of the functions that free reserved memory. No functional changes. Link: https://patch.msgid.link/20260323074836.3653702-5-rppt@kernel.org Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org> Acked-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
50 lines
1.0 KiB
C
50 lines
1.0 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _TOOLS_LINUX_MM_H
|
|
#define _TOOLS_LINUX_MM_H
|
|
|
|
#include <linux/align.h>
|
|
#include <linux/mmzone.h>
|
|
#include <linux/sizes.h>
|
|
|
|
#define PAGE_SHIFT 12
|
|
#define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT)
|
|
#define PAGE_MASK (~(PAGE_SIZE - 1))
|
|
|
|
#define PHYS_ADDR_MAX (~(phys_addr_t)0)
|
|
|
|
#define PAGE_ALIGN(addr) ALIGN(addr, PAGE_SIZE)
|
|
#define PAGE_ALIGN_DOWN(addr) ALIGN_DOWN(addr, PAGE_SIZE)
|
|
|
|
#define __va(x) ((void *)((unsigned long)(x)))
|
|
#define __pa(x) ((unsigned long)(x))
|
|
#define __pa_symbol(x) ((unsigned long)(x))
|
|
|
|
#define pfn_to_page(pfn) ((void *)((pfn) * PAGE_SIZE))
|
|
|
|
#define phys_to_virt phys_to_virt
|
|
static inline void *phys_to_virt(unsigned long address)
|
|
{
|
|
return __va(address);
|
|
}
|
|
|
|
#define virt_to_phys virt_to_phys
|
|
static inline phys_addr_t virt_to_phys(volatile void *address)
|
|
{
|
|
return (phys_addr_t)address;
|
|
}
|
|
|
|
static inline void totalram_pages_inc(void)
|
|
{
|
|
}
|
|
|
|
static inline void totalram_pages_add(long count)
|
|
{
|
|
}
|
|
|
|
static inline int early_pfn_to_nid(unsigned long pfn)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
#endif
|