drivers/misc/sgi-gru/gru_instructions.h
Source file repositories/reference/linux-study-clean/drivers/misc/sgi-gru/gru_instructions.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/misc/sgi-gru/gru_instructions.h- Extension
.h- Size
- 21283 bytes
- Lines
- 727
- Domain
- Driver Families
- Bucket
- drivers/misc
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
asm/cacheflush.h
Detected Declarations
struct control_block_extended_exc_detailstruct gru_instruction_bitsstruct gru_instructionstruct gru_control_block_statusfunction __opdwordfunction gru_flush_cachefunction gru_start_instructionfunction gru_vload_physfunction gru_vstore_physfunction gru_vloadfunction gru_vstorefunction gru_ivloadfunction gru_ivstorefunction gru_vsetfunction gru_ivsetfunction gru_vflushfunction gru_nopfunction gru_bcopyfunction gru_bstorefunction gru_gamirfunction gru_gamirrfunction gru_gamerfunction gru_gamerrfunction gru_gamxrfunction gru_mesqfunction gru_get_amo_valuefunction gru_get_amo_value_headfunction gru_get_amo_value_limitfunction gru_mesq_headfunction gru_get_cb_statusfunction gru_get_cb_message_queue_substatusfunction gru_get_cb_substatusfunction gru_check_statusfunction interfacefunction gru_wait_abortfunction gru_get_tri
Annotated Snippet
struct control_block_extended_exc_detail {
unsigned long cb;
int opc;
int ecause;
int exopc;
long exceptdet0;
int exceptdet1;
int cbrstate;
int cbrexecstatus;
};
/*
* Instruction formats
*/
/*
* Generic instruction format.
* This definition has precise bit field definitions.
*/
struct gru_instruction_bits {
/* DW 0 - low */
unsigned int icmd: 1;
unsigned char ima: 3; /* CB_DelRep, unmapped mode */
unsigned char reserved0: 4;
unsigned int xtype: 3;
unsigned int iaa0: 2;
unsigned int iaa1: 2;
unsigned char reserved1: 1;
unsigned char opc: 8; /* opcode */
unsigned char exopc: 8; /* extended opcode */
/* DW 0 - high */
unsigned int idef2: 22; /* TRi0 */
unsigned char reserved2: 2;
unsigned char istatus: 2;
unsigned char isubstatus:4;
unsigned char reserved3: 1;
unsigned char tlb_fault_color: 1;
/* DW 1 */
unsigned long idef4; /* 42 bits: TRi1, BufSize */
/* DW 2-6 */
unsigned long idef1; /* BAddr0 */
unsigned long idef5; /* Nelem */
unsigned long idef6; /* Stride, Operand1 */
unsigned long idef3; /* BAddr1, Value, Operand2 */
unsigned long reserved4;
/* DW 7 */
unsigned long avalue; /* AValue */
};
/*
* Generic instruction with friendlier names. This format is used
* for inline instructions.
*/
struct gru_instruction {
/* DW 0 */
union {
unsigned long op64; /* icmd,xtype,iaa0,ima,opc,tri0 */
struct {
unsigned int op32;
unsigned int tri0;
};
};
unsigned long tri1_bufsize; /* DW 1 */
unsigned long baddr0; /* DW 2 */
unsigned long nelem; /* DW 3 */
unsigned long op1_stride; /* DW 4 */
unsigned long op2_value_baddr1; /* DW 5 */
unsigned long reserved0; /* DW 6 */
unsigned long avalue; /* DW 7 */
};
/* Some shifts and masks for the low 64 bits of a GRU command */
#define GRU_CB_ICMD_SHFT 0
#define GRU_CB_ICMD_MASK 0x1
#define GRU_CB_XTYPE_SHFT 8
#define GRU_CB_XTYPE_MASK 0x7
#define GRU_CB_IAA0_SHFT 11
#define GRU_CB_IAA0_MASK 0x3
#define GRU_CB_IAA1_SHFT 13
#define GRU_CB_IAA1_MASK 0x3
#define GRU_CB_IMA_SHFT 1
#define GRU_CB_IMA_MASK 0x3
#define GRU_CB_OPC_SHFT 16
#define GRU_CB_OPC_MASK 0xff
#define GRU_CB_EXOPC_SHFT 24
#define GRU_CB_EXOPC_MASK 0xff
#define GRU_IDEF2_SHFT 32
#define GRU_IDEF2_MASK 0x3ffff
#define GRU_ISTATUS_SHFT 56
#define GRU_ISTATUS_MASK 0x3
Annotation
- Immediate include surface: `asm/cacheflush.h`.
- Detected declarations: `struct control_block_extended_exc_detail`, `struct gru_instruction_bits`, `struct gru_instruction`, `struct gru_control_block_status`, `function __opdword`, `function gru_flush_cache`, `function gru_start_instruction`, `function gru_vload_phys`, `function gru_vstore_phys`, `function gru_vload`.
- Atlas domain: Driver Families / drivers/misc.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.