aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/sgi-gru/grutables.h
diff options
context:
space:
mode:
authorJack Steiner <steiner@sgi.com>2008-07-30 01:34:02 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-30 12:41:48 -0400
commit9ca8e40c130c906c1060d105e63628410c860261 (patch)
treef43ec77a814039d2317c3012810b049c221e14ec /drivers/misc/sgi-gru/grutables.h
parent3d919e5f6b440bb0cc7996eb7628b29be09e6343 (diff)
GRU Driver V3: fixes to resolve code review comments
Fixes problems identified in a code review: - add comment with high level dscription of the GRU - prepend "gru_" to all global names - delete unused function - couple of trivial bug fixes [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Jack Steiner <steiner@sgi.com> Cc: Nick Piggin <nickpiggin@yahoo.com.au> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/misc/sgi-gru/grutables.h')
-rw-r--r--drivers/misc/sgi-gru/grutables.h74
1 files changed, 69 insertions, 5 deletions
diff --git a/drivers/misc/sgi-gru/grutables.h b/drivers/misc/sgi-gru/grutables.h
index f97d84640129..4251018f70ff 100644
--- a/drivers/misc/sgi-gru/grutables.h
+++ b/drivers/misc/sgi-gru/grutables.h
@@ -24,6 +24,70 @@
24#define __GRUTABLES_H__ 24#define __GRUTABLES_H__
25 25
26/* 26/*
27 * GRU Chiplet:
28 * The GRU is a user addressible memory accelerator. It provides
29 * several forms of load, store, memset, bcopy instructions. In addition, it
30 * contains special instructions for AMOs, sending messages to message
31 * queues, etc.
32 *
33 * The GRU is an integral part of the node controller. It connects
34 * directly to the cpu socket. In its current implementation, there are 2
35 * GRU chiplets in the node controller on each blade (~node).
36 *
37 * The entire GRU memory space is fully coherent and cacheable by the cpus.
38 *
39 * Each GRU chiplet has a physical memory map that looks like the following:
40 *
41 * +-----------------+
42 * |/////////////////|
43 * |/////////////////|
44 * |/////////////////|
45 * |/////////////////|
46 * |/////////////////|
47 * |/////////////////|
48 * |/////////////////|
49 * |/////////////////|
50 * +-----------------+
51 * | system control |
52 * +-----------------+ _______ +-------------+
53 * |/////////////////| / | |
54 * |/////////////////| / | |
55 * |/////////////////| / | instructions|
56 * |/////////////////| / | |
57 * |/////////////////| / | |
58 * |/////////////////| / |-------------|
59 * |/////////////////| / | |
60 * +-----------------+ | |
61 * | context 15 | | data |
62 * +-----------------+ | |
63 * | ...... | \ | |
64 * +-----------------+ \____________ +-------------+
65 * | context 1 |
66 * +-----------------+
67 * | context 0 |
68 * +-----------------+
69 *
70 * Each of the "contexts" is a chunk of memory that can be mmaped into user
71 * space. The context consists of 2 parts:
72 *
73 * - an instruction space that can be directly accessed by the user
74 * to issue GRU instructions and to check instruction status.
75 *
76 * - a data area that acts as normal RAM.
77 *
78 * User instructions contain virtual addresses of data to be accessed by the
79 * GRU. The GRU contains a TLB that is used to convert these user virtual
80 * addresses to physical addresses.
81 *
82 * The "system control" area of the GRU chiplet is used by the kernel driver
83 * to manage user contexts and to perform functions such as TLB dropin and
84 * purging.
85 *
86 * One context may be reserved for the kernel and used for cross-partition
87 * communication. The GRU will also be used to asynchronously zero out
88 * large blocks of memory (not currently implemented).
89 *
90 *
27 * Tables: 91 * Tables:
28 * 92 *
29 * VDATA-VMA Data - Holds a few parameters. Head of linked list of 93 * VDATA-VMA Data - Holds a few parameters. Head of linked list of
@@ -190,14 +254,14 @@ struct gru_stats_s {
190#define GRU_STEAL_DELAY ((HZ * 200) / 1000) 254#define GRU_STEAL_DELAY ((HZ * 200) / 1000)
191 255
192#define STAT(id) do { \ 256#define STAT(id) do { \
193 if (options & OPT_STATS) \ 257 if (gru_options & OPT_STATS) \
194 atomic_long_inc(&gru_stats.id); \ 258 atomic_long_inc(&gru_stats.id); \
195 } while (0) 259 } while (0)
196 260
197#ifdef CONFIG_SGI_GRU_DEBUG 261#ifdef CONFIG_SGI_GRU_DEBUG
198#define gru_dbg(dev, fmt, x...) \ 262#define gru_dbg(dev, fmt, x...) \
199 do { \ 263 do { \
200 if (options & OPT_DPRINT) \ 264 if (gru_options & OPT_DPRINT) \
201 dev_dbg(dev, "%s: " fmt, __func__, x); \ 265 dev_dbg(dev, "%s: " fmt, __func__, x); \
202 } while (0) 266 } while (0)
203#else 267#else
@@ -529,9 +593,9 @@ extern void gru_flush_all_tlb(struct gru_state *gru);
529extern int gru_proc_init(void); 593extern int gru_proc_init(void);
530extern void gru_proc_exit(void); 594extern void gru_proc_exit(void);
531 595
532extern unsigned long reserve_gru_cb_resources(struct gru_state *gru, 596extern unsigned long gru_reserve_cb_resources(struct gru_state *gru,
533 int cbr_au_count, char *cbmap); 597 int cbr_au_count, char *cbmap);
534extern unsigned long reserve_gru_ds_resources(struct gru_state *gru, 598extern unsigned long gru_reserve_ds_resources(struct gru_state *gru,
535 int dsr_au_count, char *dsmap); 599 int dsr_au_count, char *dsmap);
536extern int gru_fault(struct vm_area_struct *, struct vm_fault *vmf); 600extern int gru_fault(struct vm_area_struct *, struct vm_fault *vmf);
537extern struct gru_mm_struct *gru_register_mmu_notifier(void); 601extern struct gru_mm_struct *gru_register_mmu_notifier(void);
@@ -540,6 +604,6 @@ extern void gru_drop_mmu_notifier(struct gru_mm_struct *gms);
540extern void gru_flush_tlb_range(struct gru_mm_struct *gms, unsigned long start, 604extern void gru_flush_tlb_range(struct gru_mm_struct *gms, unsigned long start,
541 unsigned long len); 605 unsigned long len);
542 606
543extern unsigned long options; 607extern unsigned long gru_options;
544 608
545#endif /* __GRUTABLES_H__ */ 609#endif /* __GRUTABLES_H__ */