mm: fix exec activate_mm vs TLB shootdown and lazy tlb switching race
[linux/fpc-iii.git] / arch / m32r / include / asm / mmzone.h
blob568946c13ba67744818746606782ce798c09c781
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3 * Written by Pat Gaughen (gone@us.ibm.com) Mar 2002
5 */
7 #ifndef _ASM_MMZONE_H_
8 #define _ASM_MMZONE_H_
10 #include <asm/smp.h>
12 #ifdef CONFIG_DISCONTIGMEM
14 extern struct pglist_data *node_data[];
15 #define NODE_DATA(nid) (node_data[nid])
17 #define node_localnr(pfn, nid) ((pfn) - NODE_DATA(nid)->node_start_pfn)
19 #define pmd_page(pmd) (pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT))
21 * pfn_valid should be made as fast as possible, and the current definition
22 * is valid for machines that are NUMA, but still contiguous, which is what
23 * is currently supported. A more generalised, but slower definition would
24 * be something like this - mbligh:
25 * ( pfn_to_pgdat(pfn) && ((pfn) < node_end_pfn(pfn_to_nid(pfn))) )
27 #if 1 /* M32R_FIXME */
28 #define pfn_valid(pfn) (1)
29 #else
30 #define pfn_valid(pfn) ((pfn) < num_physpages)
31 #endif
34 * generic node memory support, the following assumptions apply:
37 static __inline__ int pfn_to_nid(unsigned long pfn)
39 int node;
41 for (node = 0 ; node < MAX_NUMNODES ; node++)
42 if (pfn >= node_start_pfn(node) && pfn < node_end_pfn(node))
43 break;
45 return node;
48 static __inline__ struct pglist_data *pfn_to_pgdat(unsigned long pfn)
50 return(NODE_DATA(pfn_to_nid(pfn)));
53 #endif /* CONFIG_DISCONTIGMEM */
54 #endif /* _ASM_MMZONE_H_ */