Rizin
unix-like reverse engineering framework and cli tools
xtensa-isa.c
Go to the documentation of this file.
1 /* Configurable Xtensa ISA support.
2  Copyright (C) 2003-2015 Free Software Foundation, Inc.
3 
4  This file is part of BFD, the Binary File Descriptor library.
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 3 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program; if not, write to the Free Software
18  Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
19  MA 02110-1301, USA. */
20 
21 
22 #include <stdio.h>
23 #include <string.h>
24 #include <stdlib.h>
25 #include <rz_util.h>
26 
27 #include "../../include/disas-asm.h"
28 #include "../../include/sysdep.h"
29 //#include "bfd.h"
30 //#include "libbfd.h"
31 #include "../../include/xtensa-isa.h"
32 #include "../../include/xtensa-isa-internal.h"
33 
34 extern int filename_cmp (const char *s1, const char *s2);
36 char xtisa_error_msg[1024];
37 
38 
41 {
42  return xtisa_errno;
43 }
44 
45 
46 char *
48 {
49  return xtisa_error_msg;
50 }
51 
52 
53 #define CHECK_ALLOC(MEM,ERRVAL) \
54  do { \
55  if ((MEM) == 0) \
56  { \
57  xtisa_errno = xtensa_isa_out_of_memory; \
58  strcpy (xtisa_error_msg, "out of memory"); \
59  return (ERRVAL); \
60  } \
61  } while (0)
62 
63 #define CHECK_ALLOC_FOR_INIT(MEM,ERRVAL,ERRNO_P,ERROR_MSG_P) \
64  do { \
65  if ((MEM) == 0) \
66  { \
67  xtisa_errno = xtensa_isa_out_of_memory; \
68  strcpy (xtisa_error_msg, "out of memory"); \
69  if (ERRNO_P) *(ERRNO_P) = xtisa_errno; \
70  if (ERROR_MSG_P) *(ERROR_MSG_P) = xtisa_error_msg; \
71  return (ERRVAL); \
72  } \
73  } while (0)
74 
75 
76 ␌
77 /* Instruction buffers. */
78 
79 int
81 {
82  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
83  return intisa->insnbuf_size;
84 }
85 
86 
89 {
92  CHECK_ALLOC (result, 0);
93  return result;
94 }
95 
96 
97 void
100 {
101  free (buf);
102 }
103 
104 
105 /* Given <byte_index>, the index of a byte in a xtensa_insnbuf, our
106  internal representation of a xtensa instruction word, return the index of
107  its word and the bit index of its low order byte in the xtensa_insnbuf. */
108 
109 static inline int
110 byte_to_word_index (int byte_index)
111 {
112  return byte_index / sizeof (xtensa_insnbuf_word);
113 }
114 
115 
116 static inline int
117 byte_to_bit_index (int byte_index)
118 {
119  return (byte_index & 0x3) * 8;
120 }
121 
122 
123 /* Copy an instruction in the 32-bit words pointed at by "insn" to
124  characters pointed at by "cp". This is more complicated than you
125  might think because we want 16-bit instructions in bytes 2 & 3 for
126  big-endian configurations. This function allows us to specify
127  which byte in "insn" to start with and which way to increment,
128  allowing trivial implementation for both big- and little-endian
129  configurations....and it seems to make pretty good code for
130  both. */
131 
132 int
134  const xtensa_insnbuf insn,
135  unsigned char *cp,
136  int num_chars)
137 {
138  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
139  int insn_size = xtensa_isa_maxlength (isa);
140  int fence_post, start, increment, i, byte_count;
141  xtensa_format fmt;
142 
143  if (num_chars == 0) {
144  num_chars = insn_size;
145  }
146 
147  if (intisa->is_big_endian)
148  {
149  start = insn_size - 1;
150  increment = -1;
151  }
152  else
153  {
154  start = 0;
155  increment = 1;
156  }
157 
158  /* Find the instruction format. Do nothing if the buffer does not contain
159  a valid instruction since we need to know how many bytes to copy. */
160  fmt = xtensa_format_decode (isa, insn);
161  if (fmt == XTENSA_UNDEFINED) {
162  return XTENSA_UNDEFINED;
163  }
164 
165  byte_count = xtensa_format_length (isa, fmt);
166  if (byte_count == XTENSA_UNDEFINED) {
167  return XTENSA_UNDEFINED;
168  }
169 
170  if (byte_count > num_chars)
171  {
173  strcpy (xtisa_error_msg, "output buffer too small for instruction");
174  return XTENSA_UNDEFINED;
175  }
176 
177  fence_post = start + (byte_count * increment);
178 
179  for (i = start; i != fence_post; i += increment, ++cp)
180  {
181  int word_inx = byte_to_word_index (i);
182  int bit_inx = byte_to_bit_index (i);
183 
184  *cp = (insn[word_inx] >> bit_inx) & 0xff;
185  }
186 
187  return byte_count;
188 }
189 
190 
191 /* Inward conversion from byte stream to xtensa_insnbuf. See
192  xtensa_insnbuf_to_chars for a discussion of why this is complicated
193  by endianness. */
194 
195 void
197  xtensa_insnbuf insn,
198  const unsigned char *cp,
199  int num_chars)
200 {
201  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
202  int max_size, insn_size, fence_post, start, increment, i;
203 
204  max_size = xtensa_isa_maxlength (isa);
205 
206  /* Decode the instruction length so we know how many bytes to read. */
207  insn_size = (intisa->length_decode_fn) (cp);
208  if (insn_size == XTENSA_UNDEFINED)
209  {
210  /* This should never happen when the byte stream contains a
211  valid instruction. Just read the maximum number of bytes.... */
212  insn_size = max_size;
213  }
214 
215  if (num_chars == 0 || num_chars > insn_size) {
216  num_chars = insn_size;
217  }
218 
219  if (intisa->is_big_endian) {
220  start = max_size - 1;
221  increment = -1;
222  }
223  else
224  {
225  start = 0;
226  increment = 1;
227  }
228 
229  fence_post = start + (num_chars * increment);
230  memset (insn, 0, xtensa_insnbuf_size (isa) * sizeof (xtensa_insnbuf_word));
231 
232  for (i = start; i != fence_post; i += increment, ++cp)
233  {
234  int word_inx = byte_to_word_index (i);
235  int bit_inx = byte_to_bit_index (i);
236 
237  insn[word_inx] |= (*cp & 0xff) << bit_inx;
238  }
239 }
240 
241 
242 ␌
243 /* ISA information. */
244 
246 
248 xtensa_isa_init (xtensa_isa_status *errno_p, char **error_msg_p)
249 {
251  int n, is_user;
252 
253  /* Set up the opcode name lookup table. */
254  isa->opname_lookup_table =
255  bfd_malloc (isa->num_opcodes * sizeof (xtensa_lookup_entry));
256  CHECK_ALLOC_FOR_INIT (isa->opname_lookup_table, NULL, errno_p, error_msg_p);
257  for (n = 0; n < isa->num_opcodes; n++)
258  {
259  isa->opname_lookup_table[n].key = isa->opcodes[n].name;
260  isa->opname_lookup_table[n].u.opcode = n;
261  }
264 
265  /* Set up the state name lookup table. */
266  isa->state_lookup_table =
267  bfd_malloc (isa->num_states * sizeof (xtensa_lookup_entry));
268  CHECK_ALLOC_FOR_INIT (isa->state_lookup_table, NULL, errno_p, error_msg_p);
269  for (n = 0; n < isa->num_states; n++)
270  {
271  isa->state_lookup_table[n].key = isa->states[n].name;
272  isa->state_lookup_table[n].u.state = n;
273  }
274  qsort (isa->state_lookup_table, isa->num_states,
276 
277  /* Set up the sysreg name lookup table. */
278  isa->sysreg_lookup_table =
279  bfd_malloc (isa->num_sysregs * sizeof (xtensa_lookup_entry));
280  CHECK_ALLOC_FOR_INIT (isa->sysreg_lookup_table, NULL, errno_p, error_msg_p);
281  for (n = 0; n < isa->num_sysregs; n++)
282  {
283  isa->sysreg_lookup_table[n].key = isa->sysregs[n].name;
284  isa->sysreg_lookup_table[n].u.sysreg = n;
285  }
288 
289  /* Set up the user & system sysreg number tables. */
290  for (is_user = 0; is_user < 2; is_user++)
291  {
292  isa->sysreg_table[is_user] =
293  bfd_malloc ((isa->max_sysreg_num[is_user] + 1)
294  * sizeof (xtensa_sysreg));
295  CHECK_ALLOC_FOR_INIT (isa->sysreg_table[is_user], NULL,
296  errno_p, error_msg_p);
297 
298  for (n = 0; n <= isa->max_sysreg_num[is_user]; n++) {
299  isa->sysreg_table[is_user][n] = XTENSA_UNDEFINED;
300  }
301  }
302  for (n = 0; n < isa->num_sysregs; n++)
303  {
304  xtensa_sysreg_internal *sreg = &isa->sysregs[n];
305  is_user = sreg->is_user;
306 
307  isa->sysreg_table[is_user][sreg->number] = n;
308  }
309 
310  /* Set up the interface lookup table. */
312  calloc (isa->num_interfaces, sizeof (xtensa_lookup_entry));
314  error_msg_p);
315  for (n = 0; n < isa->num_interfaces; n++)
316  {
318  isa->interface_lookup_table[n].u.intf = n;
319  }
322 
323  /* Set up the funcUnit lookup table. */
324  isa->funcUnit_lookup_table =
325  bfd_malloc (isa->num_funcUnits * sizeof (xtensa_lookup_entry));
327  error_msg_p);
328  for (n = 0; n < isa->num_funcUnits; n++)
329  {
330  isa->funcUnit_lookup_table[n].key = isa->funcUnits[n].name;
331  isa->funcUnit_lookup_table[n].u.fun = n;
332  }
335 
336  isa->insnbuf_size = ((isa->insn_size + sizeof (xtensa_insnbuf_word) - 1) /
337  sizeof (xtensa_insnbuf_word));
338 
339  return (xtensa_isa) isa;
340 }
341 
342 
343 void
345 {
346  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
347  int n;
348 
349  /* With this version of the code, the xtensa_isa structure is not
350  dynamically allocated, so this function is not essential. Free
351  the memory allocated by xtensa_isa_init and restore the xtensa_isa
352  structure to its initial state. */
353 
354  if (intisa->opname_lookup_table)
355  {
356  free (intisa->opname_lookup_table);
357  intisa->opname_lookup_table = 0;
358  }
359 
360  if (intisa->state_lookup_table)
361  {
362  free (intisa->state_lookup_table);
363  intisa->state_lookup_table = 0;
364  }
365 
366  if (intisa->sysreg_lookup_table)
367  {
368  free (intisa->sysreg_lookup_table);
369  intisa->sysreg_lookup_table = 0;
370  }
371  for (n = 0; n < 2; n++)
372  {
373  if (intisa->sysreg_table[n])
374  {
375  free (intisa->sysreg_table[n]);
376  intisa->sysreg_table[n] = 0;
377  }
378  }
379 
380  if (intisa->interface_lookup_table)
381  {
382  free (intisa->interface_lookup_table);
383  intisa->interface_lookup_table = 0;
384  }
385 
386  if (intisa->funcUnit_lookup_table)
387  {
388  free (intisa->funcUnit_lookup_table);
389  intisa->funcUnit_lookup_table = 0;
390  }
391 }
392 
393 
394 int
395 xtensa_isa_name_compare (const void *v1, const void *v2)
396 {
399 
400  return rz_str_casecmp (e1->key, e2->key);
401 }
402 
403 
404 int
406 {
407  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
408  return intisa->insn_size;
409 }
410 
411 
412 int
413 xtensa_isa_length_from_chars (xtensa_isa isa, const unsigned char *cp)
414 {
415  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
416  return (intisa->length_decode_fn) (cp);
417 }
418 
419 
420 int
422 {
423  xtensa_opcode opcode;
424  xtensa_funcUnit_use *use;
425  int num_opcodes, num_uses;
426  int i, stage;
427  static int max_stage = XTENSA_UNDEFINED;
428 
429  /* Only compute the value once. */
430  if (max_stage != XTENSA_UNDEFINED) {
431  return max_stage + 1;
432  }
433 
434  num_opcodes = xtensa_isa_num_opcodes (isa);
435  for (opcode = 0; opcode < num_opcodes; opcode++)
436  {
437  num_uses = xtensa_opcode_num_funcUnit_uses (isa, opcode);
438  for (i = 0; i < num_uses; i++)
439  {
440  use = xtensa_opcode_funcUnit_use (isa, opcode, i);
441  stage = use->stage;
442  if (stage > max_stage) {
443  max_stage = stage;
444  }
445  }
446  }
447 
448  return max_stage + 1;
449 }
450 
451 
452 int
454 {
455  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
456  return intisa->num_formats;
457 }
458 
459 
460 int
462 {
463  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
464  return intisa->num_opcodes;
465 }
466 
467 
468 int
470 {
471  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
472  return intisa->num_regfiles;
473 }
474 
475 
476 int
478 {
479  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
480  return intisa->num_states;
481 }
482 
483 
484 int
486 {
487  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
488  return intisa->num_sysregs;
489 }
490 
491 
492 int
494 {
495  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
496  return intisa->num_interfaces;
497 }
498 
499 
500 int
502 {
503  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
504  return intisa->num_funcUnits;
505 }
506 
507 
508 ␌
509 /* Instruction formats. */
510 
511 
512 #define CHECK_FORMAT(INTISA,FMT,ERRVAL) \
513  do { \
514  if ((FMT) < 0 || (FMT) >= (INTISA)->num_formats) \
515  { \
516  xtisa_errno = xtensa_isa_bad_format; \
517  strcpy (xtisa_error_msg, "invalid format specifier"); \
518  return (ERRVAL); \
519  } \
520  } while (0)
521 
522 
523 #define CHECK_SLOT(INTISA,FMT,SLOT,ERRVAL) \
524  do { \
525  if ((SLOT) < 0 || (SLOT) >= (INTISA)->formats[FMT].num_slots) \
526  { \
527  xtisa_errno = xtensa_isa_bad_slot; \
528  strcpy (xtisa_error_msg, "invalid slot specifier"); \
529  return (ERRVAL); \
530  } \
531  } while (0)
532 
533 
534 const char *
536 {
537  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
538  CHECK_FORMAT (intisa, fmt, NULL);
539  return intisa->formats[fmt].name;
540 }
541 
542 
544 xtensa_format_lookup (xtensa_isa isa, const char *fmtname)
545 {
546  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
547  int fmt;
548 
549  if (!fmtname || !*fmtname)
550  {
552  strcpy (xtisa_error_msg, "invalid format name");
553  return XTENSA_UNDEFINED;
554  }
555 
556  for (fmt = 0; fmt < intisa->num_formats; fmt++)
557  {
558  if (rz_str_casecmp (fmtname, intisa->formats[fmt].name) == 0) {
559  return fmt;
560  }
561  }
562 
564  sprintf (xtisa_error_msg, "format \"%s\" not recognized", fmtname);
565  return XTENSA_UNDEFINED;
566 }
567 
568 
571 {
572  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
573  xtensa_format fmt;
574 
575  fmt = (intisa->format_decode_fn) (insn);
576  if (fmt != XTENSA_UNDEFINED) {
577  return fmt;
578  }
579 
581  strcpy (xtisa_error_msg, "cannot decode instruction format");
582  return XTENSA_UNDEFINED;
583 }
584 
585 
586 int
588 {
589  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
590  CHECK_FORMAT (intisa, fmt, -1);
591  (*intisa->formats[fmt].encode_fn) (insn);
592  return 0;
593 }
594 
595 
596 int
598 {
599  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
600  CHECK_FORMAT (intisa, fmt, XTENSA_UNDEFINED);
601  return intisa->formats[fmt].length;
602 }
603 
604 
605 int
607 {
608  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
609  CHECK_FORMAT (intisa, fmt, XTENSA_UNDEFINED);
610  return intisa->formats[fmt].num_slots;
611 }
612 
613 
616 {
617  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
618  int slot_id;
619 
620  CHECK_FORMAT (intisa, fmt, XTENSA_UNDEFINED);
621  CHECK_SLOT (intisa, fmt, slot, XTENSA_UNDEFINED);
622 
623  slot_id = intisa->formats[fmt].slot_id[slot];
624  return xtensa_opcode_lookup (isa, intisa->slots[slot_id].nop_name);
625 }
626 
627 
628 int
630  const xtensa_insnbuf insn, xtensa_insnbuf slotbuf)
631 {
632  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
633  int slot_id;
634 
635  CHECK_FORMAT (intisa, fmt, -1);
636  CHECK_SLOT (intisa, fmt, slot, -1);
637 
638  slot_id = intisa->formats[fmt].slot_id[slot];
639  (*intisa->slots[slot_id].get_fn) (insn, slotbuf);
640  return 0;
641 }
642 
643 
644 int
646  xtensa_insnbuf insn, const xtensa_insnbuf slotbuf)
647 {
648  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
649  int slot_id;
650 
651  CHECK_FORMAT (intisa, fmt, -1);
652  CHECK_SLOT (intisa, fmt, slot, -1);
653 
654  slot_id = intisa->formats[fmt].slot_id[slot];
655  (*intisa->slots[slot_id].set_fn) (insn, slotbuf);
656  return 0;
657 }
658 
659 
660 ␌
661 /* Opcode information. */
662 
663 
664 #define CHECK_OPCODE(INTISA,OPC,ERRVAL) \
665  do { \
666  if ((OPC) < 0 || (OPC) >= (INTISA)->num_opcodes) \
667  { \
668  xtisa_errno = xtensa_isa_bad_opcode; \
669  strcpy (xtisa_error_msg, "invalid opcode specifier"); \
670  return (ERRVAL); \
671  } \
672  } while (0)
673 
674 
676 xtensa_opcode_lookup (xtensa_isa isa, const char *opname)
677 {
678  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
679  xtensa_lookup_entry entry, *result = 0;
680 
681  if (!opname || !*opname)
682  {
684  strcpy (xtisa_error_msg, "invalid opcode name");
685  return XTENSA_UNDEFINED;
686  }
687 
688  if (intisa->num_opcodes != 0)
689  {
690  entry.key = opname;
691  result = bsearch (&entry, intisa->opname_lookup_table,
692  intisa->num_opcodes, sizeof (xtensa_lookup_entry),
694  }
695 
696  if (!result)
697  {
699  sprintf (xtisa_error_msg, "opcode \"%s\" not recognized", opname);
700  return XTENSA_UNDEFINED;
701  }
702 
703  return result->u.opcode;
704 }
705 
706 
709  const xtensa_insnbuf slotbuf)
710 {
711  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
712  int slot_id;
714 
715  CHECK_FORMAT (intisa, fmt, XTENSA_UNDEFINED);
716  CHECK_SLOT (intisa, fmt, slot, XTENSA_UNDEFINED);
717 
718  slot_id = intisa->formats[fmt].slot_id[slot];
719 
720  opc = (intisa->slots[slot_id].opcode_decode_fn) (slotbuf);
721  if (opc != XTENSA_UNDEFINED) {
722  return opc;
723  }
724 
726  strcpy (xtisa_error_msg, "cannot decode opcode");
727  return XTENSA_UNDEFINED;
728 }
729 
730 
731 int
734 {
735  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
736  int slot_id;
737  xtensa_opcode_encode_fn encode_fn;
738 
739  CHECK_FORMAT (intisa, fmt, -1);
740  CHECK_SLOT (intisa, fmt, slot, -1);
741  CHECK_OPCODE (intisa, opc, -1);
742 
743  slot_id = intisa->formats[fmt].slot_id[slot];
744  encode_fn = intisa->opcodes[opc].encode_fns[slot_id];
745  if (!encode_fn)
746  {
749  "opcode \"%s\" is not allowed in slot %d of format \"%s\"",
750  intisa->opcodes[opc].name, slot, intisa->formats[fmt].name);
751  return -1;
752  }
753  (*encode_fn) (slotbuf);
754  return 0;
755 }
756 
757 
758 const char *
760 {
761  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
762  CHECK_OPCODE (intisa, opc, NULL);
763  return intisa->opcodes[opc].name;
764 }
765 
766 
767 int
769 {
770  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
771  CHECK_OPCODE (intisa, opc, XTENSA_UNDEFINED);
772  if ((intisa->opcodes[opc].flags & XTENSA_OPCODE_IS_BRANCH) != 0) {
773  return 1;
774  }
775  return 0;
776 }
777 
778 
779 int
781 {
782  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
783  CHECK_OPCODE (intisa, opc, XTENSA_UNDEFINED);
784  if ((intisa->opcodes[opc].flags & XTENSA_OPCODE_IS_JUMP) != 0) {
785  return 1;
786  }
787  return 0;
788 }
789 
790 
791 int
793 {
794  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
795  CHECK_OPCODE (intisa, opc, XTENSA_UNDEFINED);
796  if ((intisa->opcodes[opc].flags & XTENSA_OPCODE_IS_LOOP) != 0) {
797  return 1;
798  }
799  return 0;
800 }
801 
802 
803 int
805 {
806  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
807  CHECK_OPCODE (intisa, opc, XTENSA_UNDEFINED);
808  if ((intisa->opcodes[opc].flags & XTENSA_OPCODE_IS_CALL) != 0) {
809  return 1;
810  }
811  return 0;
812 }
813 
814 
815 int
817 {
818  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
819  int iclass_id;
820 
821  CHECK_OPCODE (intisa, opc, XTENSA_UNDEFINED);
822  iclass_id = intisa->opcodes[opc].iclass_id;
823  return intisa->iclasses[iclass_id].num_operands;
824 }
825 
826 
827 int
829 {
830  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
831  int iclass_id;
832 
833  CHECK_OPCODE (intisa, opc, XTENSA_UNDEFINED);
834  iclass_id = intisa->opcodes[opc].iclass_id;
835  return intisa->iclasses[iclass_id].num_stateOperands;
836 }
837 
838 
839 int
841 {
842  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
843  int iclass_id;
844 
845  CHECK_OPCODE (intisa, opc, XTENSA_UNDEFINED);
846  iclass_id = intisa->opcodes[opc].iclass_id;
847  return intisa->iclasses[iclass_id].num_interfaceOperands;
848 }
849 
850 
851 int
853 {
854  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
855  CHECK_OPCODE (intisa, opc, XTENSA_UNDEFINED);
856  return intisa->opcodes[opc].num_funcUnit_uses;
857 }
858 
859 
862 {
863  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
864  CHECK_OPCODE (intisa, opc, NULL);
865  if (u < 0 || u >= intisa->opcodes[opc].num_funcUnit_uses)
866  {
868  sprintf (xtisa_error_msg, "invalid functional unit use number (%d); "
869  "opcode \"%s\" has %d", u, intisa->opcodes[opc].name,
870  intisa->opcodes[opc].num_funcUnit_uses);
871  return NULL;
872  }
873  return &intisa->opcodes[opc].funcUnit_uses[u];
874 }
875 
876 
877 ␌
878 /* Operand information. */
879 
880 
881 #define CHECK_OPERAND(INTISA,OPC,ICLASS,OPND,ERRVAL) \
882  do { \
883  if ((OPND) < 0 || (OPND) >= (ICLASS)->num_operands) \
884  { \
885  xtisa_errno = xtensa_isa_bad_operand; \
886  sprintf (xtisa_error_msg, "invalid operand number (%d); " \
887  "opcode \"%s\" has %d operands", (OPND), \
888  (INTISA)->opcodes[(OPC)].name, (ICLASS)->num_operands); \
889  return (ERRVAL); \
890  } \
891  } while (0)
892 
893 
896 {
897  xtensa_iclass_internal *iclass;
898  int iclass_id, operand_id;
899 
900  CHECK_OPCODE (intisa, opc, NULL);
901  iclass_id = intisa->opcodes[opc].iclass_id;
902  iclass = &intisa->iclasses[iclass_id];
903  CHECK_OPERAND (intisa, opc, iclass, opnd, NULL);
904  operand_id = iclass->operands[opnd].u.operand_id;
905  return &intisa->operands[operand_id];
906 }
907 
908 
909 const char *
911 {
912  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
914 
915  intop = get_operand (intisa, opc, opnd);
916  if (!intop) {
917  return NULL;
918  }
919  return intop->name;
920 }
921 
922 
923 int
925 {
926  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
927  xtensa_iclass_internal *iclass;
928  int iclass_id, operand_id;
930 
931  CHECK_OPCODE (intisa, opc, XTENSA_UNDEFINED);
932  iclass_id = intisa->opcodes[opc].iclass_id;
933  iclass = &intisa->iclasses[iclass_id];
934  CHECK_OPERAND (intisa, opc, iclass, opnd, XTENSA_UNDEFINED);
935 
936  /* Special case for "sout" operands. */
937  if (iclass->operands[opnd].inout == 's') {
938  return 0;
939  }
940 
941  operand_id = iclass->operands[opnd].u.operand_id;
942  intop = &intisa->operands[operand_id];
943 
944  if ((intop->flags & XTENSA_OPERAND_IS_INVISIBLE) == 0) {
945  return 1;
946  }
947  return 0;
948 }
949 
950 
951 char
953 {
954  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
955  xtensa_iclass_internal *iclass;
956  int iclass_id;
957  char inout;
958 
959  CHECK_OPCODE (intisa, opc, 0);
960  iclass_id = intisa->opcodes[opc].iclass_id;
961  iclass = &intisa->iclasses[iclass_id];
962  CHECK_OPERAND (intisa, opc, iclass, opnd, 0);
963  inout = iclass->operands[opnd].inout;
964 
965  /* Special case for "sout" operands. */
966  if (inout == 's') {
967  return 'o';
968  }
969 
970  return inout;
971 }
972 
973 
974 int
976  xtensa_format fmt, int slot,
977  const xtensa_insnbuf slotbuf, uint32 *valp)
978 {
979  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
981  int slot_id;
982  xtensa_get_field_fn get_fn;
983 
984  intop = get_operand (intisa, opc, opnd);
985  if (!intop) {
986  return -1;
987  }
988 
989  CHECK_FORMAT (intisa, fmt, -1);
990  CHECK_SLOT (intisa, fmt, slot, -1);
991 
992  slot_id = intisa->formats[fmt].slot_id[slot];
993  if (intop->field_id == XTENSA_UNDEFINED)
994  {
996  strcpy (xtisa_error_msg, "implicit operand has no field");
997  return -1;
998  }
999  get_fn = intisa->slots[slot_id].get_field_fns[intop->field_id];
1000  if (!get_fn)
1001  {
1004  "operand \"%s\" does not exist in slot %d of format \"%s\"",
1005  intop->name, slot, intisa->formats[fmt].name);
1006  return -1;
1007  }
1008  *valp = (*get_fn) (slotbuf);
1009  return 0;
1010 }
1011 
1012 
1013 int
1015  xtensa_format fmt, int slot,
1016  xtensa_insnbuf slotbuf, uint32 val)
1017 {
1018  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
1019  xtensa_operand_internal *intop;
1020  int slot_id;
1021  xtensa_set_field_fn set_fn;
1022 
1023  intop = get_operand (intisa, opc, opnd);
1024  if (!intop) {
1025  return -1;
1026  }
1027 
1028  CHECK_FORMAT (intisa, fmt, -1);
1029  CHECK_SLOT (intisa, fmt, slot, -1);
1030 
1031  slot_id = intisa->formats[fmt].slot_id[slot];
1032  if (intop->field_id == XTENSA_UNDEFINED)
1033  {
1035  strcpy (xtisa_error_msg, "implicit operand has no field");
1036  return -1;
1037  }
1038  set_fn = intisa->slots[slot_id].set_field_fns[intop->field_id];
1039  if (!set_fn)
1040  {
1043  "operand \"%s\" does not exist in slot %d of format \"%s\"",
1044  intop->name, slot, intisa->formats[fmt].name);
1045  return -1;
1046  }
1047  (*set_fn) (slotbuf, val);
1048  return 0;
1049 }
1050 
1051 
1052 int
1054  uint32 *valp)
1055 {
1056  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
1057  xtensa_operand_internal *intop;
1058  uint32 test_val, orig_val;
1059 
1060  intop = get_operand (intisa, opc, opnd);
1061  if (!intop) {
1062  return -1;
1063  }
1064 
1065  if (!intop->encode)
1066  {
1067  /* This is a default operand for a field. How can we tell if the
1068  value fits in the field? Write the value into the field,
1069  read it back, and then make sure we get the same value. */
1070  static xtensa_insnbuf tmpbuf = 0;
1071  int slot_id;
1072 
1073  if (!tmpbuf)
1074  {
1075  tmpbuf = xtensa_insnbuf_alloc (isa);
1076  CHECK_ALLOC (tmpbuf, -1);
1077  }
1078 
1079  /* A default operand is always associated with a field,
1080  but check just to be sure.... */
1081  if (intop->field_id == XTENSA_UNDEFINED)
1082  {
1084  strcpy (xtisa_error_msg, "operand has no field");
1085  return -1;
1086  }
1087 
1088  /* Find some slot that includes the field. */
1089  for (slot_id = 0; slot_id < intisa->num_slots; slot_id++)
1090  {
1091  xtensa_get_field_fn get_fn =
1092  intisa->slots[slot_id].get_field_fns[intop->field_id];
1093  xtensa_set_field_fn set_fn =
1094  intisa->slots[slot_id].set_field_fns[intop->field_id];
1095 
1096  if (get_fn && set_fn)
1097  {
1098  (*set_fn) (tmpbuf, *valp);
1099  return ((*get_fn) (tmpbuf) != *valp);
1100  }
1101  }
1102 
1103  /* Couldn't find any slot containing the field.... */
1105  strcpy (xtisa_error_msg, "field does not exist in any slot");
1106  return -1;
1107  }
1108 
1109  /* Encode the value. In some cases, the encoding function may detect
1110  errors, but most of the time the only way to determine if the value
1111  was successfully encoded is to decode it and check if it matches
1112  the original value. */
1113  orig_val = *valp;
1114  if ((*intop->encode) (valp)
1115  || (test_val = *valp, (*intop->decode) (&test_val))
1116  || test_val != orig_val)
1117  {
1119  sprintf (xtisa_error_msg, "cannot encode operand value 0x%08x", *valp);
1120  return -1;
1121  }
1122 
1123  return 0;
1124 }
1125 
1126 
1127 int
1129  uint32 *valp)
1130 {
1131  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
1132  xtensa_operand_internal *intop;
1133 
1134  intop = get_operand (intisa, opc, opnd);
1135  if (!intop) {
1136  return -1;
1137  }
1138 
1139  /* Use identity function for "default" operands. */
1140  if (!intop->decode) {
1141  return 0;
1142  }
1143 
1144  if ((*intop->decode) (valp))
1145  {
1147  sprintf (xtisa_error_msg, "cannot decode operand value 0x%08x", *valp);
1148  return -1;
1149  }
1150  return 0;
1151 }
1152 
1153 
1154 int
1156 {
1157  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
1158  xtensa_operand_internal *intop;
1159 
1160  intop = get_operand (intisa, opc, opnd);
1161  if (!intop) {
1162  return XTENSA_UNDEFINED;
1163  }
1164 
1165  if ((intop->flags & XTENSA_OPERAND_IS_REGISTER) != 0) {
1166  return 1;
1167  }
1168  return 0;
1169 }
1170 
1171 
1174 {
1175  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
1176  xtensa_operand_internal *intop;
1177 
1178  intop = get_operand (intisa, opc, opnd);
1179  if (!intop) {
1180  return XTENSA_UNDEFINED;
1181  }
1182 
1183  return intop->regfile;
1184 }
1185 
1186 
1187 int
1189 {
1190  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
1191  xtensa_operand_internal *intop;
1192 
1193  intop = get_operand (intisa, opc, opnd);
1194  if (!intop) {
1195  return XTENSA_UNDEFINED;
1196  }
1197 
1198  return intop->num_regs;
1199 }
1200 
1201 
1202 int
1204 {
1205  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
1206  xtensa_operand_internal *intop;
1207 
1208  intop = get_operand (intisa, opc, opnd);
1209  if (!intop) {
1210  return XTENSA_UNDEFINED;
1211  }
1212 
1213  if ((intop->flags & XTENSA_OPERAND_IS_UNKNOWN) == 0) {
1214  return 1;
1215  }
1216  return 0;
1217 }
1218 
1219 
1220 int
1222 {
1223  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
1224  xtensa_operand_internal *intop;
1225 
1226  intop = get_operand (intisa, opc, opnd);
1227  if (!intop) {
1228  return XTENSA_UNDEFINED;
1229  }
1230 
1231  if ((intop->flags & XTENSA_OPERAND_IS_PCRELATIVE) != 0) {
1232  return 1;
1233  }
1234  return 0;
1235 }
1236 
1237 
1238 int
1240  uint32 *valp, uint32 pc)
1241 {
1242  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
1243  xtensa_operand_internal *intop;
1244 
1245  intop = get_operand (intisa, opc, opnd);
1246  if (!intop) {
1247  return -1;
1248  }
1249 
1250  if ((intop->flags & XTENSA_OPERAND_IS_PCRELATIVE) == 0) {
1251  return 0;
1252  }
1253 
1254  if (!intop->do_reloc)
1255  {
1257  strcpy (xtisa_error_msg, "operand missing do_reloc function");
1258  return -1;
1259  }
1260 
1261  if ((*intop->do_reloc) (valp, pc))
1262  {
1265  "do_reloc failed for value 0x%08x at PC 0x%08x", *valp, pc);
1266  return -1;
1267  }
1268 
1269  return 0;
1270 }
1271 
1272 
1273 int
1275  uint32 *valp, uint32 pc)
1276 {
1277  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
1278  xtensa_operand_internal *intop;
1279 
1280  intop = get_operand (intisa, opc, opnd);
1281  if (!intop) {
1282  return -1;
1283  }
1284 
1285  if ((intop->flags & XTENSA_OPERAND_IS_PCRELATIVE) == 0) {
1286  return 0;
1287  }
1288 
1289  if (!intop->undo_reloc)
1290  {
1292  strcpy (xtisa_error_msg, "operand missing undo_reloc function");
1293  return -1;
1294  }
1295 
1296  if ((*intop->undo_reloc) (valp, pc))
1297  {
1300  "undo_reloc failed for value 0x%08x at PC 0x%08x", *valp, pc);
1301  return -1;
1302  }
1303 
1304  return 0;
1305 }
1306 
1307 
1308 ␌
1309 /* State Operands. */
1310 
1311 
1312 #define CHECK_STATE_OPERAND(INTISA,OPC,ICLASS,STOP,ERRVAL) \
1313  do { \
1314  if ((STOP) < 0 || (STOP) >= (ICLASS)->num_stateOperands) \
1315  { \
1316  xtisa_errno = xtensa_isa_bad_operand; \
1317  sprintf (xtisa_error_msg, "invalid state operand number (%d); " \
1318  "opcode \"%s\" has %d state operands", (STOP), \
1319  (INTISA)->opcodes[(OPC)].name, (ICLASS)->num_stateOperands); \
1320  return (ERRVAL); \
1321  } \
1322  } while (0)
1323 
1324 
1327 {
1328  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
1329  xtensa_iclass_internal *iclass;
1330  int iclass_id;
1331 
1332  CHECK_OPCODE (intisa, opc, XTENSA_UNDEFINED);
1333  iclass_id = intisa->opcodes[opc].iclass_id;
1334  iclass = &intisa->iclasses[iclass_id];
1335  CHECK_STATE_OPERAND (intisa, opc, iclass, stOp, XTENSA_UNDEFINED);
1336  return iclass->stateOperands[stOp].u.state;
1337 }
1338 
1339 
1340 char
1342 {
1343  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
1344  xtensa_iclass_internal *iclass;
1345  int iclass_id;
1346 
1347  CHECK_OPCODE (intisa, opc, 0);
1348  iclass_id = intisa->opcodes[opc].iclass_id;
1349  iclass = &intisa->iclasses[iclass_id];
1350  CHECK_STATE_OPERAND (intisa, opc, iclass, stOp, 0);
1351  return iclass->stateOperands[stOp].inout;
1352 }
1353 
1354 
1355 ␌
1356 /* Interface Operands. */
1357 
1358 
1359 #define CHECK_INTERFACE_OPERAND(INTISA,OPC,ICLASS,IFOP,ERRVAL) \
1360  do { \
1361  if ((IFOP) < 0 || (IFOP) >= (ICLASS)->num_interfaceOperands) \
1362  { \
1363  xtisa_errno = xtensa_isa_bad_operand; \
1364  sprintf (xtisa_error_msg, "invalid interface operand number (%d); " \
1365  "opcode \"%s\" has %d interface operands", (IFOP), \
1366  (INTISA)->opcodes[(OPC)].name, \
1367  (ICLASS)->num_interfaceOperands); \
1368  return (ERRVAL); \
1369  } \
1370  } while (0)
1371 
1372 
1375  int ifOp)
1376 {
1377  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
1378  xtensa_iclass_internal *iclass;
1379  int iclass_id;
1380 
1381  CHECK_OPCODE (intisa, opc, XTENSA_UNDEFINED);
1382  iclass_id = intisa->opcodes[opc].iclass_id;
1383  iclass = &intisa->iclasses[iclass_id];
1384  CHECK_INTERFACE_OPERAND (intisa, opc, iclass, ifOp, XTENSA_UNDEFINED);
1385  return iclass->interfaceOperands[ifOp];
1386 }
1387 
1388 
1389 ␌
1390 /* Register Files. */
1391 
1392 
1393 #define CHECK_REGFILE(INTISA,RF,ERRVAL) \
1394  do { \
1395  if ((RF) < 0 || (RF) >= (INTISA)->num_regfiles) \
1396  { \
1397  xtisa_errno = xtensa_isa_bad_regfile; \
1398  strcpy (xtisa_error_msg, "invalid regfile specifier"); \
1399  return (ERRVAL); \
1400  } \
1401  } while (0)
1402 
1403 
1406 {
1407  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
1408  int n;
1409 
1410  if (!name || !*name)
1411  {
1413  strcpy (xtisa_error_msg, "invalid regfile name");
1414  return XTENSA_UNDEFINED;
1415  }
1416 
1417  /* The expected number of regfiles is small; use a linear search. */
1418  for (n = 0; n < intisa->num_regfiles; n++)
1419  {
1420  if (!filename_cmp (intisa->regfiles[n].name, name)) {
1421  return n;
1422  }
1423  }
1424 
1426  sprintf (xtisa_error_msg, "regfile \"%s\" not recognized", name);
1427  return XTENSA_UNDEFINED;
1428 }
1429 
1430 
1432 xtensa_regfile_lookup_shortname (xtensa_isa isa, const char *shortname)
1433 {
1434  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
1435  int n;
1436 
1437  if (!shortname || !*shortname)
1438  {
1440  strcpy (xtisa_error_msg, "invalid regfile shortname");
1441  return XTENSA_UNDEFINED;
1442  }
1443 
1444  /* The expected number of regfiles is small; use a linear search. */
1445  for (n = 0; n < intisa->num_regfiles; n++)
1446  {
1447  /* Ignore regfile views since they always have the same shortnames
1448  as their parents. */
1449  if (intisa->regfiles[n].parent != n) {
1450  continue;
1451  }
1452  if (!filename_cmp (intisa->regfiles[n].shortname, shortname)) {
1453  return n;
1454  }
1455  }
1456 
1458  sprintf (xtisa_error_msg, "regfile shortname \"%s\" not recognized",
1459  shortname);
1460  return XTENSA_UNDEFINED;
1461 }
1462 
1463 
1464 const char *
1466 {
1467  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
1468  CHECK_REGFILE (intisa, rf, NULL);
1469  return intisa->regfiles[rf].name;
1470 }
1471 
1472 
1473 const char *
1475 {
1476  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
1477  CHECK_REGFILE (intisa, rf, NULL);
1478  return intisa->regfiles[rf].shortname;
1479 }
1480 
1481 
1484 {
1485  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
1486  CHECK_REGFILE (intisa, rf, XTENSA_UNDEFINED);
1487  return intisa->regfiles[rf].parent;
1488 }
1489 
1490 
1491 int
1493 {
1494  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
1495  CHECK_REGFILE (intisa, rf, XTENSA_UNDEFINED);
1496  return intisa->regfiles[rf].num_bits;
1497 }
1498 
1499 
1500 int
1502 {
1503  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
1504  CHECK_REGFILE (intisa, rf, XTENSA_UNDEFINED);
1505  return intisa->regfiles[rf].num_entries;
1506 }
1507 
1508 
1509 ␌
1510 /* Processor States. */
1511 
1512 
1513 #define CHECK_STATE(INTISA,ST,ERRVAL) \
1514  do { \
1515  if ((ST) < 0 || (ST) >= (INTISA)->num_states) \
1516  { \
1517  xtisa_errno = xtensa_isa_bad_state; \
1518  strcpy (xtisa_error_msg, "invalid state specifier"); \
1519  return (ERRVAL); \
1520  } \
1521  } while (0)
1522 
1523 
1526 {
1527  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
1528  xtensa_lookup_entry entry, *result = 0;
1529 
1530  if (!name || !*name)
1531  {
1533  strcpy (xtisa_error_msg, "invalid state name");
1534  return XTENSA_UNDEFINED;
1535  }
1536 
1537  if (intisa->num_states != 0)
1538  {
1539  entry.key = name;
1540  result = bsearch (&entry, intisa->state_lookup_table, intisa->num_states,
1542  }
1543 
1544  if (!result)
1545  {
1547  sprintf (xtisa_error_msg, "state \"%s\" not recognized", name);
1548  return XTENSA_UNDEFINED;
1549  }
1550 
1551  return result->u.state;
1552 }
1553 
1554 
1555 const char *
1557 {
1558  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
1559  CHECK_STATE (intisa, st, NULL);
1560  return intisa->states[st].name;
1561 }
1562 
1563 
1564 int
1566 {
1567  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
1568  CHECK_STATE (intisa, st, XTENSA_UNDEFINED);
1569  return intisa->states[st].num_bits;
1570 }
1571 
1572 
1573 int
1575 {
1576  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
1577  CHECK_STATE (intisa, st, XTENSA_UNDEFINED);
1578  if ((intisa->states[st].flags & XTENSA_STATE_IS_EXPORTED) != 0) {
1579  return 1;
1580  }
1581  return 0;
1582 }
1583 
1584 
1585 int
1587 {
1588  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
1589  CHECK_STATE (intisa, st, XTENSA_UNDEFINED);
1590  if ((intisa->states[st].flags & XTENSA_STATE_IS_SHARED_OR) != 0) {
1591  return 1;
1592  }
1593  return 0;
1594 }
1595 
1596 
1597 ␌
1598 /* Sysregs. */
1599 
1600 
1601 #define CHECK_SYSREG(INTISA,SYSREG,ERRVAL) \
1602  do { \
1603  if ((SYSREG) < 0 || (SYSREG) >= (INTISA)->num_sysregs) \
1604  { \
1605  xtisa_errno = xtensa_isa_bad_sysreg; \
1606  strcpy (xtisa_error_msg, "invalid sysreg specifier"); \
1607  return (ERRVAL); \
1608  } \
1609  } while (0)
1610 
1611 
1613 xtensa_sysreg_lookup (xtensa_isa isa, int num, int is_user)
1614 {
1615  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
1616 
1617  if (is_user != 0) {
1618  is_user = 1;
1619  }
1620 
1621  if (num < 0 || num > intisa->max_sysreg_num[is_user]
1622  || intisa->sysreg_table[is_user][num] == XTENSA_UNDEFINED)
1623  {
1625  strcpy (xtisa_error_msg, "sysreg not recognized");
1626  return XTENSA_UNDEFINED;
1627  }
1628 
1629  return intisa->sysreg_table[is_user][num];
1630 }
1631 
1632 
1635 {
1636  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
1637  xtensa_lookup_entry entry, *result = 0;
1638 
1639  if (!name || !*name)
1640  {
1642  strcpy (xtisa_error_msg, "invalid sysreg name");
1643  return XTENSA_UNDEFINED;
1644  }
1645 
1646  if (intisa->num_sysregs != 0)
1647  {
1648  entry.key = name;
1649  result = bsearch (&entry, intisa->sysreg_lookup_table,
1650  intisa->num_sysregs, sizeof (xtensa_lookup_entry),
1652  }
1653 
1654  if (!result)
1655  {
1657  sprintf (xtisa_error_msg, "sysreg \"%s\" not recognized", name);
1658  return XTENSA_UNDEFINED;
1659  }
1660 
1661  return result->u.sysreg;
1662 }
1663 
1664 
1665 const char *
1667 {
1668  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
1669  CHECK_SYSREG (intisa, sysreg, NULL);
1670  return intisa->sysregs[sysreg].name;
1671 }
1672 
1673 
1674 int
1676 {
1677  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
1678  CHECK_SYSREG (intisa, sysreg, XTENSA_UNDEFINED);
1679  return intisa->sysregs[sysreg].number;
1680 }
1681 
1682 
1683 int
1685 {
1686  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
1687  CHECK_SYSREG (intisa, sysreg, XTENSA_UNDEFINED);
1688  if (intisa->sysregs[sysreg].is_user) {
1689  return 1;
1690  }
1691  return 0;
1692 }
1693 
1694 
1695 ␌
1696 /* Interfaces. */
1697 
1698 
1699 #define CHECK_INTERFACE(INTISA,INTF,ERRVAL) \
1700  do { \
1701  if ((INTF) < 0 || (INTF) >= (INTISA)->num_interfaces) \
1702  { \
1703  xtisa_errno = xtensa_isa_bad_interface; \
1704  strcpy (xtisa_error_msg, "invalid interface specifier"); \
1705  return (ERRVAL); \
1706  } \
1707  } while (0)
1708 
1709 
1711 xtensa_interface_lookup (xtensa_isa isa, const char *ifname)
1712 {
1713  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
1714  xtensa_lookup_entry entry, *result = 0;
1715 
1716  if (!ifname || !*ifname)
1717  {
1719  strcpy (xtisa_error_msg, "invalid interface name");
1720  return XTENSA_UNDEFINED;
1721  }
1722 
1723  if (intisa->num_interfaces != 0)
1724  {
1725  entry.key = ifname;
1726  result = bsearch (&entry, intisa->interface_lookup_table,
1727  intisa->num_interfaces, sizeof (xtensa_lookup_entry),
1729  }
1730 
1731  if (!result)
1732  {
1734  sprintf (xtisa_error_msg, "interface \"%s\" not recognized", ifname);
1735  return XTENSA_UNDEFINED;
1736  }
1737 
1738  return result->u.intf;
1739 }
1740 
1741 
1742 const char *
1744 {
1745  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
1746  CHECK_INTERFACE (intisa, intf, NULL);
1747  return intisa->interfaces[intf].name;
1748 }
1749 
1750 
1751 int
1753 {
1754  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
1756  return intisa->interfaces[intf].num_bits;
1757 }
1758 
1759 
1760 char
1762 {
1763  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
1764  CHECK_INTERFACE (intisa, intf, 0);
1765  return intisa->interfaces[intf].inout;
1766 }
1767 
1768 
1769 int
1771 {
1772  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
1774  if ((intisa->interfaces[intf].flags & XTENSA_INTERFACE_HAS_SIDE_EFFECT) != 0) {
1775  return 1;
1776  }
1777  return 0;
1778 }
1779 
1780 
1781 int
1783 {
1784  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
1786  return intisa->interfaces[intf].class_id;
1787 }
1788 
1789 
1790 ␌
1791 /* Functional Units. */
1792 
1793 
1794 #define CHECK_FUNCUNIT(INTISA,FUN,ERRVAL) \
1795  do { \
1796  if ((FUN) < 0 || (FUN) >= (INTISA)->num_funcUnits) \
1797  { \
1798  xtisa_errno = xtensa_isa_bad_funcUnit; \
1799  strcpy (xtisa_error_msg, "invalid functional unit specifier"); \
1800  return (ERRVAL); \
1801  } \
1802  } while (0)
1803 
1804 
1807 {
1808  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
1809  xtensa_lookup_entry entry, *result = 0;
1810 
1811  if (!fname || !*fname)
1812  {
1814  strcpy (xtisa_error_msg, "invalid functional unit name");
1815  return XTENSA_UNDEFINED;
1816  }
1817 
1818  if (intisa->num_funcUnits != 0)
1819  {
1820  entry.key = fname;
1821  result = bsearch (&entry, intisa->funcUnit_lookup_table,
1822  intisa->num_funcUnits, sizeof (xtensa_lookup_entry),
1824  }
1825 
1826  if (!result)
1827  {
1830  "functional unit \"%s\" not recognized", fname);
1831  return XTENSA_UNDEFINED;
1832  }
1833 
1834  return result->u.fun;
1835 }
1836 
1837 
1838 const char *
1840 {
1841  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
1842  CHECK_FUNCUNIT (intisa, fun, NULL);
1843  return intisa->funcUnits[fun].name;
1844 }
1845 
1846 
1847 int
1849 {
1850  xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
1851  CHECK_FUNCUNIT (intisa, fun, XTENSA_UNDEFINED);
1852  return intisa->funcUnits[fun].num_copies;
1853 }
1854 
lzma_index ** i
Definition: index.h:629
ut16 val
Definition: armass64_const.h:6
#define NULL
Definition: cris-opc.c:27
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec struct timespec static rem const char static group const void start
Definition: sflib.h:133
static ut64 opc
Definition: desil.c:33
#define bfd_malloc
Definition: disas-asm.h:42
RZ_API void Ht_() free(HtName_(Ht) *ht)
Definition: ht_inc.c:130
voidpf void * buf
Definition: ioapi.h:138
sprintf
Definition: kernel.h:365
@ v1
Definition: lanai.h:85
return memset(p, 0, total)
#define __attribute__(x)
Definition: ansidecl.h:266
void * malloc(size_t size)
Definition: malloc.c:123
void * calloc(size_t number, size_t size)
Definition: malloc.c:102
static static fork const void static count static fd const char const char static newpath char char char static envp time_t static t const char static mode static whence const char static dir time_t static t unsigned static seconds const char struct utimbuf static buf static inc static sig const char static mode static oldfd struct tms static buf static getgid static geteuid const char static filename static arg static mask struct ustat static ubuf static getppid static setsid static egid sigset_t static set struct timeval struct timezone static tz fd_set fd_set fd_set struct timeval static timeout const char char static bufsiz const char static swapflags void static offset const char static length static mode static who const char struct statfs static buf unsigned unsigned num
Definition: sflib.h:126
int n
Definition: mipsasm.c:19
const char * name
Definition: op.c:541
void qsort(void *a, size_t n, size_t es, int(*cmp)(const void *, const void *))
Definition: qsort.h:130
RZ_API int rz_str_casecmp(const char *dst, const char *orig)
Definition: str.c:121
#define s1(x)
Definition: sha256.c:60
Definition: zipcmp.c:77
Definition: z80asm.h:102
union xtensa_arg_internal_struct::@102 u
xtensa_format_encode_fn encode_fn
xtensa_arg_internal * stateOperands
xtensa_format_decode_fn format_decode_fn
xtensa_operand_internal * operands
xtensa_lookup_entry * sysreg_lookup_table
xtensa_state_internal * states
xtensa_lookup_entry * state_lookup_table
xtensa_regfile_internal * regfiles
xtensa_opcode_internal * opcodes
xtensa_iclass_internal * iclasses
xtensa_lookup_entry * funcUnit_lookup_table
xtensa_interface_internal * interfaces
xtensa_funcUnit_internal * funcUnits
xtensa_sysreg_internal * sysregs
xtensa_lookup_entry * opname_lookup_table
xtensa_length_decode_fn length_decode_fn
xtensa_format_internal * formats
xtensa_slot_internal * slots
xtensa_lookup_entry * interface_lookup_table
xtensa_funcUnit fun
xtensa_opcode opcode
xtensa_state state
xtensa_interface intf
xtensa_sysreg sysreg
const char * key
union xtensa_lookup_entry_struct::@103 u
xtensa_opcode_encode_fn * encode_fns
xtensa_funcUnit_use * funcUnit_uses
xtensa_set_field_fn * set_field_fns
xtensa_opcode_decode_fn opcode_decode_fn
xtensa_get_field_fn * get_field_fns
void(* xtensa_set_field_fn)(xtensa_insnbuf, uint32)
#define XTENSA_STATE_IS_SHARED_OR
#define XTENSA_OPERAND_IS_UNKNOWN
#define XTENSA_INTERFACE_HAS_SIDE_EFFECT
#define XTENSA_OPERAND_IS_INVISIBLE
uint32(* xtensa_get_field_fn)(const xtensa_insnbuf)
#define XTENSA_OPCODE_IS_CALL
#define XTENSA_STATE_IS_EXPORTED
void(* xtensa_opcode_encode_fn)(xtensa_insnbuf)
#define XTENSA_OPCODE_IS_LOOP
#define XTENSA_OPERAND_IS_PCRELATIVE
#define XTENSA_OPCODE_IS_JUMP
#define XTENSA_OPERAND_IS_REGISTER
#define XTENSA_OPCODE_IS_BRANCH
const char * xtensa_regfile_shortname(xtensa_isa isa, xtensa_regfile rf)
Definition: xtensa-isa.c:1474
int xtensa_opcode_num_funcUnit_uses(xtensa_isa isa, xtensa_opcode opc)
Definition: xtensa-isa.c:852
int xtensa_operand_is_PCrelative(xtensa_isa isa, xtensa_opcode opc, int opnd)
Definition: xtensa-isa.c:1221
static int byte_to_word_index(int byte_index)
Definition: xtensa-isa.c:110
int xtensa_isa_num_opcodes(xtensa_isa isa)
Definition: xtensa-isa.c:461
int xtensa_isa_name_compare(const void *v1, const void *v2)
Definition: xtensa-isa.c:395
void xtensa_isa_free(xtensa_isa isa)
Definition: xtensa-isa.c:344
#define CHECK_FORMAT(INTISA, FMT, ERRVAL)
Definition: xtensa-isa.c:512
int xtensa_format_get_slot(xtensa_isa isa, xtensa_format fmt, int slot, const xtensa_insnbuf insn, xtensa_insnbuf slotbuf)
Definition: xtensa-isa.c:629
int xtensa_opcode_is_loop(xtensa_isa isa, xtensa_opcode opc)
Definition: xtensa-isa.c:792
int xtensa_operand_encode(xtensa_isa isa, xtensa_opcode opc, int opnd, uint32 *valp)
Definition: xtensa-isa.c:1053
#define CHECK_STATE(INTISA, ST, ERRVAL)
Definition: xtensa-isa.c:1513
const char * xtensa_format_name(xtensa_isa isa, xtensa_format fmt)
Definition: xtensa-isa.c:535
int xtensa_operand_do_reloc(xtensa_isa isa, xtensa_opcode opc, int opnd, uint32 *valp, uint32 pc)
Definition: xtensa-isa.c:1239
int xtensa_format_num_slots(xtensa_isa isa, xtensa_format fmt)
Definition: xtensa-isa.c:606
int xtensa_opcode_is_branch(xtensa_isa isa, xtensa_opcode opc)
Definition: xtensa-isa.c:768
int xtensa_operand_undo_reloc(xtensa_isa isa, xtensa_opcode opc, int opnd, uint32 *valp, uint32 pc)
Definition: xtensa-isa.c:1274
int xtensa_opcode_is_jump(xtensa_isa isa, xtensa_opcode opc)
Definition: xtensa-isa.c:780
int xtensa_format_set_slot(xtensa_isa isa, xtensa_format fmt, int slot, xtensa_insnbuf insn, const xtensa_insnbuf slotbuf)
Definition: xtensa-isa.c:645
#define CHECK_STATE_OPERAND(INTISA, OPC, ICLASS, STOP, ERRVAL)
Definition: xtensa-isa.c:1312
int xtensa_opcode_is_call(xtensa_isa isa, xtensa_opcode opc)
Definition: xtensa-isa.c:804
const char * xtensa_regfile_name(xtensa_isa isa, xtensa_regfile rf)
Definition: xtensa-isa.c:1465
int xtensa_operand_set_field(xtensa_isa isa, xtensa_opcode opc, int opnd, xtensa_format fmt, int slot, xtensa_insnbuf slotbuf, uint32 val)
Definition: xtensa-isa.c:1014
xtensa_sysreg xtensa_sysreg_lookup(xtensa_isa isa, int num, int is_user)
Definition: xtensa-isa.c:1613
char xtensa_operand_inout(xtensa_isa isa, xtensa_opcode opc, int opnd)
Definition: xtensa-isa.c:952
int xtensa_operand_num_regs(xtensa_isa isa, xtensa_opcode opc, int opnd)
Definition: xtensa-isa.c:1188
int xtensa_operand_is_register(xtensa_isa isa, xtensa_opcode opc, int opnd)
Definition: xtensa-isa.c:1155
xtensa_interface xtensa_interface_lookup(xtensa_isa isa, const char *ifname)
Definition: xtensa-isa.c:1711
xtensa_regfile xtensa_regfile_view_parent(xtensa_isa isa, xtensa_regfile rf)
Definition: xtensa-isa.c:1483
void xtensa_insnbuf_free(xtensa_isa isa __attribute__((unused)), xtensa_insnbuf buf)
Definition: xtensa-isa.c:98
xtensa_state xtensa_state_lookup(xtensa_isa isa, const char *name)
Definition: xtensa-isa.c:1525
#define CHECK_SYSREG(INTISA, SYSREG, ERRVAL)
Definition: xtensa-isa.c:1601
int xtensa_isa_num_funcUnits(xtensa_isa isa)
Definition: xtensa-isa.c:501
int xtensa_isa_num_formats(xtensa_isa isa)
Definition: xtensa-isa.c:453
int xtensa_interface_class_id(xtensa_isa isa, xtensa_interface intf)
Definition: xtensa-isa.c:1782
int xtensa_isa_num_sysregs(xtensa_isa isa)
Definition: xtensa-isa.c:485
#define CHECK_SLOT(INTISA, FMT, SLOT, ERRVAL)
Definition: xtensa-isa.c:523
int xtensa_state_is_shared_or(xtensa_isa isa, xtensa_state st)
Definition: xtensa-isa.c:1586
int xtensa_isa_num_regfiles(xtensa_isa isa)
Definition: xtensa-isa.c:469
xtensa_opcode xtensa_opcode_decode(xtensa_isa isa, xtensa_format fmt, int slot, const xtensa_insnbuf slotbuf)
Definition: xtensa-isa.c:708
const char * xtensa_operand_name(xtensa_isa isa, xtensa_opcode opc, int opnd)
Definition: xtensa-isa.c:910
#define CHECK_ALLOC_FOR_INIT(MEM, ERRVAL, ERRNO_P, ERROR_MSG_P)
Definition: xtensa-isa.c:63
int xtensa_opcode_num_operands(xtensa_isa isa, xtensa_opcode opc)
Definition: xtensa-isa.c:816
#define CHECK_INTERFACE(INTISA, INTF, ERRVAL)
Definition: xtensa-isa.c:1699
int xtensa_insnbuf_size(xtensa_isa isa)
Definition: xtensa-isa.c:80
xtensa_regfile xtensa_operand_regfile(xtensa_isa isa, xtensa_opcode opc, int opnd)
Definition: xtensa-isa.c:1173
xtensa_isa_internal xtensa_modules
int xtensa_format_encode(xtensa_isa isa, xtensa_format fmt, xtensa_insnbuf insn)
Definition: xtensa-isa.c:587
#define CHECK_OPERAND(INTISA, OPC, ICLASS, OPND, ERRVAL)
Definition: xtensa-isa.c:881
const char * xtensa_funcUnit_name(xtensa_isa isa, xtensa_funcUnit fun)
Definition: xtensa-isa.c:1839
int xtensa_operand_get_field(xtensa_isa isa, xtensa_opcode opc, int opnd, xtensa_format fmt, int slot, const xtensa_insnbuf slotbuf, uint32 *valp)
Definition: xtensa-isa.c:975
int xtensa_sysreg_is_user(xtensa_isa isa, xtensa_sysreg sysreg)
Definition: xtensa-isa.c:1684
int xtensa_regfile_num_entries(xtensa_isa isa, xtensa_regfile rf)
Definition: xtensa-isa.c:1501
int xtensa_operand_decode(xtensa_isa isa, xtensa_opcode opc, int opnd, uint32 *valp)
Definition: xtensa-isa.c:1128
xtensa_state xtensa_stateOperand_state(xtensa_isa isa, xtensa_opcode opc, int stOp)
Definition: xtensa-isa.c:1326
int xtensa_format_length(xtensa_isa isa, xtensa_format fmt)
Definition: xtensa-isa.c:597
const char * xtensa_state_name(xtensa_isa isa, xtensa_state st)
Definition: xtensa-isa.c:1556
int xtensa_insnbuf_to_chars(xtensa_isa isa, const xtensa_insnbuf insn, unsigned char *cp, int num_chars)
Definition: xtensa-isa.c:133
int xtensa_isa_num_states(xtensa_isa isa)
Definition: xtensa-isa.c:477
int xtensa_interface_num_bits(xtensa_isa isa, xtensa_interface intf)
Definition: xtensa-isa.c:1752
int xtensa_interface_has_side_effect(xtensa_isa isa, xtensa_interface intf)
Definition: xtensa-isa.c:1770
#define CHECK_FUNCUNIT(INTISA, FUN, ERRVAL)
Definition: xtensa-isa.c:1794
int xtensa_opcode_num_interfaceOperands(xtensa_isa isa, xtensa_opcode opc)
Definition: xtensa-isa.c:840
char * xtensa_isa_error_msg(xtensa_isa isa __attribute__((unused)))
Definition: xtensa-isa.c:47
xtensa_interface xtensa_interfaceOperand_interface(xtensa_isa isa, xtensa_opcode opc, int ifOp)
Definition: xtensa-isa.c:1374
int xtensa_sysreg_number(xtensa_isa isa, xtensa_sysreg sysreg)
Definition: xtensa-isa.c:1675
xtensa_regfile xtensa_regfile_lookup(xtensa_isa isa, const char *name)
Definition: xtensa-isa.c:1405
int xtensa_state_is_exported(xtensa_isa isa, xtensa_state st)
Definition: xtensa-isa.c:1574
#define CHECK_OPCODE(INTISA, OPC, ERRVAL)
Definition: xtensa-isa.c:664
xtensa_format xtensa_format_decode(xtensa_isa isa, const xtensa_insnbuf insn)
Definition: xtensa-isa.c:570
void xtensa_insnbuf_from_chars(xtensa_isa isa, xtensa_insnbuf insn, const unsigned char *cp, int num_chars)
Definition: xtensa-isa.c:196
int filename_cmp(const char *s1, const char *s2)
Definition: elf32-xtensa.c:151
xtensa_isa xtensa_isa_init(xtensa_isa_status *errno_p, char **error_msg_p)
Definition: xtensa-isa.c:248
xtensa_funcUnit_use * xtensa_opcode_funcUnit_use(xtensa_isa isa, xtensa_opcode opc, int u)
Definition: xtensa-isa.c:861
static xtensa_operand_internal * get_operand(xtensa_isa_internal *intisa, xtensa_opcode opc, int opnd)
Definition: xtensa-isa.c:895
const char * xtensa_interface_name(xtensa_isa isa, xtensa_interface intf)
Definition: xtensa-isa.c:1743
int xtensa_regfile_num_bits(xtensa_isa isa, xtensa_regfile rf)
Definition: xtensa-isa.c:1492
char xtensa_stateOperand_inout(xtensa_isa isa, xtensa_opcode opc, int stOp)
Definition: xtensa-isa.c:1341
int xtensa_operand_is_visible(xtensa_isa isa, xtensa_opcode opc, int opnd)
Definition: xtensa-isa.c:924
xtensa_opcode xtensa_opcode_lookup(xtensa_isa isa, const char *opname)
Definition: xtensa-isa.c:676
char xtisa_error_msg[1024]
Definition: xtensa-isa.c:36
#define CHECK_ALLOC(MEM, ERRVAL)
Definition: xtensa-isa.c:53
#define CHECK_REGFILE(INTISA, RF, ERRVAL)
Definition: xtensa-isa.c:1393
xtensa_isa_status xtisa_errno
Definition: xtensa-isa.c:35
xtensa_regfile xtensa_regfile_lookup_shortname(xtensa_isa isa, const char *shortname)
Definition: xtensa-isa.c:1432
char xtensa_interface_inout(xtensa_isa isa, xtensa_interface intf)
Definition: xtensa-isa.c:1761
xtensa_format xtensa_format_lookup(xtensa_isa isa, const char *fmtname)
Definition: xtensa-isa.c:544
int xtensa_opcode_encode(xtensa_isa isa, xtensa_format fmt, int slot, xtensa_insnbuf slotbuf, xtensa_opcode opc)
Definition: xtensa-isa.c:732
int xtensa_state_num_bits(xtensa_isa isa, xtensa_state st)
Definition: xtensa-isa.c:1565
int xtensa_isa_length_from_chars(xtensa_isa isa, const unsigned char *cp)
Definition: xtensa-isa.c:413
int xtensa_opcode_num_stateOperands(xtensa_isa isa, xtensa_opcode opc)
Definition: xtensa-isa.c:828
int xtensa_operand_is_known_reg(xtensa_isa isa, xtensa_opcode opc, int opnd)
Definition: xtensa-isa.c:1203
#define CHECK_INTERFACE_OPERAND(INTISA, OPC, ICLASS, IFOP, ERRVAL)
Definition: xtensa-isa.c:1359
xtensa_isa_status xtensa_isa_errno(xtensa_isa isa __attribute__((unused)))
Definition: xtensa-isa.c:40
xtensa_funcUnit xtensa_funcUnit_lookup(xtensa_isa isa, const char *fname)
Definition: xtensa-isa.c:1806
xtensa_opcode xtensa_format_slot_nop_opcode(xtensa_isa isa, xtensa_format fmt, int slot)
Definition: xtensa-isa.c:615
int xtensa_isa_num_pipe_stages(xtensa_isa isa)
Definition: xtensa-isa.c:421
int xtensa_isa_num_interfaces(xtensa_isa isa)
Definition: xtensa-isa.c:493
const char * xtensa_sysreg_name(xtensa_isa isa, xtensa_sysreg sysreg)
Definition: xtensa-isa.c:1666
xtensa_sysreg xtensa_sysreg_lookup_name(xtensa_isa isa, const char *name)
Definition: xtensa-isa.c:1634
int xtensa_isa_maxlength(xtensa_isa isa)
Definition: xtensa-isa.c:405
static int byte_to_bit_index(int byte_index)
Definition: xtensa-isa.c:117
const char * xtensa_opcode_name(xtensa_isa isa, xtensa_opcode opc)
Definition: xtensa-isa.c:759
int xtensa_funcUnit_num_copies(xtensa_isa isa, xtensa_funcUnit fun)
Definition: xtensa-isa.c:1848
xtensa_insnbuf xtensa_insnbuf_alloc(xtensa_isa isa)
Definition: xtensa-isa.c:88
enum xtensa_isa_status_enum xtensa_isa_status
@ xtensa_isa_internal_error
Definition: xtensa-isa.h:166
@ xtensa_isa_bad_state
Definition: xtensa-isa.h:159
@ xtensa_isa_wrong_slot
Definition: xtensa-isa.h:162
@ xtensa_isa_bad_opcode
Definition: xtensa-isa.h:153
@ xtensa_isa_bad_funcUnit
Definition: xtensa-isa.h:161
@ xtensa_isa_bad_interface
Definition: xtensa-isa.h:160
@ xtensa_isa_bad_value
Definition: xtensa-isa.h:167
@ xtensa_isa_bad_regfile
Definition: xtensa-isa.h:157
@ xtensa_isa_bad_sysreg
Definition: xtensa-isa.h:158
@ xtensa_isa_no_field
Definition: xtensa-isa.h:163
@ xtensa_isa_bad_format
Definition: xtensa-isa.h:151
@ xtensa_isa_buffer_overflow
Definition: xtensa-isa.h:165
int xtensa_opcode
Definition: xtensa-isa.h:83
int xtensa_format
Definition: xtensa-isa.h:84
uint32 xtensa_insnbuf_word
Definition: xtensa-isa.h:178
int xtensa_regfile
Definition: xtensa-isa.h:85
xtensa_insnbuf_word * xtensa_insnbuf
Definition: xtensa-isa.h:179
int xtensa_sysreg
Definition: xtensa-isa.h:87
#define uint32
Definition: xtensa-isa.h:39
int xtensa_interface
Definition: xtensa-isa.h:88
#define XTENSA_UNDEFINED
Definition: xtensa-isa.h:93
int xtensa_state
Definition: xtensa-isa.h:86
int xtensa_funcUnit
Definition: xtensa-isa.h:89
int FAR intf
Definition: zconf.h:403