Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 | * |
Russ Anderson | 95ff439 | 2005-04-25 13:19:11 -0700 | [diff] [blame] | 6 | * Copyright (C) 1992 - 1997, 2000-2005 Silicon Graphics, Inc. All rights reserved. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 | */ |
| 8 | #ifndef _ASM_IA64_SN_NODEPDA_H |
| 9 | #define _ASM_IA64_SN_NODEPDA_H |
| 10 | |
| 11 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 12 | #include <asm/irq.h> |
| 13 | #include <asm/sn/arch.h> |
| 14 | #include <asm/sn/intr.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | #include <asm/sn/bte.h> |
| 16 | |
| 17 | /* |
| 18 | * NUMA Node-Specific Data structures are defined in this file. |
| 19 | * In particular, this is the location of the node PDA. |
| 20 | * A pointer to the right node PDA is saved in each CPU PDA. |
| 21 | */ |
| 22 | |
| 23 | /* |
| 24 | * Node-specific data structure. |
| 25 | * |
| 26 | * One of these structures is allocated on each node of a NUMA system. |
| 27 | * |
| 28 | * This structure provides a convenient way of keeping together |
| 29 | * all per-node data structures. |
| 30 | */ |
| 31 | struct phys_cpuid { |
| 32 | short nasid; |
| 33 | char subnode; |
| 34 | char slice; |
| 35 | }; |
| 36 | |
| 37 | struct nodepda_s { |
| 38 | void *pdinfo; /* Platform-dependent per-node info */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 39 | |
| 40 | /* |
| 41 | * The BTEs on this node are shared by the local cpus |
| 42 | */ |
Russ Anderson | 95ff439 | 2005-04-25 13:19:11 -0700 | [diff] [blame] | 43 | struct bteinfo_s bte_if[MAX_BTES_PER_NODE]; /* Virtual Interface */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 44 | struct timer_list bte_recovery_timer; |
| 45 | spinlock_t bte_recovery_lock; |
| 46 | |
| 47 | /* |
| 48 | * Array of pointers to the nodepdas for each node. |
| 49 | */ |
| 50 | struct nodepda_s *pernode_pdaindr[MAX_COMPACT_NODES]; |
| 51 | |
| 52 | /* |
| 53 | * Array of physical cpu identifiers. Indexed by cpuid. |
| 54 | */ |
| 55 | struct phys_cpuid phys_cpuid[NR_CPUS]; |
Jack Steiner | 470ceb0 | 2005-08-11 10:28:00 -0700 | [diff] [blame] | 56 | spinlock_t ptc_lock ____cacheline_aligned_in_smp; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 57 | }; |
| 58 | |
| 59 | typedef struct nodepda_s nodepda_t; |
| 60 | |
| 61 | /* |
| 62 | * Access Functions for node PDA. |
| 63 | * Since there is one nodepda for each node, we need a convenient mechanism |
| 64 | * to access these nodepdas without cluttering code with #ifdefs. |
| 65 | * The next set of definitions provides this. |
| 66 | * Routines are expected to use |
| 67 | * |
Dean Nelson | 9b48b46 | 2005-03-22 16:00:00 -0700 | [diff] [blame] | 68 | * sn_nodepda - to access node PDA for the node on which code is running |
| 69 | * NODEPDA(cnodeid) - to access node PDA for cnodeid |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 70 | */ |
| 71 | |
Dean Nelson | 9b48b46 | 2005-03-22 16:00:00 -0700 | [diff] [blame] | 72 | DECLARE_PER_CPU(struct nodepda_s *, __sn_nodepda); |
| 73 | #define sn_nodepda (__get_cpu_var(__sn_nodepda)) |
| 74 | #define NODEPDA(cnodeid) (sn_nodepda->pernode_pdaindr[cnodeid]) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 75 | |
| 76 | /* |
| 77 | * Check if given a compact node id the corresponding node has all the |
| 78 | * cpus disabled. |
| 79 | */ |
Dean Nelson | 9b48b46 | 2005-03-22 16:00:00 -0700 | [diff] [blame] | 80 | #define is_headless_node(cnodeid) (nr_cpus_node(cnodeid) == 0) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 81 | |
| 82 | #endif /* _ASM_IA64_SN_NODEPDA_H */ |