/*1* Copyright (c) 2008 Silicon Graphics, Inc. All Rights Reserved.2*3* This program is free software; you can redistribute it and/or modify4* it under the terms of the GNU Lesser General Public License as published by5* the Free Software Foundation; either version 2.1 of the License, or6* (at your option) any later version.7*8* This program is distributed in the hope that it will be useful,9* but WITHOUT ANY WARRANTY; without even the implied warranty of10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the11* GNU Lesser General Public License for more details.12*13* You should have received a copy of the GNU Lesser General Public License14* along with this program; if not, write to the Free Software15* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA16*/1718#ifndef __GRU_H__19#define __GRU_H__2021/*22* GRU architectural definitions23*/24#define GRU_CACHE_LINE_BYTES 6425#define GRU_HANDLE_STRIDE 25626#define GRU_CB_BASE 027#define GRU_DS_BASE 0x200002829/*30* Size used to map GRU GSeg31*/32#if defined(CONFIG_IA64)33#define GRU_GSEG_PAGESIZE (256 * 1024UL)34#elif defined(CONFIG_X86_64)35#define GRU_GSEG_PAGESIZE (256 * 1024UL) /* ZZZ 2MB ??? */36#else37#error "Unsupported architecture"38#endif3940/*41* Structure for obtaining GRU resource information42*/43struct gru_chiplet_info {44int node;45int chiplet;46int blade;47int total_dsr_bytes;48int total_cbr;49int total_user_dsr_bytes;50int total_user_cbr;51int free_user_dsr_bytes;52int free_user_cbr;53};5455/*56* Statictics kept for each context.57*/58struct gru_gseg_statistics {59unsigned long fmm_tlbmiss;60unsigned long upm_tlbmiss;61unsigned long tlbdropin;62unsigned long context_stolen;63unsigned long reserved[10];64};6566/* Flags for GRU options on the gru_create_context() call */67/* Select one of the follow 4 options to specify how TLB misses are handled */68#define GRU_OPT_MISS_DEFAULT 0x0000 /* Use default mode */69#define GRU_OPT_MISS_USER_POLL 0x0001 /* User will poll CB for faults */70#define GRU_OPT_MISS_FMM_INTR 0x0002 /* Send interrupt to cpu to71handle fault */72#define GRU_OPT_MISS_FMM_POLL 0x0003 /* Use system polling thread */73#define GRU_OPT_MISS_MASK 0x0003 /* Mask for TLB MISS option */74757677#endif /* __GRU_H__ */787980