📄 som.h
字号:
/* Definitions for SOM assembler support. Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc.This file is part of GNU CC.GNU CC is free software; you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation; either version 2, or (at your option)any later version.GNU CC is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See theGNU General Public License for more details.You should have received a copy of the GNU General Public Licensealong with GNU CC; see the file COPYING. If not, write tothe Free Software Foundation, 59 Temple Place - Suite 330,Boston, MA 02111-1307, USA. *//* So we can conditionalize small amounts of code in pa.c or pa.md. */#undef TARGET_SOM#define TARGET_SOM 1/* We do not use BINCL stabs in SOM. ??? If it does not hurt, we probably should to avoid useless divergence from other embedded stabs implementations. */#undef DBX_USE_BINCL/* We make the first line stab special to avoid adding several gross hacks to GAS. */#undef ASM_OUTPUT_SOURCE_LINE#define ASM_OUTPUT_SOURCE_LINE(file, line) \ { static int sym_lineno = 1; \ static tree last_function_decl = NULL; \ if (current_function_decl == last_function_decl) \ fprintf (file, "\t.stabn 68,0,%d,L$M%d-%s\nL$M%d:\n", \ line, sym_lineno, \ XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0) + 1, \ sym_lineno); \ else \ fprintf (file, "\t.stabn 68,0,%d,0\n", line); \ last_function_decl = current_function_decl; \ sym_lineno += 1; }/* gdb needs a null N_SO at the end of each file for scattered loading. */#undef DBX_OUTPUT_MAIN_SOURCE_FILE_END#define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME) \ text_section (); \ fputs ("\t.SPACE $TEXT$\n\t.NSUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY\n", FILE); \ fprintf (FILE, \ "\t.stabs \"\",%d,0,0,L$text_end0000\nL$text_end0000:\n", N_SO)/* Select a format to encode pointers in exception handling data. CODE is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is true if the symbol may be affected by dynamic relocations. Because the HP assembler does auto alignment, it is necessary to use DW_EH_PE_aligned instead of the default DW_EH_PE_absptr. */#define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) \ (TARGET_GAS ? DW_EH_PE_absptr : DW_EH_PE_aligned)/* HPUX has a program 'chatr' to list the dependencies of dynamically linked executables and shared libraries. */#define LDD_SUFFIX "chatr"/* Look for lines like "dynamic /usr/lib/X11R5/libX11.sl" or "static /usr/lib/X11R5/libX11.sl". HPUX 10.20 also has lines like "static branch prediction ..." so we filter that out explicitly. We also try to bound our search for libraries with marker lines. What a pain. */#define PARSE_LDD_OUTPUT(PTR) \do { \ static int in_shlib_list = 0; \ while (*PTR == ' ') PTR++; \ if (strncmp (PTR, "shared library list:", \ sizeof ("shared library list:") - 1) == 0) \ { \ PTR = 0; \ in_shlib_list = 1; \ } \ else if (strncmp (PTR, "shared library binding:", \ sizeof ("shared library binding:") - 1) == 0)\ { \ PTR = 0; \ in_shlib_list = 0; \ } \ else if (strncmp (PTR, "static branch prediction disabled", \ sizeof ("static branch prediction disabled") - 1) == 0)\ { \ PTR = 0; \ in_shlib_list = 0; \ } \ else if (in_shlib_list \ && strncmp (PTR, "dynamic", sizeof ("dynamic") - 1) == 0) \ { \ PTR += sizeof ("dynamic") - 1; \ while (*p == ' ') PTR++; \ } \ else if (in_shlib_list \ && strncmp (PTR, "static", sizeof ("static") - 1) == 0) \ { \ PTR += sizeof ("static") - 1; \ while (*p == ' ') PTR++; \ } \ else \ PTR = 0; \} while (0)/* Output the label for a function definition. */#ifndef HP_FP_ARG_DESCRIPTOR_REVERSED#define ASM_DOUBLE_ARG_DESCRIPTORS(FILE, ARG0, ARG1) \ do { fprintf (FILE, ",ARGW%d=FR", (ARG0)); \ fprintf (FILE, ",ARGW%d=FU", (ARG1));} while (0)#define DFMODE_RETURN_STRING ",RTNVAL=FU"#define SFMODE_RETURN_STRING ",RTNVAL=FR"#else#define ASM_DOUBLE_ARG_DESCRIPTORS(FILE, ARG0, ARG1) \ do { fprintf (FILE, ",ARGW%d=FU", (ARG0)); \ fprintf (FILE, ",ARGW%d=FR", (ARG1));} while (0)#define DFMODE_RETURN_STRING ",RTNVAL=FR"#define SFMODE_RETURN_STRING ",RTNVAL=FU"#endif/* NAME refers to the function's name. If we are placing each function into its own section, we need to switch to the section for this function. Note that the section name will have a "." prefix. */#define ASM_OUTPUT_FUNCTION_PREFIX(FILE, NAME) \ { \ const char *name = (*targetm.strip_name_encoding) (NAME); \ if (TARGET_GAS && in_section == in_text) \ fputs ("\t.NSUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY\n", FILE); \ else if (TARGET_GAS) \ fprintf (FILE, \ "\t.SUBSPA .%s\n", name); \ } #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \ do { tree fntype = TREE_TYPE (TREE_TYPE (DECL)); \ tree tree_type = TREE_TYPE (DECL); \ tree parm; \ int i; \ if (TREE_PUBLIC (DECL) || TARGET_GAS) \ { \ if (TREE_PUBLIC (DECL)) \ { \ fputs ("\t.EXPORT ", FILE); \ assemble_name (FILE, NAME); \ fputs (",ENTRY,PRIV_LEV=3", FILE); \ } \ else \ { \ fputs ("\t.PARAM ", FILE); \ assemble_name (FILE, NAME); \ fputs (",PRIV_LEV=3", FILE); \ } \ for (parm = DECL_ARGUMENTS (DECL), i = 0; parm && i < 4; \ parm = TREE_CHAIN (parm)) \ { \ if (TYPE_MODE (DECL_ARG_TYPE (parm)) == SFmode \ && ! TARGET_SOFT_FLOAT) \ fprintf (FILE, ",ARGW%d=FR", i++); \ else if (TYPE_MODE (DECL_ARG_TYPE (parm)) == DFmode \ && ! TARGET_SOFT_FLOAT) \ { \ if (i <= 2) \ { \ if (i == 1) i++; \ ASM_DOUBLE_ARG_DESCRIPTORS (FILE, i++, i++); \ } \ else \ break; \ } \ else \ { \ int arg_size = \ FUNCTION_ARG_SIZE (TYPE_MODE (DECL_ARG_TYPE (parm)),\ DECL_ARG_TYPE (parm)); \ /* Passing structs by invisible reference uses \ one general register. */ \ if (arg_size > 2 \ || TREE_ADDRESSABLE (DECL_ARG_TYPE (parm))) \ arg_size = 1; \ if (arg_size == 2 && i <= 2) \ { \ if (i == 1) i++; \ fprintf (FILE, ",ARGW%d=GR", i++); \ fprintf (FILE, ",ARGW%d=GR", i++); \ } \ else if (arg_size == 1) \ fprintf (FILE, ",ARGW%d=GR", i++); \ else \ i += arg_size; \ } \ } \ /* anonymous args */ \ if (TYPE_ARG_TYPES (tree_type) != 0 \ && (TREE_VALUE (tree_last (TYPE_ARG_TYPES (tree_type)))\ != void_type_node)) \ { \ for (; i < 4; i++) \ fprintf (FILE, ",ARGW%d=GR", i); \ } \ if (TYPE_MODE (fntype) == DFmode && ! TARGET_SOFT_FLOAT) \ fputs (DFMODE_RETURN_STRING, FILE); \ else if (TYPE_MODE (fntype) == SFmode && ! TARGET_SOFT_FLOAT) \ fputs (SFMODE_RETURN_STRING, FILE); \ else if (fntype != void_type_node) \
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -