You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
commit 10a04ff09bcc39e0044190ffe9f00f998f13647c upstream. Currently, tools have *ALIGN*() macros scattered across the unrelated headers, as there are only 3 of them and they were added separately each time on an as-needed basis. Anyway, let's make it more consistent with the kernel headers and allow using those macros outside of the mentioned headers. Create <linux/align.h> inside the tools/ folder and include it where needed. Signed-off-by: Yury Norov <yury.norov@gmail.com> Signed-off-by: Alexander Lobakin <aleksander.lobakin@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
43 lines
848 B
C
43 lines
848 B
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>
|
|
|
|
#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);
|
|
|
|
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
|