gru: delete user request for fetching chiplet status
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / drivers / misc / sgi-gru / grulib.h
blob8ed6acbc47c7b6176a8652463e702d897cdc73a7
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 __GRULIB_H__
20 #define __GRULIB_H__
22 #define GRU_BASENAME "gru"
23 #define GRU_FULLNAME "/dev/gru"
24 #define GRU_IOCTL_NUM 'G'
27 * Maximum number of GRU segments that a user can have open
28 * ZZZ temp - set high for testing. Revisit.
30 #define GRU_MAX_OPEN_CONTEXTS 32
32 /* Set Number of Request Blocks */
33 #define GRU_CREATE_CONTEXT _IOWR(GRU_IOCTL_NUM, 1, void *)
35 /* Register task as using the slice */
36 #define GRU_SET_TASK_SLICE _IOWR(GRU_IOCTL_NUM, 5, void *)
38 /* Fetch exception detail */
39 #define GRU_USER_GET_EXCEPTION_DETAIL _IOWR(GRU_IOCTL_NUM, 6, void *)
41 /* For user call_os handling - normally a TLB fault */
42 #define GRU_USER_CALL_OS _IOWR(GRU_IOCTL_NUM, 8, void *)
44 /* For user unload context */
45 #define GRU_USER_UNLOAD_CONTEXT _IOWR(GRU_IOCTL_NUM, 9, void *)
47 /* For dumpping GRU chiplet state */
48 #define GRU_DUMP_CHIPLET_STATE _IOWR(GRU_IOCTL_NUM, 11, void *)
50 /* For getting gseg statistics */
51 #define GRU_GET_GSEG_STATISTICS _IOWR(GRU_IOCTL_NUM, 12, void *)
53 /* For user TLB flushing (primarily for tests) */
54 #define GRU_USER_FLUSH_TLB _IOWR(GRU_IOCTL_NUM, 50, void *)
56 /* Get some config options (primarily for tests & emulator) */
57 #define GRU_GET_CONFIG_INFO _IOWR(GRU_IOCTL_NUM, 51, void *)
59 /* Various kernel self-tests */
60 #define GRU_KTEST _IOWR(GRU_IOCTL_NUM, 52, void *)
62 #define CONTEXT_WINDOW_BYTES(th) (GRU_GSEG_PAGESIZE * (th))
63 #define THREAD_POINTER(p, th) (p + GRU_GSEG_PAGESIZE * (th))
64 #define GSEG_START(cb) ((void *)((unsigned long)(cb) & ~(GRU_GSEG_PAGESIZE - 1)))
67 * Statictics kept on a per-GTS basis.
69 struct gts_statistics {
70 unsigned long fmm_tlbdropin;
71 unsigned long upm_tlbdropin;
72 unsigned long context_stolen;
75 struct gru_get_gseg_statistics_req {
76 unsigned long gseg;
77 struct gts_statistics stats;
81 * Structure used to pass TLB flush parameters to the driver
83 struct gru_create_context_req {
84 unsigned long gseg;
85 unsigned int data_segment_bytes;
86 unsigned int control_blocks;
87 unsigned int maximum_thread_count;
88 unsigned int options;
92 * Structure used to pass unload context parameters to the driver
94 struct gru_unload_context_req {
95 unsigned long gseg;
99 * Structure used to pass TLB flush parameters to the driver
101 struct gru_flush_tlb_req {
102 unsigned long gseg;
103 unsigned long vaddr;
104 size_t len;
108 * Structure used to pass TLB flush parameters to the driver
110 enum {dcs_pid, dcs_gid};
111 struct gru_dump_chiplet_state_req {
112 unsigned int op;
113 int gid;
114 int ctxnum;
115 char data_opt;
116 char lock_cch;
117 pid_t pid;
118 void *buf;
119 size_t buflen;
120 /* ---- output --- */
121 unsigned int num_contexts;
124 #define GRU_DUMP_MAGIC 0x3474ab6c
125 struct gru_dump_context_header {
126 unsigned int magic;
127 unsigned char gid;
128 unsigned char ctxnum;
129 unsigned char cbrcnt;
130 unsigned char dsrcnt;
131 pid_t pid;
132 unsigned long vaddr;
133 int cch_locked;
134 unsigned long data[0];
138 * GRU configuration info (temp - for testing)
140 struct gru_config_info {
141 int cpus;
142 int blades;
143 int nodes;
144 int chiplets;
145 int fill[16];
148 #endif /* __GRULIB_H__ */