mm: fix exec activate_mm vs TLB shootdown and lazy tlb switching race
[linux/fpc-iii.git] / arch / arc / include / asm / mmzone.h
blob8e97136413d99d9c2e53c8e0b655285f6d1c7eff
1 /*
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.
7 */
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)
19 int is_end_low = 1;
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)
30 return 0;
32 return 1;
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 */
43 #endif