home *** CD-ROM | disk | FTP | other *** search
/ H4CK3R 4 / hacker04 / 04_HACK04.ISO / darwin / darwinx86.iso / usr / local / include / mach-o / i860 / reloc.h next >
Encoding:
C/C++ Source or Header  |  2001-09-14  |  3.8 KB  |  80 lines

  1. /*
  2.  * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
  3.  *
  4.  * @APPLE_LICENSE_HEADER_START@
  5.  * 
  6.  * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
  7.  * Reserved.  This file contains Original Code and/or Modifications of
  8.  * Original Code as defined in and that are subject to the Apple Public
  9.  * Source License Version 1.1 (the "License").  You may not use this file
  10.  * except in compliance with the License.  Please obtain a copy of the
  11.  * License at http://www.apple.com/publicsource and read it before using
  12.  * this file.
  13.  * 
  14.  * The Original Code and all software distributed under the License are
  15.  * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
  16.  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
  17.  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
  18.  * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT.  Please see the
  19.  * License for the specific language governing rights and limitations
  20.  * under the License.
  21.  * 
  22.  * @APPLE_LICENSE_HEADER_END@
  23.  */
  24. /*
  25.  * Relocation types used in the I860 implementation.  Relocation entries for
  26.  * things other than instructions use the same generic relocation as discribed
  27.  * above and their r_type is RELOC_VANILLA.  The rest of the relocation types
  28.  * are for instructions.  Since they are for instructions the r_address field
  29.  * indicates the 32 bit instruction that the relocation is to be preformed on.
  30.  * The fields r_pcrel and r_length are ignored for non-RELOC_VANILLA r_types
  31.  * except RELOC_SPLIT0 as discribed below.
  32.  */
  33. enum reloc_type_i860
  34. {
  35.     I860_RELOC_VANILLA,    /* generic relocation as discribed above */
  36.  
  37.     I860_RELOC_PAIR,    /* Only follows a I860_RELOC_HIGH or a
  38.              * I860_RELOC_HIGHADJ and only the r_address has any
  39.              * meaning.
  40.              */ 
  41.     I860_RELOC_HIGH,    /* The low 16 bits of the instruction contains the high
  42.              * 16 bits of the item being refered to.  This
  43.              * relocation type must be followed by a I860_RELOC_PAIR
  44.              * relocation type.  The low 16 bits of the item being
  45.              * refered to is stored in the r_address of the
  46.              * I860_RELOC_PAIR entry.
  47.              */
  48.     I860_RELOC_LOW0,    /* For all of these the low 16 bits of the instruction*/
  49.     I860_RELOC_LOW1,    /* (minus the low 0, 1, 2, 3, or 4 bits) contain the  */
  50.     I860_RELOC_LOW2,    /* low 16 bits of the item being refered to.  The bits*/
  51.     I860_RELOC_LOW3,    /* of the reference that are missing are 0 and the    */
  52.     I860_RELOC_LOW4,    /* bits in the instruction are part of the encoding of*/
  53.             /* instruction.  The resulting low 16 bits of the item*/
  54.             /* being refered to is sign extended to 32 bits.      */
  55.  
  56.     I860_RELOC_SPLIT0,    /* For all of these the bits 20-14 and bits 10-0 of   */
  57.     I860_RELOC_SPLIT1,    /* the instruction (minus the low 0, 1 or 2 bits)     */
  58.     I860_RELOC_SPLIT2,    /* contain the low 16 bits of the item to being       */
  59.             /* refered to.  The bits of the reference that are    */
  60.             /* missing are 0 and the bits of the instruction are  */
  61.             /* part of the encoding of the instruction.  The      */
  62.             /* resulting low 16 bits of the item being relocated  */
  63.             /* is sign extened to 32 bits.  A special case of the */
  64.             /* I860_RELOC_SPLIT0 is when r_pcrel is non-zero (for */
  65.             /* branch displacements).  In this case the 16 bits   */
  66.             /* from the instruction is a 32 bit word displacement.*/
  67.  
  68.     I860_RELOC_HIGHADJ,    /* Same as the RELOC_HIGH except the low 16 bits and the
  69.              * high 16 bits are added together with the low 16 bits
  70.              * sign extened first.  This means if bit 15 of the low
  71.              * 16 bits is set the high 16 bits stored in the
  72.              * instruction will be adjusted.
  73.              */
  74.     I860_RELOC_BRADDR,    /* The low 26 bits of the instruction is a 32 bit
  75.              * word displacement from the pc to the item to being
  76.              * refered to.
  77.              */
  78.     I860_RELOC_SECTDIFF /* a PAIR follows with subtract symbol value */
  79. };
  80.