summaryrefslogtreecommitdiffstats
path: root/tools/include/linux/mm.h
blob: dc0fc7125bc31ab983f158cc956985aedab99356 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _TOOLS_LINUX_MM_H
#define _TOOLS_LINUX_MM_H

#include <linux/align.h>
#include <linux/mmzone.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 __va(x) ((void *)((unsigned long)(x)))
#define __pa(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);
}

void reserve_bootmem_region(phys_addr_t start, phys_addr_t end, int nid);

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