Home | History | Annotate | Line # | Download | only in sljit_src
sljitConfig.h revision 1.6.2.3
      1  1.6.2.3    tls /*	$NetBSD: sljitConfig.h,v 1.6.2.3 2014/08/20 00:04:25 tls Exp $	*/
      2  1.6.2.3    tls 
      3  1.6.2.2  alnsn /*
      4  1.6.2.2  alnsn  *    Stack-less Just-In-Time compiler
      5  1.6.2.2  alnsn  *
      6  1.6.2.2  alnsn  *    Copyright 2009-2012 Zoltan Herczeg (hzmester (at) freemail.hu). All rights reserved.
      7  1.6.2.2  alnsn  *
      8  1.6.2.2  alnsn  * Redistribution and use in source and binary forms, with or without modification, are
      9  1.6.2.2  alnsn  * permitted provided that the following conditions are met:
     10  1.6.2.2  alnsn  *
     11  1.6.2.2  alnsn  *   1. Redistributions of source code must retain the above copyright notice, this list of
     12  1.6.2.2  alnsn  *      conditions and the following disclaimer.
     13  1.6.2.2  alnsn  *
     14  1.6.2.2  alnsn  *   2. Redistributions in binary form must reproduce the above copyright notice, this list
     15  1.6.2.2  alnsn  *      of conditions and the following disclaimer in the documentation and/or other materials
     16  1.6.2.2  alnsn  *      provided with the distribution.
     17  1.6.2.2  alnsn  *
     18  1.6.2.2  alnsn  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND CONTRIBUTORS ``AS IS'' AND ANY
     19  1.6.2.2  alnsn  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     20  1.6.2.2  alnsn  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
     21  1.6.2.2  alnsn  * SHALL THE COPYRIGHT HOLDER(S) OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
     22  1.6.2.2  alnsn  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
     23  1.6.2.2  alnsn  * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
     24  1.6.2.2  alnsn  * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     25  1.6.2.2  alnsn  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
     26  1.6.2.2  alnsn  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     27  1.6.2.2  alnsn  */
     28  1.6.2.2  alnsn 
     29  1.6.2.2  alnsn #ifndef _SLJIT_CONFIG_H_
     30  1.6.2.2  alnsn #define _SLJIT_CONFIG_H_
     31  1.6.2.2  alnsn 
     32  1.6.2.2  alnsn /* --------------------------------------------------------------------- */
     33  1.6.2.2  alnsn /*  Custom defines                                                       */
     34  1.6.2.2  alnsn /* --------------------------------------------------------------------- */
     35  1.6.2.2  alnsn 
     36  1.6.2.2  alnsn /* Put your custom defines here. This empty section will never change
     37  1.6.2.2  alnsn    which helps maintaining patches (with diff / patch utilities). */
     38  1.6.2.2  alnsn 
     39  1.6.2.2  alnsn /* --------------------------------------------------------------------- */
     40  1.6.2.2  alnsn /*  Architecture                                                         */
     41  1.6.2.2  alnsn /* --------------------------------------------------------------------- */
     42  1.6.2.2  alnsn 
     43  1.6.2.2  alnsn /* Architecture selection. */
     44  1.6.2.2  alnsn /* #define SLJIT_CONFIG_X86_32 1 */
     45  1.6.2.2  alnsn /* #define SLJIT_CONFIG_X86_64 1 */
     46  1.6.2.2  alnsn /* #define SLJIT_CONFIG_ARM_V5 1 */
     47  1.6.2.2  alnsn /* #define SLJIT_CONFIG_ARM_V7 1 */
     48  1.6.2.2  alnsn /* #define SLJIT_CONFIG_ARM_THUMB2 1 */
     49  1.6.2.3    tls /* #define SLJIT_CONFIG_ARM_64 1 */
     50  1.6.2.2  alnsn /* #define SLJIT_CONFIG_PPC_32 1 */
     51  1.6.2.2  alnsn /* #define SLJIT_CONFIG_PPC_64 1 */
     52  1.6.2.2  alnsn /* #define SLJIT_CONFIG_MIPS_32 1 */
     53  1.6.2.3    tls /* #define SLJIT_CONFIG_MIPS_64 1 */
     54  1.6.2.2  alnsn /* #define SLJIT_CONFIG_SPARC_32 1 */
     55  1.6.2.3    tls /* #define SLJIT_CONFIG_TILEGX 1 */
     56  1.6.2.2  alnsn 
     57  1.6.2.2  alnsn /* #define SLJIT_CONFIG_AUTO 1 */
     58  1.6.2.2  alnsn /* #define SLJIT_CONFIG_UNSUPPORTED 1 */
     59  1.6.2.2  alnsn 
     60  1.6.2.3    tls #include <machine/sljit_machdep.h>
     61  1.6.2.2  alnsn 
     62  1.6.2.2  alnsn #if defined(_KERNEL) && !defined(SLJIT_MALLOC)
     63  1.6.2.2  alnsn #define SLJIT_MALLOC(size) malloc((size), M_TEMP, M_WAITOK)
     64  1.6.2.2  alnsn #endif
     65  1.6.2.2  alnsn 
     66  1.6.2.2  alnsn #if defined(_KERNEL) && !defined(SLJIT_FREE)
     67  1.6.2.2  alnsn #define SLJIT_FREE(ptr) free((ptr), M_TEMP)
     68  1.6.2.2  alnsn #endif
     69  1.6.2.2  alnsn 
     70  1.6.2.2  alnsn #if defined(_KERNEL) && !defined(SLJIT_CACHE_FLUSH)
     71  1.6.2.3    tls #error "SLJIT_CACHE_FLUSH must be defined."
     72  1.6.2.2  alnsn #endif
     73  1.6.2.2  alnsn 
     74  1.6.2.2  alnsn 
     75  1.6.2.2  alnsn #ifdef _KERNEL
     76  1.6.2.2  alnsn 
     77  1.6.2.2  alnsn #ifdef DIAGNOSTIC
     78  1.6.2.2  alnsn #define SLJIT_DEBUG 1
     79  1.6.2.2  alnsn #else
     80  1.6.2.2  alnsn #define SLJIT_DEBUG 0
     81  1.6.2.2  alnsn #endif
     82  1.6.2.2  alnsn 
     83  1.6.2.2  alnsn #define SLJIT_ASSERT(x) KASSERT(x)
     84  1.6.2.2  alnsn #define SLJIT_ASSERT_STOP() \
     85  1.6.2.2  alnsn 	panic("Should never been reached " __FILE__ ":%d\n", __LINE__)
     86  1.6.2.2  alnsn #endif
     87  1.6.2.2  alnsn 
     88  1.6.2.2  alnsn #ifdef _KERNEL
     89  1.6.2.2  alnsn #define SLJIT_VERBOSE 0
     90  1.6.2.2  alnsn #endif
     91  1.6.2.2  alnsn 
     92  1.6.2.2  alnsn #ifdef _KERNEL
     93  1.6.2.3    tls #define SLJIT_IS_FPU_AVAILABLE 0
     94  1.6.2.3    tls #endif
     95  1.6.2.3    tls 
     96  1.6.2.3    tls #ifdef _KERNEL
     97  1.6.2.2  alnsn #include <sys/cdefs.h>
     98  1.6.2.2  alnsn #include <sys/malloc.h>
     99  1.6.2.2  alnsn #include <sys/param.h>
    100  1.6.2.2  alnsn #endif
    101  1.6.2.2  alnsn 
    102  1.6.2.2  alnsn /* --------------------------------------------------------------------- */
    103  1.6.2.2  alnsn /*  Utilities                                                            */
    104  1.6.2.2  alnsn /* --------------------------------------------------------------------- */
    105  1.6.2.2  alnsn 
    106  1.6.2.2  alnsn /* Useful for thread-safe compiling of global functions. */
    107  1.6.2.2  alnsn #ifndef SLJIT_UTIL_GLOBAL_LOCK
    108  1.6.2.2  alnsn /* Enabled by default */
    109  1.6.2.2  alnsn #define SLJIT_UTIL_GLOBAL_LOCK 1
    110  1.6.2.2  alnsn #endif
    111  1.6.2.2  alnsn 
    112  1.6.2.2  alnsn /* Implements a stack like data structure (by using mmap / VirtualAlloc). */
    113  1.6.2.2  alnsn #ifndef SLJIT_UTIL_STACK
    114  1.6.2.2  alnsn /* Enabled by default */
    115  1.6.2.2  alnsn #define SLJIT_UTIL_STACK 1
    116  1.6.2.2  alnsn #endif
    117  1.6.2.2  alnsn 
    118  1.6.2.2  alnsn /* Single threaded application. Does not require any locks. */
    119  1.6.2.2  alnsn #ifndef SLJIT_SINGLE_THREADED
    120  1.6.2.2  alnsn /* Disabled by default. */
    121  1.6.2.2  alnsn #define SLJIT_SINGLE_THREADED 0
    122  1.6.2.2  alnsn #endif
    123  1.6.2.2  alnsn 
    124  1.6.2.2  alnsn /* --------------------------------------------------------------------- */
    125  1.6.2.2  alnsn /*  Configuration                                                        */
    126  1.6.2.2  alnsn /* --------------------------------------------------------------------- */
    127  1.6.2.2  alnsn 
    128  1.6.2.2  alnsn /* If SLJIT_STD_MACROS_DEFINED is not defined, the application should
    129  1.6.2.2  alnsn    define SLJIT_MALLOC, SLJIT_FREE, SLJIT_MEMMOVE, and NULL. */
    130  1.6.2.2  alnsn #ifndef SLJIT_STD_MACROS_DEFINED
    131  1.6.2.2  alnsn /* Disabled by default. */
    132  1.6.2.2  alnsn #define SLJIT_STD_MACROS_DEFINED 0
    133  1.6.2.2  alnsn #endif
    134  1.6.2.2  alnsn 
    135  1.6.2.2  alnsn /* Executable code allocation:
    136  1.6.2.2  alnsn    If SLJIT_EXECUTABLE_ALLOCATOR is not defined, the application should
    137  1.6.2.2  alnsn    define both SLJIT_MALLOC_EXEC and SLJIT_FREE_EXEC. */
    138  1.6.2.2  alnsn #ifndef SLJIT_EXECUTABLE_ALLOCATOR
    139  1.6.2.2  alnsn /* Enabled by default. */
    140  1.6.2.2  alnsn #define SLJIT_EXECUTABLE_ALLOCATOR 1
    141  1.6.2.2  alnsn #endif
    142  1.6.2.2  alnsn 
    143  1.6.2.2  alnsn /* Debug checks (assertions, etc.). */
    144  1.6.2.2  alnsn #ifndef SLJIT_DEBUG
    145  1.6.2.2  alnsn /* Enabled by default */
    146  1.6.2.2  alnsn #define SLJIT_DEBUG 1
    147  1.6.2.2  alnsn #endif
    148  1.6.2.2  alnsn 
    149  1.6.2.2  alnsn /* Verbose operations */
    150  1.6.2.2  alnsn #ifndef SLJIT_VERBOSE
    151  1.6.2.2  alnsn /* Enabled by default */
    152  1.6.2.2  alnsn #define SLJIT_VERBOSE 1
    153  1.6.2.2  alnsn #endif
    154  1.6.2.2  alnsn 
    155  1.6.2.3    tls /*
    156  1.6.2.3    tls   SLJIT_IS_FPU_AVAILABLE
    157  1.6.2.3    tls     The availability of the FPU can be controlled by SLJIT_IS_FPU_AVAILABLE.
    158  1.6.2.3    tls       zero value - FPU is NOT present.
    159  1.6.2.3    tls       nonzero value - FPU is present.
    160  1.6.2.3    tls */
    161  1.6.2.3    tls 
    162  1.6.2.3    tls /* For further configurations, see the beginning of sljitConfigInternal.h */
    163  1.6.2.2  alnsn 
    164  1.6.2.2  alnsn #endif
    165