1 /* @(#)avoffset.h 1.13 13/08/26 Copyright 1995-2013 J. Schilling */ 2 /* 3 * Platform dependent definitions for stack scanning. 4 * 5 * Copyright (c) 1995-2013 J. Schilling 6 */ 7 /* 8 * The contents of this file are subject to the terms of the 9 * Common Development and Distribution License, Version 1.0 only 10 * (the "License"). You may not use this file except in compliance 11 * with the License. 12 * 13 * See the file CDDL.Schily.txt in this distribution for details. 14 * A copy of the CDDL is also available via the Internet at 15 * http://www.opensource.org/licenses/cddl1.txt 16 * 17 * When distributing Covered Code, include this CDDL HEADER in each 18 * file and include the License file CDDL.Schily.txt from this distribution. 19 */ 20 21 /* 22 * This file includes definitions for STACK_DIRECTION, 23 * AV_OFFSET and FP_INDIR. 24 * 25 * STACK_DIRECTION: 26 * +1 -> stack grows to larger addresses 27 * -1 -> stack "groes" to lower addresses 28 * 29 * FP_INDIR: the number of fp chain elements above 'main'. 30 * 31 * AV_OFFSET: the offset of &av[0] relative to the frame pointer 32 * in 'main'. 33 * 34 * If getav0() does not work on a specific architecture 35 * the program which generated this automaticly generated include file 36 * may dump core. In this case, the generated include file does not include 37 * definitions for AV_OFFSET and FP_INDIR but ends after the 38 * STACK_DIRECTION definition. 39 * If AV_OFFSET or FP_INDIR are missing in the file, all code 40 * that use the definitions are automatically disabled. 41 */ 42 #ifndef _SCHILY_AVOFFSET_H 43 #define _SCHILY_AVOFFSET_H 44 45 #ifndef _SCHILY_MCONFIG_H 46 #include <schily/mconfig.h> 47 #endif 48 49 #ifdef SCHILY_BUILD /* #defined by Schily makefile system */ 50 /* 51 * Include $(SRCROOT)/incs/$(OARCH)/avoffset.h via 52 * -I$(SRCROOT)/incs/$(OARCH)/ 53 */ 54 # include <avoffset.h> 55 #else /* !SCHILY_BUILD */ 56 /* 57 * The stuff for static compilation. Include files from a previous 58 * dynamic autoconfiguration. 59 */ 60 #ifdef __SUNOS5_SPARC_CC32 61 #include <schily/sparc-sunos5-cc/avoffset.h> 62 #define __JS_ARCH_AVOFFSET_INCL 63 #endif 64 #ifdef __SUNOS5_SPARC_CC64 65 #include <schily/sparc-sunos5-cc64/avoffset.h> 66 #define __JS_ARCH_AVOFFSET_INCL 67 #endif 68 #ifdef __SUNOS5_SPARC_GCC32 69 #include <schily/sparc-sunos5-gcc/avoffset.h> 70 #define __JS_ARCH_AVOFFSET_INCL 71 #endif 72 #ifdef __SUNOS5_SPARC_GCC64 73 #include <schily/sparc-sunos5-gcc64/avoffset.h> 74 #define __JS_ARCH_AVOFFSET_INCL 75 #endif 76 #ifdef __SUNOS5_X86_CC32 77 #include <schily/i386-sunos5-cc/avoffset.h> 78 #define __JS_ARCH_AVOFFSET_INCL 79 #endif 80 #ifdef __SUNOS5_X86_CC64 81 #include <schily/i386-sunos5-cc64/avoffset.h> 82 #define __JS_ARCH_AVOFFSET_INCL 83 #endif 84 #ifdef __SUNOS5_X86_GCC32 85 #include <schily/i386-sunos5-gcc/avoffset.h> 86 #define __JS_ARCH_AVOFFSET_INCL 87 #endif 88 #ifdef __SUNOS5_X86_GCC64 89 #include <schily/i386-sunos5-gcc64/avoffset.h> 90 #define __JS_ARCH_AVOFFSET_INCL 91 #endif 92 93 #ifdef __HPUX_HPPA_CC32 94 #include <schily/hppa-hp-ux-cc/avoffset.h> 95 #define __JS_ARCH_CONF_INCL 96 #endif 97 #ifdef __HPUX_HPPA_CC64 98 #include <schily/hppa-hp-ux-cc64/avoffset.h> 99 #define __JS_ARCH_CONF_INCL 100 #endif 101 #ifdef __HPUX_HPPA_GCC32 102 #include <schily/hppa-hp-ux-gcc/avoffset.h> 103 #define __JS_ARCH_CONF_INCL 104 #endif 105 #ifdef __HPUX_HPPA_GCC64 106 #include <schily/hppa-hp-ux-gcc64/avoffset.h> 107 #define __JS_ARCH_CONF_INCL 108 #endif 109 110 #ifdef __LINUX_ARMV6L_GCC32 111 #include <schily/armv6l-linux-gcc/avoffset.h> 112 #define __JS_ARCH_CONF_INCL 113 #endif 114 #ifdef __LINUX_ARMV5L_GCC32 115 #include <schily/armv6l-linux-gcc/avoffset.h> 116 #define __JS_ARCH_CONF_INCL 117 #endif 118 #ifdef __LINUX_ARMV5TEJL_GCC32 119 #include <schily/armv5tejl-linux-gcc/avoffset.h> 120 #define __JS_ARCH_CONF_INCL 121 #endif 122 #ifdef __LINUX_I386_GCC32 123 #include <schily/i686-linux-gcc/avoffset.h> 124 #define __JS_ARCH_CONF_INCL 125 #endif 126 #ifdef __LINUX_amd64_GCC64 127 #include <schily/x86_64-linux-gcc/avoffset.h> 128 #define __JS_ARCH_CONF_INCL 129 #endif 130 131 #ifdef __MSWIN_X86_CL32 132 #include <schily/i686-cygwin32_nt-cl/avoffset.h> 133 #define __JS_ARCH_AVOFFSET_INCL 134 #endif 135 136 #ifdef __CYGWIN_X86_GCC 137 #include <schily/i686-cygwin32_nt-gcc/avoffset.h> 138 #define __JS_ARCH_AVOFFSET_INCL 139 #endif 140 141 #ifndef __JS_ARCH_AVOFFSET_INCL 142 /* 143 * #error will not work for all compilers (e.g. sunos4) 144 * The following line will abort compilation on all compilers 145 * if none of the above is defined. And that's what we want. 146 */ 147 Error unconfigured architecture 148 149 #include <schily/err_arch.h> /* Avoid "unknown directive" with K&R */ 150 #endif 151 152 #endif /* SCHILY_BUILD */ 153 154 #ifdef __cplusplus 155 extern "C" { 156 #endif 157 /* 158 * Fake in order to keep the silly hdrchk(1) quiet. 159 */ 160 #ifdef __cplusplus 161 } 162 #endif 163 164 #endif /* _SCHILY_AVOFFSET_H */ 165