1 /*
2  * This file is subject to the terms and conditions of the GNU General Public
3  * License.  See the file "COPYING" in the main directory of this archive
4  * for more details.
5  *
6  * Copyright (c) 2000 Silicon Graphics, Inc.  All rights reserved.
7  * Copyright (c) 2002 NEC Corp.
8  * Copyright (c) 2002 Erich Focht <efocht@ess.nec.de>
9  * Copyright (c) 2002 Kimio Suganuma <k-suganuma@da.jp.nec.com>
10  */
11 
12 
13 #ifndef _ASM_IA64_NODEDATA_H
14 #define _ASM_IA64_NODEDATA_H
15 
16 
17 #include <asm/mmzone.h>
18 
19 /*
20  * Node Data. One of these structures is located on each node of a NUMA system.
21  */
22 
23 struct pglist_data;
24 struct ia64_node_data {
25 	short			node;
26 	short			active_cpu_count;
27 	/*
28 	 * The fields are read-only (after boot). They contain pointers to various structures
29 	 * located on other nodes. Ths data is replicated on each node in order to reduce
30 	 * off-node references.
31 	 */
32         struct pglist_data	*pg_data_ptrs[NR_NODES];
33 	struct ia64_node_data	*node_data_ptrs[NR_NODES];
34 };
35 
36 
37 /*
38  * Return a pointer to the node_data structure for the executing cpu.
39  */
40 #define local_node_data		(local_cpu_data->node_data)
41 
42 
43 /*
44  * Return a pointer to the node_data structure for the specified node.
45  */
46 #define node_data(node)	(local_node_data->node_data_ptrs[node])
47 
48 
49 /*
50  * Given a node id, return a pointer to the pg_data_t for the node.
51  * The following 2 macros are similar.
52  *
53  * NODE_DATA 	- should be used in all code not related to system
54  *		  initialization. It uses pernode data structures to minimize
55  *		  offnode memory references. However, these structure are not
56  *		  present during boot. This macro can be used once cpu_init
57  *		  completes.
58  *
59  * NOTE:   The names of these macros are misleading but are difficult to change
60  *	   since they are used in generic linux & on other architecures.
61  */
62 #define NODE_DATA(nid)		(local_node_data->pg_data_ptrs[nid])
63 
64 extern struct pglist_data * __init boot_get_pg_data_ptr(long);
65 
66 #endif /* _ASM_IA64_NODEDATA_H */
67