gruhandles.c (648eb8e50200a09db2488623958d9cbd4b8aaf55) gruhandles.c (67bf04a5c2574e9495f660f418f6df776821d578)
1/*
2 * GRU KERNEL MCS INSTRUCTIONS
3 *
4 * Copyright (c) 2008 Silicon Graphics, Inc. All Rights Reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or

--- 77 unchanged lines hidden (view full) ---

86 }
87 if (gru_options & OPT_STATS)
88 update_mcs_stats(opc, get_cycles() - start_time);
89 return status;
90}
91
92int cch_allocate(struct gru_context_configuration_handle *cch)
93{
1/*
2 * GRU KERNEL MCS INSTRUCTIONS
3 *
4 * Copyright (c) 2008 Silicon Graphics, Inc. All Rights Reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or

--- 77 unchanged lines hidden (view full) ---

86 }
87 if (gru_options & OPT_STATS)
88 update_mcs_stats(opc, get_cycles() - start_time);
89 return status;
90}
91
92int cch_allocate(struct gru_context_configuration_handle *cch)
93{
94 int ret;
95
94 cch->opc = CCHOP_ALLOCATE;
95 start_instruction(cch);
96 cch->opc = CCHOP_ALLOCATE;
97 start_instruction(cch);
96 return wait_instruction_complete(cch, cchop_allocate);
98 ret = wait_instruction_complete(cch, cchop_allocate);
99
100 /*
101 * Stop speculation into the GSEG being mapped by the previous ALLOCATE.
102 * The GSEG memory does not exist until the ALLOCATE completes.
103 */
104 sync_core();
105 return ret;
97}
98
99int cch_start(struct gru_context_configuration_handle *cch)
100{
101 cch->opc = CCHOP_START;
102 start_instruction(cch);
103 return wait_instruction_complete(cch, cchop_start);
104}
105
106int cch_interrupt(struct gru_context_configuration_handle *cch)
107{
108 cch->opc = CCHOP_INTERRUPT;
109 start_instruction(cch);
110 return wait_instruction_complete(cch, cchop_interrupt);
111}
112
113int cch_deallocate(struct gru_context_configuration_handle *cch)
114{
106}
107
108int cch_start(struct gru_context_configuration_handle *cch)
109{
110 cch->opc = CCHOP_START;
111 start_instruction(cch);
112 return wait_instruction_complete(cch, cchop_start);
113}
114
115int cch_interrupt(struct gru_context_configuration_handle *cch)
116{
117 cch->opc = CCHOP_INTERRUPT;
118 start_instruction(cch);
119 return wait_instruction_complete(cch, cchop_interrupt);
120}
121
122int cch_deallocate(struct gru_context_configuration_handle *cch)
123{
124 int ret;
125
115 cch->opc = CCHOP_DEALLOCATE;
116 start_instruction(cch);
126 cch->opc = CCHOP_DEALLOCATE;
127 start_instruction(cch);
117 return wait_instruction_complete(cch, cchop_deallocate);
128 ret = wait_instruction_complete(cch, cchop_deallocate);
129
130 /*
131 * Stop speculation into the GSEG being unmapped by the previous
132 * DEALLOCATE.
133 */
134 sync_core();
135 return ret;
118}
119
120int cch_interrupt_sync(struct gru_context_configuration_handle
121 *cch)
122{
123 cch->opc = CCHOP_INTERRUPT_SYNC;
124 start_instruction(cch);
125 return wait_instruction_complete(cch, cchop_interrupt_sync);

--- 65 unchanged lines hidden ---
136}
137
138int cch_interrupt_sync(struct gru_context_configuration_handle
139 *cch)
140{
141 cch->opc = CCHOP_INTERRUPT_SYNC;
142 start_instruction(cch);
143 return wait_instruction_complete(cch, cchop_interrupt_sync);

--- 65 unchanged lines hidden ---