-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jack Steiner
authored and
Linus Torvalds
committed
Jul 30, 2008
1 parent
cf4d0ad
commit 88491d5
Showing
4 changed files
with
710 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: 4c921d4d8aa74140597fd8736261837f73ca6e7a | ||
refs/heads/master: 13d19498b0446cad2c394f9fbec8149b44a60c6e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
* Copyright (c) 2008 Silicon Graphics, Inc. All Rights Reserved. | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation; either version 2.1 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
*/ | ||
|
||
#ifndef __GRU_H__ | ||
#define __GRU_H__ | ||
|
||
/* | ||
* GRU architectural definitions | ||
*/ | ||
#define GRU_CACHE_LINE_BYTES 64 | ||
#define GRU_HANDLE_STRIDE 256 | ||
#define GRU_CB_BASE 0 | ||
#define GRU_DS_BASE 0x20000 | ||
|
||
/* | ||
* Size used to map GRU GSeg | ||
*/ | ||
#if defined CONFIG_IA64 | ||
#define GRU_GSEG_PAGESIZE (256 * 1024UL) | ||
#elif defined CONFIG_X86_64 | ||
#define GRU_GSEG_PAGESIZE (256 * 1024UL) /* ZZZ 2MB ??? */ | ||
#else | ||
#error "Unsupported architecture" | ||
#endif | ||
|
||
/* | ||
* Structure for obtaining GRU resource information | ||
*/ | ||
struct gru_chiplet_info { | ||
int node; | ||
int chiplet; | ||
int blade; | ||
int total_dsr_bytes; | ||
int total_cbr; | ||
int total_user_dsr_bytes; | ||
int total_user_cbr; | ||
int free_user_dsr_bytes; | ||
int free_user_cbr; | ||
}; | ||
|
||
/* Flags for GRU options on the gru_create_context() call */ | ||
/* Select one of the follow 4 options to specify how TLB misses are handled */ | ||
#define GRU_OPT_MISS_DEFAULT 0x0000 /* Use default mode */ | ||
#define GRU_OPT_MISS_USER_POLL 0x0001 /* User will poll CB for faults */ | ||
#define GRU_OPT_MISS_FMM_INTR 0x0002 /* Send interrupt to cpu to | ||
handle fault */ | ||
#define GRU_OPT_MISS_FMM_POLL 0x0003 /* Use system polling thread */ | ||
#define GRU_OPT_MISS_MASK 0x0003 /* Mask for TLB MISS option */ | ||
|
||
|
||
|
||
#endif /* __GRU_H__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
/* | ||
* Copyright (c) 2008 Silicon Graphics, Inc. All Rights Reserved. | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation; either version 2.1 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
*/ | ||
|
||
#ifndef __GRULIB_H__ | ||
#define __GRULIB_H__ | ||
|
||
#define GRU_BASENAME "gru" | ||
#define GRU_FULLNAME "/dev/gru" | ||
#define GRU_IOCTL_NUM 'G' | ||
|
||
/* | ||
* Maximum number of GRU segments that a user can have open | ||
* ZZZ temp - set high for testing. Revisit. | ||
*/ | ||
#define GRU_MAX_OPEN_CONTEXTS 32 | ||
|
||
/* Set Number of Request Blocks */ | ||
#define GRU_CREATE_CONTEXT _IOWR(GRU_IOCTL_NUM, 1, void *) | ||
|
||
/* Register task as using the slice */ | ||
#define GRU_SET_TASK_SLICE _IOWR(GRU_IOCTL_NUM, 5, void *) | ||
|
||
/* Fetch exception detail */ | ||
#define GRU_USER_GET_EXCEPTION_DETAIL _IOWR(GRU_IOCTL_NUM, 6, void *) | ||
|
||
/* For user call_os handling - normally a TLB fault */ | ||
#define GRU_USER_CALL_OS _IOWR(GRU_IOCTL_NUM, 8, void *) | ||
|
||
/* For user unload context */ | ||
#define GRU_USER_UNLOAD_CONTEXT _IOWR(GRU_IOCTL_NUM, 9, void *) | ||
|
||
/* For fetching GRU chiplet status */ | ||
#define GRU_GET_CHIPLET_STATUS _IOWR(GRU_IOCTL_NUM, 10, void *) | ||
|
||
/* For user TLB flushing (primarily for tests) */ | ||
#define GRU_USER_FLUSH_TLB _IOWR(GRU_IOCTL_NUM, 50, void *) | ||
|
||
/* Get some config options (primarily for tests & emulator) */ | ||
#define GRU_GET_CONFIG_INFO _IOWR(GRU_IOCTL_NUM, 51, void *) | ||
|
||
#define CONTEXT_WINDOW_BYTES(th) (GRU_GSEG_PAGESIZE * (th)) | ||
#define THREAD_POINTER(p, th) (p + GRU_GSEG_PAGESIZE * (th)) | ||
|
||
/* | ||
* Structure used to pass TLB flush parameters to the driver | ||
*/ | ||
struct gru_create_context_req { | ||
unsigned long gseg; | ||
unsigned int data_segment_bytes; | ||
unsigned int control_blocks; | ||
unsigned int maximum_thread_count; | ||
unsigned int options; | ||
}; | ||
|
||
/* | ||
* Structure used to pass unload context parameters to the driver | ||
*/ | ||
struct gru_unload_context_req { | ||
unsigned long gseg; | ||
}; | ||
|
||
/* | ||
* Structure used to pass TLB flush parameters to the driver | ||
*/ | ||
struct gru_flush_tlb_req { | ||
unsigned long gseg; | ||
unsigned long vaddr; | ||
size_t len; | ||
}; | ||
|
||
/* | ||
* GRU configuration info (temp - for testing) | ||
*/ | ||
struct gru_config_info { | ||
int cpus; | ||
int blades; | ||
int nodes; | ||
int chiplets; | ||
int fill[16]; | ||
}; | ||
|
||
#endif /* __GRULIB_H__ */ |
Oops, something went wrong.