2 * Copyright (C) 2016 Synopsys, Inc. (www.synopsys.com)
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
9 #ifndef _ASM_ARC_MMZONE_H
10 #define _ASM_ARC_MMZONE_H
12 #ifdef CONFIG_DISCONTIGMEM
14 extern struct pglist_data node_data
[];
15 #define NODE_DATA(nid) (&node_data[nid])
17 static inline int pfn_to_nid(unsigned long pfn
)
21 if (IS_ENABLED(CONFIG_ARC_HAS_PAE40
))
22 is_end_low
= pfn
<= virt_to_pfn(0xFFFFFFFFUL
);
25 * node 0: lowmem: 0x8000_0000 to 0xFFFF_FFFF
26 * node 1: HIGHMEM w/o PAE40: 0x0 to 0x7FFF_FFFF
27 * HIGHMEM with PAE40: 0x1_0000_0000 to ...
29 if (pfn
>= ARCH_PFN_OFFSET
&& is_end_low
)
35 static inline int pfn_valid(unsigned long pfn
)
37 int nid
= pfn_to_nid(pfn
);
39 return (pfn
<= node_end_pfn(nid
));
41 #endif /* CONFIG_DISCONTIGMEM */