Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 176716
b: refs/heads/master
c: 289750d
h: refs/heads/master
v: v3
  • Loading branch information
Robin Holt authored and Linus Torvalds committed Dec 16, 2009
1 parent bae9230 commit 58cd7ae
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fae419f2abd15ab7d1cd1413e6683a276a4e14e2
refs/heads/master: 289750d1f1fd4a715baa2a2c6dd0cec2b8317fd7
13 changes: 13 additions & 0 deletions trunk/drivers/misc/sgi-gru/gru_instructions.h
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,19 @@ static inline void gru_start_instruction(struct gru_instruction *ins, int op32)
* - nelem and stride are in elements
* - tri0/tri1 is in bytes for the beginning of the data segment.
*/
static inline void gru_vload_phys(void *cb, unsigned long gpa,
unsigned int tri0, int iaa, unsigned long hints)
{
struct gru_instruction *ins = (struct gru_instruction *)cb;

ins->baddr0 = (long)gpa | ((unsigned long)iaa << 62);
ins->nelem = 1;
ins->tri0 = tri0;
ins->op1_stride = 1;
gru_start_instruction(ins, __opword(OP_VLOAD, 0, XTYPE_DW, iaa, 0,
CB_IMA(hints)));
}

static inline void gru_vload(void *cb, unsigned long mem_addr,
unsigned int tri0, unsigned char xtype, unsigned long nelem,
unsigned long stride, unsigned long hints)
Expand Down
23 changes: 23 additions & 0 deletions trunk/drivers/misc/sgi-gru/grukservices.c
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,29 @@ EXPORT_SYMBOL_GPL(gru_get_next_message);

/* ---------------------- GRU DATA COPY FUNCTIONS ---------------------------*/

/*
* Load a DW from a global GPA. The GPA can be a memory or MMR address.
*/
int gru_read_gpa(unsigned long *value, unsigned long gpa)
{
void *cb;
void *dsr;
int ret, iaa;

STAT(read_gpa);
if (gru_get_cpu_resources(GRU_NUM_KERNEL_DSR_BYTES, &cb, &dsr))
return MQE_BUG_NO_RESOURCES;
iaa = gpa >> 62;
gru_vload_phys(cb, gpa, gru_get_tri(dsr), iaa, IMA);
ret = gru_wait(cb);
if (ret == CBS_IDLE)
*value = *(unsigned long *)dsr;
gru_free_cpu_resources(cb, dsr);
return ret;
}
EXPORT_SYMBOL_GPL(gru_read_gpa);


/*
* Copy a block of data using the GRU resources
*/
Expand Down
14 changes: 14 additions & 0 deletions trunk/drivers/misc/sgi-gru/grukservices.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,20 @@ extern void gru_free_message(struct gru_message_queue_desc *mqd,
extern void *gru_get_next_message(struct gru_message_queue_desc *mqd);


/*
* Read a GRU global GPA. Source can be located in a remote partition.
*
* Input:
* value memory address where MMR value is returned
* gpa source numalink physical address of GPA
*
* Output:
* 0 OK
* >0 error
*/
int gru_read_gpa(unsigned long *value, unsigned long gpa);


/*
* Copy data using the GRU. Source or destination can be located in a remote
* partition.
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/misc/sgi-gru/gruprocfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ static int statistics_show(struct seq_file *s, void *p)
printstat(s, flush_tlb_gru_tgh);
printstat(s, flush_tlb_gru_zero_asid);
printstat(s, copy_gpa);
printstat(s, read_gpa);
printstat(s, mesq_receive);
printstat(s, mesq_receive_none);
printstat(s, mesq_send);
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/misc/sgi-gru/grutables.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ struct gru_stats_s {
atomic_long_t flush_tlb_gru_zero_asid;

atomic_long_t copy_gpa;
atomic_long_t read_gpa;

atomic_long_t mesq_receive;
atomic_long_t mesq_receive_none;
Expand Down

0 comments on commit 58cd7ae

Please sign in to comment.