Home | History | Annotate | Line # | Download | only in ppc
      1      1.1  christos /*  This file is part of the program psim.
      2      1.1  christos 
      3      1.1  christos     Copyright 1994, 1995, 2002 Andrew Cagney <cagney (at) highland.com.au>
      4      1.1  christos 
      5      1.1  christos     This program is free software; you can redistribute it and/or modify
      6      1.1  christos     it under the terms of the GNU General Public License as published by
      7  1.1.1.2  christos     the Free Software Foundation; either version 3 of the License, or
      8      1.1  christos     (at your option) any later version.
      9      1.1  christos 
     10      1.1  christos     This program is distributed in the hope that it will be useful,
     11      1.1  christos     but WITHOUT ANY WARRANTY; without even the implied warranty of
     12      1.1  christos     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     13      1.1  christos     GNU General Public License for more details.
     14      1.1  christos 
     15      1.1  christos     You should have received a copy of the GNU General Public License
     16  1.1.1.2  christos     along with this program; if not, see <http://www.gnu.org/licenses/>.
     17      1.1  christos 
     18      1.1  christos     */
     19      1.1  christos 
     20      1.1  christos 
     21      1.1  christos #ifndef _PSIM_CONFIG_H_
     22      1.1  christos #define _PSIM_CONFIG_H_
     23      1.1  christos 
     24  1.1.1.4  christos #include "bfd.h"
     25      1.1  christos 
     26      1.1  christos /* endianness of the host/target:
     27      1.1  christos 
     28      1.1  christos    If the build process is aware (at compile time) of the endianness
     29      1.1  christos    of the host/target it is able to eliminate slower generic endian
     30      1.1  christos    handling code.
     31      1.1  christos 
     32  1.1.1.4  christos    Possible values are BFD_ENDIAN_UNKNOWN, BFD_ENDIAN_LITTLE,
     33  1.1.1.4  christos    BFD_ENDIAN_BIG.  */
     34      1.1  christos 
     35  1.1.1.4  christos #ifdef WORDS_BIGENDIAN
     36  1.1.1.4  christos # define HOST_BYTE_ORDER BFD_ENDIAN_BIG
     37  1.1.1.4  christos #else
     38  1.1.1.4  christos # define HOST_BYTE_ORDER BFD_ENDIAN_LITTLE
     39      1.1  christos #endif
     40      1.1  christos 
     41      1.1  christos #ifndef WITH_TARGET_BYTE_ORDER
     42  1.1.1.4  christos #define WITH_TARGET_BYTE_ORDER		BFD_ENDIAN_UNKNOWN
     43      1.1  christos #endif
     44      1.1  christos 
     45  1.1.1.4  christos extern enum bfd_endian current_target_byte_order;
     46  1.1.1.4  christos #define CURRENT_TARGET_BYTE_ORDER \
     47  1.1.1.4  christos   (WITH_TARGET_BYTE_ORDER != BFD_ENDIAN_UNKNOWN \
     48  1.1.1.4  christos    ? WITH_TARGET_BYTE_ORDER : current_target_byte_order)
     49      1.1  christos 
     50      1.1  christos 
     51      1.1  christos /* PowerPC XOR endian.
     52      1.1  christos 
     53      1.1  christos    In addition to the above, the simulator can support the PowerPC's
     54      1.1  christos    horrible XOR endian mode.  This feature makes it possible to
     55      1.1  christos    control the endian mode of a processor using the MSR. */
     56      1.1  christos 
     57      1.1  christos #ifndef WITH_XOR_ENDIAN
     58      1.1  christos #define WITH_XOR_ENDIAN		8
     59      1.1  christos #endif
     60      1.1  christos 
     61      1.1  christos 
     62      1.1  christos /* SMP support:
     63      1.1  christos 
     64      1.1  christos    Sets a limit on the number of processors that can be simulated.  If
     65      1.1  christos    WITH_SMP is set to zero (0), the simulator is restricted to
     66      1.1  christos    suporting only on processor (and as a consequence leaves the SMP
     67      1.1  christos    code out of the build process).
     68      1.1  christos 
     69      1.1  christos    The actual number of processors is taken from the device
     70      1.1  christos    /options/smp@<nr-cpu> */
     71      1.1  christos 
     72      1.1  christos #ifndef WITH_SMP
     73      1.1  christos #define WITH_SMP                        5
     74      1.1  christos #endif
     75      1.1  christos #if WITH_SMP
     76      1.1  christos #define MAX_NR_PROCESSORS		WITH_SMP
     77      1.1  christos #else
     78      1.1  christos #define MAX_NR_PROCESSORS		1
     79      1.1  christos #endif
     80      1.1  christos 
     81      1.1  christos 
     82  1.1.1.4  christos /* Word size of target:
     83      1.1  christos 
     84  1.1.1.4  christos    Set these according to your target requirements.  At this
     85      1.1  christos    point in time, I've only compiled (not run) for a 64bit and never
     86      1.1  christos    built for a 64bit host.  This will always remain a compile time
     87      1.1  christos    option */
     88      1.1  christos 
     89      1.1  christos #ifndef WITH_TARGET_WORD_BITSIZE
     90      1.1  christos #define WITH_TARGET_WORD_BITSIZE        32 /* compiled only */
     91      1.1  christos #endif
     92      1.1  christos 
     93  1.1.1.5  christos #ifndef WITH_TARGET_ADDRESS_BITSIZE
     94  1.1.1.5  christos #define WITH_TARGET_ADDRESS_BITSIZE	WITH_TARGET_WORD_BITSIZE
     95  1.1.1.5  christos #endif
     96  1.1.1.5  christos 
     97  1.1.1.5  christos #ifndef WITH_TARGET_CELL_BITSIZE
     98  1.1.1.5  christos #define WITH_TARGET_CELL_BITSIZE	WITH_TARGET_WORD_BITSIZE
     99  1.1.1.5  christos #endif
    100  1.1.1.5  christos 
    101      1.1  christos 
    102      1.1  christos /* Program environment:
    103      1.1  christos 
    104      1.1  christos    Three environments are available - UEA (user), VEA (virtual) and
    105      1.1  christos    OEA (perating).  The former two are environment that users would
    106      1.1  christos    expect to see (VEA includes things like coherency and the time
    107      1.1  christos    base) while OEA is what an operating system expects to see.  By
    108      1.1  christos    setting these to specific values, the build process is able to
    109  1.1.1.6  christos    eliminate non relevant environment code
    110      1.1  christos 
    111      1.1  christos    CURRENT_ENVIRONMENT specifies which of vea or oea is required for
    112      1.1  christos    the current runtime. */
    113      1.1  christos 
    114  1.1.1.4  christos #define ALL_ENVIRONMENT			0
    115      1.1  christos #define USER_ENVIRONMENT		1
    116      1.1  christos #define VIRTUAL_ENVIRONMENT		2
    117      1.1  christos #define OPERATING_ENVIRONMENT		3
    118      1.1  christos 
    119      1.1  christos extern int current_environment;
    120      1.1  christos #define CURRENT_ENVIRONMENT (WITH_ENVIRONMENT \
    121      1.1  christos 			     ? WITH_ENVIRONMENT \
    122      1.1  christos 			     : current_environment)
    123      1.1  christos 
    124      1.1  christos 
    125      1.1  christos /* Optional VEA/OEA code:
    126      1.1  christos 
    127      1.1  christos    The below, required for the OEA model may also be included in the
    128      1.1  christos    VEA model however, as far as I can tell only make things
    129      1.1  christos    slower... */
    130      1.1  christos 
    131      1.1  christos 
    132      1.1  christos /* Events.  Devices modeling real H/W need to be able to efficiently
    133      1.1  christos    schedule things to do at known times in the future.  The event
    134  1.1.1.6  christos    queue implements this.  Unfortunately this adds the need to check
    135      1.1  christos    for any events once each full instruction cycle. */
    136      1.1  christos 
    137      1.1  christos #define WITH_EVENTS                     (WITH_ENVIRONMENT != USER_ENVIRONMENT)
    138      1.1  christos 
    139      1.1  christos 
    140      1.1  christos /* Time base:
    141      1.1  christos 
    142      1.1  christos    The PowerPC architecture includes the addition of both a time base
    143      1.1  christos    register and a decrement timer.  Like events adds to the overhead
    144      1.1  christos    of of some instruction cycles. */
    145      1.1  christos 
    146      1.1  christos #ifndef WITH_TIME_BASE
    147      1.1  christos #define WITH_TIME_BASE			(WITH_ENVIRONMENT != USER_ENVIRONMENT)
    148      1.1  christos #endif
    149      1.1  christos 
    150      1.1  christos 
    151      1.1  christos /* Callback/Default Memory.
    152      1.1  christos 
    153      1.1  christos    Core includes a builtin memory type (raw_memory) that is
    154      1.1  christos    implemented using an array.  raw_memory does not require any
    155      1.1  christos    additional functions etc.
    156      1.1  christos 
    157      1.1  christos    Callback memory is where the core calls a core device for the data
    158      1.1  christos    it requires.
    159      1.1  christos 
    160      1.1  christos    Default memory is an extenstion of this where for addresses that do
    161      1.1  christos    not map into either a callback or core memory range a default map
    162      1.1  christos    can be used.
    163      1.1  christos 
    164      1.1  christos    The OEA model uses callback memory for devices and default memory
    165      1.1  christos    for buses.
    166      1.1  christos 
    167      1.1  christos    The VEA model uses callback memory to capture `page faults'.
    168      1.1  christos 
    169      1.1  christos    While it may be possible to eliminate callback/default memory (and
    170      1.1  christos    hence also eliminate an additional test per memory fetch) it
    171      1.1  christos    probably is not worth the effort.
    172      1.1  christos 
    173      1.1  christos    BTW, while raw_memory could have been implemented as a callback,
    174      1.1  christos    profiling has shown that there is a biger win (at least for the
    175      1.1  christos    x86) in eliminating a function call for the most common
    176      1.1  christos    (raw_memory) case. */
    177      1.1  christos 
    178      1.1  christos #define WITH_CALLBACK_MEMORY		1
    179      1.1  christos 
    180      1.1  christos 
    181      1.1  christos /* Alignment:
    182      1.1  christos 
    183      1.1  christos    The PowerPC may or may not handle miss aligned transfers.  An
    184      1.1  christos    implementation normally handles miss aligned transfers in big
    185      1.1  christos    endian mode but generates an exception in little endian mode.
    186      1.1  christos 
    187      1.1  christos    This model.  Instead allows both little and big endian modes to
    188      1.1  christos    either take exceptions or handle miss aligned transfers.
    189      1.1  christos 
    190  1.1.1.4  christos    If 0 is specified then for big-endian mode miss aligned accesses
    191      1.1  christos    are permitted (NONSTRICT_ALIGNMENT) while in little-endian mode the
    192      1.1  christos    processor will fault on them (STRICT_ALIGNMENT). */
    193      1.1  christos 
    194      1.1  christos #define NONSTRICT_ALIGNMENT    		1
    195      1.1  christos #define STRICT_ALIGNMENT	       	2
    196      1.1  christos 
    197      1.1  christos #ifndef WITH_ALIGNMENT
    198      1.1  christos #define WITH_ALIGNMENT     		0
    199      1.1  christos #endif
    200      1.1  christos 
    201      1.1  christos extern int current_alignment;
    202      1.1  christos #define CURRENT_ALIGNMENT (WITH_ALIGNMENT \
    203      1.1  christos 			   ? WITH_ALIGNMENT \
    204      1.1  christos 			   : current_alignment)
    205      1.1  christos 
    206      1.1  christos 
    207      1.1  christos /* Floating point suport:
    208      1.1  christos 
    209      1.1  christos    Still under development. */
    210      1.1  christos 
    211      1.1  christos #define SOFT_FLOATING_POINT		1
    212      1.1  christos #define HARD_FLOATING_POINT		2
    213      1.1  christos 
    214      1.1  christos #ifndef WITH_FLOATING_POINT
    215      1.1  christos #define WITH_FLOATING_POINT		HARD_FLOATING_POINT
    216      1.1  christos #endif
    217      1.1  christos extern int current_floating_point;
    218      1.1  christos #define CURRENT_FLOATING_POINT (WITH_FLOATING_POINT \
    219      1.1  christos 				? WITH_FLOATING_POINT \
    220      1.1  christos 				: current_floating_point)
    221      1.1  christos 
    222      1.1  christos 
    223      1.1  christos /* Debugging:
    224      1.1  christos 
    225      1.1  christos    Control the inclusion of debugging code. */
    226      1.1  christos 
    227      1.1  christos /* include monitoring code */
    228      1.1  christos 
    229      1.1  christos #define MONITOR_INSTRUCTION_ISSUE	1
    230      1.1  christos #define MONITOR_LOAD_STORE_UNIT		2
    231      1.1  christos #ifndef WITH_MON
    232      1.1  christos #define WITH_MON			(MONITOR_LOAD_STORE_UNIT \
    233      1.1  christos 					 | MONITOR_INSTRUCTION_ISSUE)
    234      1.1  christos #endif
    235      1.1  christos 
    236      1.1  christos /* Current CPU model (models are in the generated models.h include file)  */
    237      1.1  christos #ifndef WITH_MODEL
    238      1.1  christos #define WITH_MODEL			0
    239      1.1  christos #endif
    240      1.1  christos 
    241      1.1  christos #define CURRENT_MODEL (WITH_MODEL	\
    242      1.1  christos 		       ? WITH_MODEL	\
    243      1.1  christos 		       : current_model)
    244      1.1  christos 
    245      1.1  christos #ifndef WITH_DEFAULT_MODEL
    246      1.1  christos #define WITH_DEFAULT_MODEL		DEFAULT_MODEL
    247      1.1  christos #endif
    248      1.1  christos 
    249      1.1  christos #define MODEL_ISSUE_IGNORE		(-1)
    250      1.1  christos #define MODEL_ISSUE_PROCESS		1
    251      1.1  christos 
    252      1.1  christos #ifndef WITH_MODEL_ISSUE
    253      1.1  christos #define WITH_MODEL_ISSUE		0
    254      1.1  christos #endif
    255      1.1  christos 
    256      1.1  christos extern int current_model_issue;
    257      1.1  christos #define CURRENT_MODEL_ISSUE (WITH_MODEL_ISSUE	\
    258      1.1  christos 			     ? WITH_MODEL_ISSUE	\
    259      1.1  christos 			     : current_model_issue)
    260      1.1  christos 
    261      1.1  christos /* Whether or not input/output just uses stdio, or uses printf_filtered for
    262      1.1  christos    output, and polling input for input.  */
    263      1.1  christos 
    264      1.1  christos #define DONT_USE_STDIO			2
    265      1.1  christos #define DO_USE_STDIO			1
    266      1.1  christos 
    267      1.1  christos extern int current_stdio;
    268      1.1  christos #define CURRENT_STDIO (WITH_STDIO	\
    269      1.1  christos 		       ? WITH_STDIO     \
    270      1.1  christos 		       : current_stdio)
    271      1.1  christos 
    272      1.1  christos 
    273      1.1  christos 
    274      1.1  christos /* INLINE CODE SELECTION:
    275      1.1  christos 
    276      1.1  christos    GCC -O3 attempts to inline any function or procedure in scope.  The
    277      1.1  christos    options below facilitate fine grained control over what is and what
    278      1.1  christos    isn't made inline.  For instance it can control things down to a
    279      1.1  christos    specific modules static routines.  Doing this allows the compiler
    280      1.1  christos    to both eliminate the overhead of function calls and (as a
    281      1.1  christos    consequence) also eliminate further dead code.
    282      1.1  christos 
    283      1.1  christos    On a CISC (x86) I've found that I can achieve an order of magnitude
    284      1.1  christos    speed improvement (x3-x5).  In the case of RISC (sparc) while the
    285      1.1  christos    performance gain isn't as great it is still significant.
    286      1.1  christos 
    287  1.1.1.6  christos    Each module is controlled by the macro <module>_INLINE which can
    288      1.1  christos    have the values described below
    289      1.1  christos 
    290      1.1  christos        0  Do not inline any thing for the given module
    291      1.1  christos 
    292      1.1  christos    The following additional values are `bit fields' and can be
    293      1.1  christos    combined.
    294      1.1  christos 
    295      1.1  christos       REVEAL_MODULE:
    296      1.1  christos 
    297      1.1  christos          Include the C file for the module into the file being compiled
    298      1.1  christos          but do not make the functions within the module inline.
    299      1.1  christos 
    300      1.1  christos 	 While of no apparent benefit, this makes it possible for the
    301      1.1  christos 	 included module, when compiled to inline its calls to what
    302      1.1  christos 	 would otherwize be external functions.
    303      1.1  christos 
    304      1.1  christos       INLINE_MODULE:
    305      1.1  christos 
    306      1.1  christos          Make external functions within the module `inline'.  Thus if
    307      1.1  christos          the module is included into a file being compiled, calls to
    308      1.1  christos 	 its funtions can be eliminated. 2 implies 1.
    309      1.1  christos 
    310  1.1.1.4  christos       INLINE_LOCALS:
    311      1.1  christos 
    312      1.1  christos          Make internal (static) functions within the module `inline'.
    313      1.1  christos 
    314      1.1  christos    The following abreviations are available:
    315      1.1  christos 
    316      1.1  christos       INCLUDE_MODULE == (REVEAL_MODULE | INLINE_MODULE)
    317      1.1  christos 
    318  1.1.1.4  christos       ALL_C_INLINE == (REVEAL_MODULE | INLINE_MODULE | INLINE_LOCALS)
    319      1.1  christos 
    320      1.1  christos    In addition to this, modules have been put into two categories.
    321      1.1  christos 
    322      1.1  christos          Simple modules - eg sim-endian.h bits.h
    323      1.1  christos 
    324      1.1  christos 	 Because these modules are small and simple and do not have
    325      1.1  christos 	 any complex interpendencies they are configured, if
    326      1.1  christos 	 <module>_INLINE is so enabled, to inline themselves in all
    327      1.1  christos 	 modules that include those files.
    328      1.1  christos 
    329      1.1  christos 	 For the default build, this is a real win as all byte
    330      1.1  christos 	 conversion and bit manipulation functions are inlined.
    331      1.1  christos 
    332      1.1  christos 	 Complex modules - the rest
    333      1.1  christos 
    334      1.1  christos 	 These are all handled using the files inline.h and inline.c.
    335      1.1  christos 	 psim.c includes the above which in turn include any remaining
    336      1.1  christos 	 code.
    337      1.1  christos 
    338      1.1  christos    IMPLEMENTATION:
    339      1.1  christos 
    340      1.1  christos    The inline ability is enabled by prefixing every data / function
    341      1.1  christos    declaration and definition with one of the following:
    342      1.1  christos 
    343      1.1  christos 
    344      1.1  christos        INLINE_<module>
    345      1.1  christos 
    346      1.1  christos        Prefix to any global function that is a candidate for being
    347      1.1  christos        inline.
    348      1.1  christos 
    349      1.1  christos        values - `', `static', `static INLINE'
    350      1.1  christos 
    351      1.1  christos 
    352      1.1  christos        EXTERN_<module>
    353      1.1  christos 
    354      1.1  christos        Prefix to any global data structures for the module.  Global
    355      1.1  christos        functions that are not to be inlined shall also be prefixed
    356      1.1  christos        with this.
    357      1.1  christos 
    358      1.1  christos        values - `', `static', `static'
    359      1.1  christos 
    360      1.1  christos 
    361      1.1  christos        STATIC_INLINE_<module>
    362      1.1  christos 
    363      1.1  christos        Prefix to any local (static) function that is a candidate for
    364      1.1  christos        being made inline.
    365      1.1  christos 
    366      1.1  christos        values - `static', `static INLINE'
    367      1.1  christos 
    368      1.1  christos 
    369      1.1  christos        static
    370      1.1  christos 
    371      1.1  christos        Prefix all local data structures.  Local functions that are not
    372      1.1  christos        to be inlined shall also be prefixed with this.
    373      1.1  christos 
    374      1.1  christos        values - `static', `static'
    375      1.1  christos 
    376      1.1  christos        nb: will not work for modules that are being inlined for every
    377      1.1  christos        use (white lie).
    378      1.1  christos 
    379      1.1  christos 
    380      1.1  christos        extern
    381      1.1  christos        #ifndef _INLINE_C_
    382      1.1  christos        #endif
    383      1.1  christos 
    384      1.1  christos        Prefix to any declaration of a global object (function or
    385      1.1  christos        variable) that should not be inlined and should have only one
    386      1.1  christos        definition.  The #ifndef wrapper goes around the definition
    387  1.1.1.6  christos        proper to ensure that only one copy is generated.
    388      1.1  christos 
    389      1.1  christos        nb: this will not work when a module is being inlined for every
    390      1.1  christos        use.
    391      1.1  christos 
    392      1.1  christos 
    393      1.1  christos        STATIC_<module>
    394      1.1  christos 
    395      1.1  christos        Replaced by either `static' or `EXTERN_MODULE'.
    396      1.1  christos 
    397      1.1  christos 
    398      1.1  christos    REALITY CHECK:
    399      1.1  christos 
    400      1.1  christos    This is not for the faint hearted.  I've seen GCC get up to 500mb
    401      1.1  christos    trying to compile what this can create.
    402      1.1  christos 
    403      1.1  christos    Some of the modules do not yet implement the WITH_INLINE_STATIC
    404      1.1  christos    option.  Instead they use the macro STATIC_INLINE to control their
    405      1.1  christos    local function.
    406      1.1  christos 
    407      1.1  christos    Because of the way that GCC parses __attribute__(), the macro's
    408      1.1  christos    need to be adjacent to the function name rather than at the start
    409      1.1  christos    of the line vis:
    410      1.1  christos 
    411      1.1  christos    	int STATIC_INLINE_MODULE f(void);
    412      1.1  christos 	void INLINE_MODULE *g(void);
    413      1.1  christos 
    414      1.1  christos    */
    415      1.1  christos 
    416  1.1.1.4  christos #include "../common/sim-inline.h"
    417  1.1.1.4  christos #define REVEAL_MODULE			H_REVEALS_MODULE
    418  1.1.1.4  christos #define INLINE_MODULE			C_REVEALS_MODULE
    419      1.1  christos #define INCLUDE_MODULE			(INLINE_MODULE | REVEAL_MODULE)
    420      1.1  christos 
    421      1.1  christos /* Your compilers inline reserved word */
    422      1.1  christos 
    423      1.1  christos #ifndef INLINE
    424      1.1  christos #if defined(__GNUC__) && defined(__OPTIMIZE__)
    425      1.1  christos #define INLINE __inline__
    426      1.1  christos #else
    427      1.1  christos #define INLINE /*inline*/
    428      1.1  christos #endif
    429      1.1  christos #endif
    430      1.1  christos 
    431      1.1  christos 
    432      1.1  christos /* Default prefix for static functions */
    433      1.1  christos 
    434      1.1  christos #ifndef STATIC_INLINE
    435      1.1  christos #define STATIC_INLINE static INLINE
    436      1.1  christos #endif
    437      1.1  christos 
    438      1.1  christos /* Default macro to simplify control several of key the inlines */
    439      1.1  christos 
    440      1.1  christos #ifndef DEFAULT_INLINE
    441  1.1.1.4  christos #define	DEFAULT_INLINE			INLINE_LOCALS
    442      1.1  christos #endif
    443      1.1  christos 
    444      1.1  christos /* Code that converts between hosts and target byte order.  Used on
    445      1.1  christos    every memory access (instruction and data).  See sim-endian.h for
    446      1.1  christos    additional byte swapping configuration information.  This module
    447      1.1  christos    can inline for all callers */
    448      1.1  christos 
    449      1.1  christos #ifndef SIM_ENDIAN_INLINE
    450  1.1.1.4  christos #define SIM_ENDIAN_INLINE		(DEFAULT_INLINE ? ALL_C_INLINE : 0)
    451      1.1  christos #endif
    452      1.1  christos 
    453      1.1  christos /* Low level bit manipulation routines. This module can inline for all
    454      1.1  christos    callers */
    455      1.1  christos 
    456      1.1  christos #ifndef BITS_INLINE
    457  1.1.1.4  christos #define BITS_INLINE			(DEFAULT_INLINE ? ALL_C_INLINE : 0)
    458      1.1  christos #endif
    459      1.1  christos 
    460      1.1  christos /* Code that gives access to various CPU internals such as registers.
    461      1.1  christos    Used every time an instruction is executed */
    462      1.1  christos 
    463      1.1  christos #ifndef CPU_INLINE
    464  1.1.1.4  christos #define CPU_INLINE			(DEFAULT_INLINE ? ALL_C_INLINE : 0)
    465      1.1  christos #endif
    466      1.1  christos 
    467      1.1  christos /* Code that translates between an effective and real address.  Used
    468      1.1  christos    by every load or store. */
    469      1.1  christos 
    470      1.1  christos #ifndef VM_INLINE
    471      1.1  christos #define VM_INLINE			DEFAULT_INLINE
    472      1.1  christos #endif
    473      1.1  christos 
    474      1.1  christos /* Code that loads/stores data to/from the memory data structure.
    475      1.1  christos    Used by every load or store */
    476      1.1  christos 
    477      1.1  christos #ifndef CORE_INLINE
    478      1.1  christos #define CORE_INLINE			DEFAULT_INLINE
    479      1.1  christos #endif
    480      1.1  christos 
    481      1.1  christos /* Code to check for and process any events scheduled in the future.
    482      1.1  christos    Called once per instruction cycle */
    483      1.1  christos 
    484      1.1  christos #ifndef EVENTS_INLINE
    485  1.1.1.4  christos #define EVENTS_INLINE			(DEFAULT_INLINE ? ALL_C_INLINE : 0)
    486      1.1  christos #endif
    487      1.1  christos 
    488      1.1  christos /* Code monotoring the processors performance.  It counts events on
    489      1.1  christos    every instruction cycle */
    490      1.1  christos 
    491      1.1  christos #ifndef MON_INLINE
    492  1.1.1.4  christos #define MON_INLINE			(DEFAULT_INLINE ? ALL_C_INLINE : 0)
    493      1.1  christos #endif
    494      1.1  christos 
    495      1.1  christos /* Code called on the rare occasions that an interrupt occures. */
    496      1.1  christos 
    497      1.1  christos #ifndef INTERRUPTS_INLINE
    498      1.1  christos #define INTERRUPTS_INLINE		DEFAULT_INLINE
    499      1.1  christos #endif
    500      1.1  christos 
    501      1.1  christos /* Code called on the rare occasion that either gdb or the device tree
    502      1.1  christos    need to manipulate a register within a processor */
    503      1.1  christos 
    504      1.1  christos #ifndef REGISTERS_INLINE
    505      1.1  christos #define REGISTERS_INLINE		DEFAULT_INLINE
    506      1.1  christos #endif
    507      1.1  christos 
    508      1.1  christos /* Code called on the rare occasion that a processor is manipulating
    509      1.1  christos    real hardware instead of RAM.
    510      1.1  christos 
    511      1.1  christos    Also, most of the functions in devices.c are always called through
    512      1.1  christos    a jump table. */
    513      1.1  christos 
    514      1.1  christos #ifndef DEVICE_INLINE
    515  1.1.1.4  christos #define DEVICE_INLINE			(DEFAULT_INLINE ? INLINE_LOCALS : 0)
    516      1.1  christos #endif
    517      1.1  christos 
    518      1.1  christos /* Code called used while the device tree is being built.
    519      1.1  christos 
    520      1.1  christos    Inlining this is of no benefit */
    521      1.1  christos 
    522      1.1  christos #ifndef TREE_INLINE
    523  1.1.1.4  christos #define TREE_INLINE			(DEFAULT_INLINE ? INLINE_LOCALS : 0)
    524      1.1  christos #endif
    525      1.1  christos 
    526      1.1  christos /* Code called whenever information on a Special Purpose Register is
    527      1.1  christos    required.  Called by the mflr/mtlr pseudo instructions */
    528      1.1  christos 
    529      1.1  christos #ifndef SPREG_INLINE
    530      1.1  christos #define SPREG_INLINE			DEFAULT_INLINE
    531      1.1  christos #endif
    532      1.1  christos 
    533      1.1  christos /* Functions modeling the semantics of each instruction.  Two cases to
    534      1.1  christos    consider, firstly of idecode is implemented with a switch then this
    535      1.1  christos    allows the idecode function to inline each semantic function
    536      1.1  christos    (avoiding a call).  The second case is when idecode is using a
    537      1.1  christos    table, even then while the semantic functions can't be inlined,
    538      1.1  christos    setting it to one still enables each semantic function to inline
    539      1.1  christos    anything they call (if that code is marked for being inlined).
    540      1.1  christos 
    541      1.1  christos    WARNING: you need lots (like 200mb of swap) of swap.  Setting this
    542      1.1  christos    to 1 is useful when using a table as it enables the sematic code to
    543      1.1  christos    inline all of their called functions */
    544      1.1  christos 
    545      1.1  christos #ifndef SEMANTICS_INLINE
    546      1.1  christos #define SEMANTICS_INLINE		(DEFAULT_INLINE & ~INLINE_MODULE)
    547      1.1  christos #endif
    548      1.1  christos 
    549      1.1  christos /* When using the instruction cache, code to decode an instruction and
    550      1.1  christos    install it into the cache.  Normally called when ever there is a
    551      1.1  christos    miss in the instruction cache. */
    552      1.1  christos 
    553      1.1  christos #ifndef ICACHE_INLINE
    554      1.1  christos #define ICACHE_INLINE			(DEFAULT_INLINE & ~INLINE_MODULE)
    555      1.1  christos #endif
    556      1.1  christos 
    557      1.1  christos /* General functions called by semantics functions but part of the
    558      1.1  christos    instruction table.  Although called by the semantic functions the
    559      1.1  christos    frequency of calls is low.  Consequently the need to inline this
    560      1.1  christos    code is reduced. */
    561      1.1  christos 
    562      1.1  christos #ifndef SUPPORT_INLINE
    563  1.1.1.4  christos #define SUPPORT_INLINE			INLINE_LOCALS
    564      1.1  christos #endif
    565      1.1  christos 
    566      1.1  christos /* Model specific code used in simulating functional units.  Note, it actaully
    567      1.1  christos    pays NOT to inline the PowerPC model functions (at least on the x86).  This
    568      1.1  christos    is because if it is inlined, each PowerPC instruction gets a separate copy
    569      1.1  christos    of the code, which is not friendly to the cache.  */
    570      1.1  christos 
    571      1.1  christos #ifndef MODEL_INLINE
    572      1.1  christos #define	MODEL_INLINE			(DEFAULT_INLINE & ~INLINE_MODULE)
    573      1.1  christos #endif
    574      1.1  christos 
    575      1.1  christos /* Code to print out what options we were compiled with.  Because this
    576      1.1  christos    is called at process startup, it doesn't have to be inlined, but
    577      1.1  christos    if it isn't brought in and the model routines are inline, the model
    578      1.1  christos    routines will be pulled in twice.  */
    579      1.1  christos 
    580      1.1  christos #ifndef OPTIONS_INLINE
    581      1.1  christos #define OPTIONS_INLINE			MODEL_INLINE
    582      1.1  christos #endif
    583      1.1  christos 
    584      1.1  christos /* idecode acts as the hub of the system, everything else is imported
    585      1.1  christos    into this file */
    586      1.1  christos 
    587      1.1  christos #ifndef IDECOCE_INLINE
    588  1.1.1.4  christos #define IDECODE_INLINE			INLINE_LOCALS
    589      1.1  christos #endif
    590      1.1  christos 
    591      1.1  christos /* psim, isn't actually inlined */
    592      1.1  christos 
    593      1.1  christos #ifndef PSIM_INLINE
    594  1.1.1.4  christos #define PSIM_INLINE			INLINE_LOCALS
    595      1.1  christos #endif
    596      1.1  christos 
    597      1.1  christos /* Code to emulate os or rom compatibility.  This code is called via a
    598      1.1  christos    table and hence there is little benefit in making it inline */
    599      1.1  christos 
    600      1.1  christos #ifndef OS_EMUL_INLINE
    601      1.1  christos #define OS_EMUL_INLINE			0
    602      1.1  christos #endif
    603      1.1  christos 
    604      1.1  christos #endif /* _PSIM_CONFIG_H */
    605