Squashed backup commit (no shallow-clone history issues) of xiaomi-mt6833-dev/kernel_xiaomi_mt6833 (lineage-23.2 branch, upstream commit 9eece662e) plus all fixes applied to get everpal_defconfig building clean against a modern (GCC 15.2.0) toolchain -- see the previous commit message on the lineage-23.2 branch (also in this repo history is not available here since this is a squashed snapshot; full incremental history lives in the local DL380 checkout and the upstream GitHub remote). Upstream: https://github.com/xiaomi-mt6833-dev/kernel_xiaomi_mt6833 (lineage-23.2)
44 lines
989 B
C
44 lines
989 B
C
/*
|
|
* Copyright (C) 2016 Synopsys, Inc. (www.synopsys.com)
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
* published by the Free Software Foundation.
|
|
*/
|
|
|
|
#ifndef _ASM_ARC_MMZONE_H
|
|
#define _ASM_ARC_MMZONE_H
|
|
|
|
#ifdef CONFIG_DISCONTIGMEM
|
|
|
|
extern struct pglist_data node_data[];
|
|
#define NODE_DATA(nid) (&node_data[nid])
|
|
|
|
static inline int pfn_to_nid(unsigned long pfn)
|
|
{
|
|
int is_end_low = 1;
|
|
|
|
if (IS_ENABLED(CONFIG_ARC_HAS_PAE40))
|
|
is_end_low = pfn <= virt_to_pfn(0xFFFFFFFFUL);
|
|
|
|
/*
|
|
* node 0: lowmem: 0x8000_0000 to 0xFFFF_FFFF
|
|
* node 1: HIGHMEM w/o PAE40: 0x0 to 0x7FFF_FFFF
|
|
* HIGHMEM with PAE40: 0x1_0000_0000 to ...
|
|
*/
|
|
if (pfn >= ARCH_PFN_OFFSET && is_end_low)
|
|
return 0;
|
|
|
|
return 1;
|
|
}
|
|
|
|
static inline int pfn_valid(unsigned long pfn)
|
|
{
|
|
int nid = pfn_to_nid(pfn);
|
|
|
|
return (pfn <= node_end_pfn(nid));
|
|
}
|
|
#endif /* CONFIG_DISCONTIGMEM */
|
|
|
|
#endif
|