home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / bsd_srcs / sys / vax / inline / inline.h next >
Encoding:
C/C++ Source or Header  |  1991-05-08  |  3.8 KB  |  109 lines

  1. /*-
  2.  * Copyright (c) 1984, 1986 The Regents of the University of California.
  3.  * All rights reserved.
  4.  *
  5.  * Redistribution and use in source and binary forms, with or without
  6.  * modification, are permitted provided that the following conditions
  7.  * are met:
  8.  * 1. Redistributions of source code must retain the above copyright
  9.  *    notice, this list of conditions and the following disclaimer.
  10.  * 2. Redistributions in binary form must reproduce the above copyright
  11.  *    notice, this list of conditions and the following disclaimer in the
  12.  *    documentation and/or other materials provided with the distribution.
  13.  * 3. All advertising materials mentioning features or use of this software
  14.  *    must display the following acknowledgement:
  15.  *    This product includes software developed by the University of
  16.  *    California, Berkeley and its contributors.
  17.  * 4. Neither the name of the University nor the names of its contributors
  18.  *    may be used to endorse or promote products derived from this software
  19.  *    without specific prior written permission.
  20.  *
  21.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  22.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  23.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  24.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  25.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  26.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  27.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  28.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  29.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  30.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  31.  * SUCH DAMAGE.
  32.  *
  33.  *    @(#)inline.h    7.2 (Berkeley) 5/8/91
  34.  */
  35.  
  36. /*
  37.  * COMMENTCHAR is the character delimiting comments in the assembler.
  38.  * LABELCHAR is the character that separates labels from instructions.
  39.  * ARGSEPCHAR is the character that separates arguments in instructions.
  40.  */
  41. #define COMMENTCHAR    '#'
  42. #define LABELCHAR    ':'
  43. #define ARGSEPCHAR    ','
  44.  
  45. /*
  46.  * Expansion parameters:
  47.  *   QUEUESIZE is the number of instructions to be considered for 
  48.  *    integration of argument pushes and pops
  49.  *   MAXLINELEN is the longest expected input line
  50.  *   MAXARGS is the maximum number of arguments in an assembly instruction
  51.  */
  52. #define QUEUESIZE    16
  53. #define MAXLINELEN    1024
  54. #define MAXARGS        10
  55.  
  56. /*
  57.  * The following global variables are used to manipulate the queue of
  58.  * recently seen instructions.
  59.  *    line - The queue of instructions.
  60.  *    bufhead - Pointer to next availble queue slot. It is not
  61.  *        considered part of te instruction stream until
  62.  *        bufhead is advanced.
  63.  *    buftail - Pointer to last instruction in queue.
  64.  * Note that bufhead == buftail implies that the queue is empty.
  65.  */
  66. int bufhead, buftail;
  67. char line[QUEUESIZE][MAXLINELEN];
  68.  
  69. #define SUCC(qindex) ((qindex) + 1 == QUEUESIZE ? 0 : (qindex) + 1)
  70. #define PRED(qindex) ((qindex) - 1 < 0 ? QUEUESIZE - 1 : (qindex) - 1)
  71.  
  72. /*
  73.  * Hash table headers should be twice as big as the number of patterns.
  74.  * They must be a power of two.
  75.  */
  76. #define HSHSIZ    128
  77.  
  78. /*
  79.  * These tables specify the substitutions that are to be done.
  80.  */
  81. struct pats {
  82.     int    args;
  83.     char    *name;
  84.     char    *replace;
  85.     struct    pats *next;
  86.     int    size;
  87. };
  88. struct pats *patshdr[HSHSIZ];
  89. extern struct pats language_ptab[], libc_ptab[], machine_ptab[];
  90. extern struct pats vax_libc_ptab[], vaxsubset_libc_ptab[];
  91. extern struct pats vax_ptab[], vaxsubset_ptab[];
  92.  
  93. /*
  94.  * This table defines the set of instructions that demark the
  95.  * end of a basic block.
  96.  */
  97. struct inststoptbl {
  98.     char    *name;
  99.     struct    inststoptbl *next;
  100.     int    size;
  101. };
  102. struct inststoptbl *inststoptblhdr[HSHSIZ];
  103. extern struct inststoptbl inststoptable[];
  104.  
  105. /*
  106.  * Miscellaneous functions.
  107.  */
  108. char *newline(), *copyline(), *doreplaceon();
  109.