^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) * This file is subject to the terms and conditions of the GNU General Public
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * License. See the file "COPYING" in the main directory of this archive
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * for more details.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * Copyright (c) 2000 Silicon Graphics, Inc. All rights reserved.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * Copyright (c) 2002 NEC Corp.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * Copyright (c) 2002 Erich Focht <efocht@ess.nec.de>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) * Copyright (c) 2002 Kimio Suganuma <k-suganuma@da.jp.nec.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #ifndef _ASM_IA64_NODEDATA_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #define _ASM_IA64_NODEDATA_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #include <linux/numa.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #include <asm/percpu.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #include <asm/mmzone.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #ifdef CONFIG_NUMA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) * Node Data. One of these structures is located on each node of a NUMA system.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) struct pglist_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) struct ia64_node_data {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) short active_cpu_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) short node;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) struct pglist_data *pg_data_ptrs[MAX_NUMNODES];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) * Return a pointer to the node_data structure for the executing cpu.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) #define local_node_data (local_cpu_data->node_data)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) * Given a node id, return a pointer to the pg_data_t for the node.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) * NODE_DATA - should be used in all code not related to system
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) * initialization. It uses pernode data structures to minimize
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) * offnode memory references. However, these structure are not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) * present during boot. This macro can be used once cpu_init
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) * completes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) #define NODE_DATA(nid) (local_node_data->pg_data_ptrs[nid])
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) * LOCAL_DATA_ADDR - This is to calculate the address of other node's
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) * "local_node_data" at hot-plug phase. The local_node_data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) * is pointed by per_cpu_page. Kernel usually use it for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) * just executing cpu. However, when new node is hot-added,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) * the addresses of local data for other nodes are necessary
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) * to update all of them.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) #define LOCAL_DATA_ADDR(pgdat) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) ((struct ia64_node_data *)((u64)(pgdat) + \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) L1_CACHE_ALIGN(sizeof(struct pglist_data))))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) #endif /* CONFIG_NUMA */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) #endif /* _ASM_IA64_NODEDATA_H */