1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (C) 2016 Synopsys, Inc. (www.synopsys.com)
6 #ifndef _ASM_ARC_MMZONE_H
7 #define _ASM_ARC_MMZONE_H
9 #ifdef CONFIG_DISCONTIGMEM
11 extern struct pglist_data node_data
[];
12 #define NODE_DATA(nid) (&node_data[nid])
14 static inline int pfn_to_nid(unsigned long pfn
)
18 if (IS_ENABLED(CONFIG_ARC_HAS_PAE40
))
19 is_end_low
= pfn
<= virt_to_pfn(0xFFFFFFFFUL
);
22 * node 0: lowmem: 0x8000_0000 to 0xFFFF_FFFF
23 * node 1: HIGHMEM w/o PAE40: 0x0 to 0x7FFF_FFFF
24 * HIGHMEM with PAE40: 0x1_0000_0000 to ...
26 if (pfn
>= ARCH_PFN_OFFSET
&& is_end_low
)
32 static inline int pfn_valid(unsigned long pfn
)
34 int nid
= pfn_to_nid(pfn
);
36 return (pfn
<= node_end_pfn(nid
));
38 #endif /* CONFIG_DISCONTIGMEM */