On Tue, Nov 06, 2007 at 02:33:53AM -0800, akpm@linux-foundation.org wrote:
[mmotm.git] / drivers / misc / sgi-gru / gru.h
blobf93f03a9e6e9e3c0cb1d034b7f746386df76bfe2
1 /*
2 * Copyright (c) 2008 Silicon Graphics, Inc. All Rights Reserved.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #ifndef __GRU_H__
20 #define __GRU_H__
23 * GRU architectural definitions
25 #define GRU_CACHE_LINE_BYTES 64
26 #define GRU_HANDLE_STRIDE 256
27 #define GRU_CB_BASE 0
28 #define GRU_DS_BASE 0x20000
31 * Size used to map GRU GSeg
33 #if defined(CONFIG_IA64)
34 #define GRU_GSEG_PAGESIZE (256 * 1024UL)
35 #elif defined(CONFIG_X86_64)
36 #define GRU_GSEG_PAGESIZE (256 * 1024UL) /* ZZZ 2MB ??? */
37 #else
38 #error "Unsupported architecture"
39 #endif
42 * Structure for obtaining GRU resource information
44 struct gru_chiplet_info {
45 int node;
46 int chiplet;
47 int blade;
48 int total_dsr_bytes;
49 int total_cbr;
50 int total_user_dsr_bytes;
51 int total_user_cbr;
52 int free_user_dsr_bytes;
53 int free_user_cbr;
56 /* Flags for GRU options on the gru_create_context() call */
57 /* Select one of the follow 4 options to specify how TLB misses are handled */
58 #define GRU_OPT_MISS_DEFAULT 0x0000 /* Use default mode */
59 #define GRU_OPT_MISS_USER_POLL 0x0001 /* User will poll CB for faults */
60 #define GRU_OPT_MISS_FMM_INTR 0x0002 /* Send interrupt to cpu to
61 handle fault */
62 #define GRU_OPT_MISS_FMM_POLL 0x0003 /* Use system polling thread */
63 #define GRU_OPT_MISS_MASK 0x0003 /* Mask for TLB MISS option */
67 #endif /* __GRU_H__ */