OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [linux-2.4/] [include/] [asm-ia64/] [numa.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1275 phoenix
/*
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
 * This file contains NUMA specific prototypes and definitions.
7
 *
8
 * 2002/08/05 Erich Focht <efocht@ess.nec.de>
9
 *
10
 */
11
#ifndef _ASM_IA64_NUMA_H
12
#define _ASM_IA64_NUMA_H
13
 
14
#ifdef CONFIG_NUMA
15
 
16
#ifdef CONFIG_DISCONTIGMEM
17
# include <asm/mmzone.h>
18
#else
19
# define NR_NODES     (8)
20
# define NR_MEMBLKS   (NR_NODES * 8)
21
#endif
22
 
23
#include <linux/cache.h>
24
#include <linux/threads.h>
25
#include <linux/smp.h>
26
 
27
#define NODEMASK_WORDCOUNT       ((NR_NODES+(BITS_PER_LONG-1))/BITS_PER_LONG)
28
 
29
#define NODE_MASK_NONE   { [0 ... ((NR_NODES+BITS_PER_LONG-1)/BITS_PER_LONG)-1] = 0 }
30
 
31
typedef unsigned long   nodemask_t[NODEMASK_WORDCOUNT];
32
 
33
extern volatile char cpu_to_node_map[NR_CPUS] __cacheline_aligned;
34
extern volatile unsigned long node_to_cpu_mask[NR_NODES] __cacheline_aligned;
35
 
36
/* Stuff below this line could be architecture independent */
37
 
38
extern int num_memblks;         /* total number of memory chunks */
39
 
40
/*
41
 * List of node memory chunks. Filled when parsing SRAT table to
42
 * obtain information about memory nodes.
43
*/
44
 
45
struct node_memblk_s {
46
        unsigned long start_paddr;
47
        unsigned long size;
48
        int nid;                /* which logical node contains this chunk? */
49
        int bank;               /* which mem bank on this node */
50
};
51
 
52
struct node_cpuid_s {
53
        u16     phys_id;        /* id << 8 | eid */
54
        int     nid;            /* logical node containing this CPU */
55
};
56
 
57
extern struct node_memblk_s node_memblk[NR_MEMBLKS];
58
extern struct node_cpuid_s node_cpuid[NR_CPUS];
59
 
60
/*
61
 * ACPI 2.0 SLIT (System Locality Information Table)
62
 * http://devresource.hp.com/devresource/Docs/TechPapers/IA64/slit.pdf
63
 *
64
 * This is a matrix with "distances" between nodes, they should be
65
 * proportional to the memory access latency ratios.
66
 */
67
 
68
extern u8 numa_slit[NR_NODES * NR_NODES];
69
#define node_distance(from,to) (numa_slit[from * numnodes + to])
70
 
71
extern int paddr_to_nid(unsigned long paddr);
72
extern unsigned long memblk_endpaddr(unsigned long paddr);
73
 
74
#define local_nodeid (cpu_to_node_map[smp_processor_id()])
75
 
76
#else /* !CONFIG_NUMA */
77
 
78
#define node_distance(from,to) 10
79
#define paddr_to_nid(x) 0
80
#define memblk_endpaddr(x) ~0UL
81
#define local_nodeid 0
82
 
83
#endif /* CONFIG_NUMA */
84
 
85
#endif /* _ASM_IA64_NUMA_H */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.