* as.c (main): Define .gasversion. rather than __GAS_VERSION__.
[deliverable/binutils-gdb.git] / gas / cgen.h
CommitLineData
252b5132 1/* GAS cgen support.
32425e36 2 Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2007, 2011
2da5c037 3 Free Software Foundation, Inc.
252b5132
RH
4
5 This file is part of GAS, the GNU Assembler.
6
7 GAS is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
ec2655a6 9 the Free Software Foundation; either version 3, or (at your option)
252b5132
RH
10 any later version.
11
ec2655a6
NC
12 GAS is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
15 License for more details.
252b5132
RH
16
17 You should have received a copy of the GNU General Public License
18 along with GAS; see the file COPYING. If not, write to the Free
4b4da160
NC
19 Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
20 02110-1301, USA. */
252b5132
RH
21
22#ifndef GAS_CGEN_H
23#define GAS_CGEN_H
24
25/* Opcode table handle. */
26extern CGEN_CPU_DESC gas_cgen_cpu_desc;
27
28/* Maximum number of fixups in an insn.
29 If you need to change this, allow target to override and do so there. */
7c3dc350 30#ifndef GAS_CGEN_MAX_FIXUPS
252b5132 31#define GAS_CGEN_MAX_FIXUPS 3
7c3dc350 32#endif
252b5132
RH
33
34/* Struct defining result of gas_cgen_finish_insn. */
32425e36
NC
35typedef struct
36{
37 /* Frag containing the insn */
e972090a 38 fragS * frag;
252b5132 39 /* Address of insn in frag. */
e972090a 40 char * addr;
252b5132
RH
41 /* Number of fixups this insn has. */
42 int num_fixups;
43 /* Array of fixups. */
e972090a 44 fixS * fixups[GAS_CGEN_MAX_FIXUPS];
252b5132
RH
45} finished_insnS;
46
47/* Callback for operand parsing.
48 The result is an error message or NULL for success.
49 The parsed value is stored in the bfd_vma *. */
50extern const char * gas_cgen_parse_operand
73ee5e4c
KH
51 (CGEN_CPU_DESC, enum cgen_parse_operand_type,
52 const char **, int, int, enum cgen_parse_operand_result *,
53 bfd_vma *);
252b5132
RH
54
55/* Call this from md_assemble to initialize the assembler callback. */
73ee5e4c 56extern void gas_cgen_init_parse (void);
252b5132 57
d1a6c242 58/* Routines and macros for saving fixup chains. */
73ee5e4c
KH
59extern void gas_cgen_save_fixups (int);
60extern void gas_cgen_restore_fixups (int);
61extern void gas_cgen_swap_fixups (int);
62extern void gas_cgen_initialize_saved_fixups_array (void);
002de68b 63#define MAX_SAVED_FIXUP_CHAINS 50
30a2b4ef 64
252b5132
RH
65/* Add a register to the assembler's hash table.
66 This makes lets GAS parse registers for us.
67 ??? This isn't currently used, but it could be in the future. */
73ee5e4c 68extern void cgen_asm_record_register (char *, int);
252b5132
RH
69
70/* After CGEN_SYM (assemble_insn) is done, this is called to
71 output the insn and record any fixups. */
73ee5e4c
KH
72extern void gas_cgen_finish_insn (const CGEN_INSN *,
73 CGEN_INSN_BYTES_PTR, unsigned int,
74 int, finished_insnS *);
252b5132
RH
75
76/* Record a fixup. */
73ee5e4c
KH
77extern fixS * gas_cgen_record_fixup (fragS *, int, const CGEN_INSN *,
78 int, const CGEN_OPERAND *, int,
79 symbolS *, offsetT);
80extern fixS * gas_cgen_record_fixup_exp (fragS *, int, const CGEN_INSN *,
81 int, const CGEN_OPERAND *, int,
82 expressionS *);
252b5132 83
32425e36
NC
84extern bfd_reloc_code_real_type gas_cgen_pcrel_r_type (bfd_reloc_code_real_type);
85
86/* md_apply_fix handler. */
55cf6793 87extern void gas_cgen_md_apply_fix (fixS *, valueT *, segT);
252b5132 88
32425e36 89/* tc_gen_reloc handler. */
73ee5e4c 90extern arelent *gas_cgen_tc_gen_reloc (asection *, fixS *);
252b5132
RH
91
92/* Target supplied routine to lookup a reloc. */
93extern bfd_reloc_code_real_type
73ee5e4c 94md_cgen_lookup_reloc (const CGEN_INSN *, const CGEN_OPERAND *, fixS *);
252b5132
RH
95
96/* Optional target supplied routine to record a fixup for an expression. */
97extern fixS *
73ee5e4c
KH
98md_cgen_record_fixup_exp (fragS *, int, const CGEN_INSN *, int,
99 const CGEN_OPERAND *, int, expressionS *);
252b5132 100
73ee5e4c 101extern void gas_cgen_md_operand (expressionS *);
0609eb57 102
9cc92a36 103/* Perform any cgen specific initialisation for gas. */
73ee5e4c 104extern void gas_cgen_begin (void);
9cc92a36 105
252b5132 106#endif /* GAS_CGEN_H */
This page took 0.480675 seconds and 4 git commands to generate.