static int fetch_data (struct disassemble_info *info, int nibble) { unsigned char mybuf[20]; int status; instr_data_s *priv = (instr_data_s *) info->private_data; if ((nibble % 4) != 0) abort (); status = (*info->read_memory_func) (priv->insn_start, (bfd_byte *) mybuf, nibble / 2, info); if (status != 0) { (*info->memory_error_func) (status, priv->insn_start, info); OPCODES_SIGLONGJMP (priv->bailout, 1); } { int i; unsigned char *p = mybuf; for (i = 0; i < nibble;) { priv->words[i] = (p[0] << 8) | p[1]; priv->bytes[i] = *p; priv->nibbles[i++] = *p >> 4; priv->nibbles[i++] = *p & 0xf; ++p; priv->bytes[i] = *p; priv->nibbles[i++] = *p >> 4; priv->nibbles[i++] = *p & 0xf; ++p; } } priv->max_fetched = nibble; return 1; }
static int fetch_data (struct disassemble_info *info, bfd_vma memaddr) { int length, status = 0; struct dis_private *priv = (struct dis_private *) info->private_data; int insn_size = xtensa_isa_maxlength (xtensa_default_isa); /* Read the maximum instruction size, padding with zeros if we go past the end of the text section. This code will automatically adjust length when we hit the end of the buffer. */ memset (priv->byte_buf, 0, insn_size); for (length = insn_size; length > 0; length--) { status = (*info->read_memory_func) (memaddr, priv->byte_buf, length, info); if (status == 0) return length; } (*info->memory_error_func) (status, memaddr, info); OPCODES_SIGLONGJMP (priv->bailout, 1); /*NOTREACHED*/ }