Lines Matching defs:binary

208 				struct r600_shader_binary *binary)
222 binary->global_symbol_offsets = CALLOC(symbol_count, sizeof(uint64_t));
231 binary->global_symbol_offsets[binary->global_symbol_count] =
236 for (i = binary->global_symbol_count; i > 0; --i) {
237 uint64_t lhs = binary->global_symbol_offsets[i - 1];
238 uint64_t rhs = binary->global_symbol_offsets[i];
242 binary->global_symbol_offsets[i] = lhs;
243 binary->global_symbol_offsets[i - 1] = rhs;
245 ++binary->global_symbol_count;
252 struct r600_shader_binary *binary)
256 if (!relocs || !symbols || !binary->reloc_count) {
259 binary->relocs = CALLOC(binary->reloc_count,
261 for (i = 0; i < binary->reloc_count; i++) {
265 struct r600_shader_reloc *reloc = &binary->relocs[i];
278 struct r600_shader_binary *binary)
310 binary->code_size = section_data->d_size;
311 binary->code = MALLOC(binary->code_size * sizeof(unsigned char));
312 memcpy(binary->code, section_data->d_buf, binary->code_size);
315 binary->config_size = section_data->d_size;
316 binary->config = MALLOC(binary->config_size * sizeof(unsigned char));
317 memcpy(binary->config, section_data->d_buf, binary->config_size);
321 binary->disasm_string = strndup(section_data->d_buf,
325 binary->rodata_size = section_data->d_size;
326 binary->rodata = MALLOC(binary->rodata_size * sizeof(unsigned char));
327 memcpy(binary->rodata, section_data->d_buf, binary->rodata_size);
331 parse_symbol_table(symbols, &section_header, binary);
334 binary->reloc_count = section_header.sh_size /
339 parse_relocs(elf, relocs, symbols, symbol_sh_link, binary);
347 if (binary->global_symbol_count) {
348 binary->config_size_per_symbol =
349 binary->config_size / binary->global_symbol_count;
351 binary->global_symbol_count = 1;
352 binary->config_size_per_symbol = binary->config_size;
357 const struct r600_shader_binary *binary,
361 for (i = 0; i < binary->global_symbol_count; ++i) {
362 if (binary->global_symbol_offsets[i] == symbol_offset) {
363 unsigned offset = i * binary->config_size_per_symbol;
364 return binary->config + offset;
367 return binary->config;
370 static void r600_shader_binary_read_config(const struct r600_shader_binary *binary,
377 r600_shader_binary_config_start(binary, symbol_offset);
379 for (i = 0; i < binary->config_size_per_symbol; i+= 8) {
406 const struct r600_shader_binary *binary,
410 assert(binary->code_size % 4 == 0);
411 bc->bytecode = CALLOC(1, binary->code_size);
412 memcpy(bc->bytecode, binary->code, binary->code_size);
413 bc->ndw = binary->code_size / 4;
415 r600_shader_binary_read_config(binary, bc, 0, use_kill);
459 radeon_shader_binary_init(&shader->binary);
460 r600_elf_read(header->blob, header->num_bytes, &shader->binary);
461 r600_create_shader(&shader->bc, &shader->binary, &use_kill);
492 radeon_shader_binary_clean(&shader->binary);
938 r600_shader_binary_read_config(&shader->binary, &shader->bc,