sljit_machdep.h revision 1.2
11.2Ssimonb/*	$NetBSD: sljit_machdep.h,v 1.2 2020/07/26 08:08:41 simonb Exp $	*/
21.1Salnsn
31.1Salnsn/*-
41.1Salnsn * Copyright (c) 2012,2014 The NetBSD Foundation, Inc.
51.1Salnsn * All rights reserved.
61.1Salnsn *
71.1Salnsn * Redistribution and use in source and binary forms, with or without
81.1Salnsn * modification, are permitted provided that the following conditions
91.1Salnsn * are met:
101.1Salnsn * 1. Redistributions of source code must retain the above copyright
111.1Salnsn *    notice, this list of conditions and the following disclaimer.
121.1Salnsn * 2. Redistributions in binary form must reproduce the above copyright
131.1Salnsn *    notice, this list of conditions and the following disclaimer in the
141.1Salnsn *    documentation and/or other materials provided with the distribution.
151.1Salnsn *
161.1Salnsn * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
171.1Salnsn * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
181.1Salnsn * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
191.1Salnsn * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
201.1Salnsn * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
211.1Salnsn * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
221.1Salnsn * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
231.1Salnsn * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
241.1Salnsn * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
251.1Salnsn * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
261.1Salnsn * POSSIBILITY OF SUCH DAMAGE.
271.1Salnsn */
281.1Salnsn
291.1Salnsn#ifndef _MIPS_SLJITARCH_H
301.2Ssimonb#define	_MIPS_SLJITARCH_H
311.1Salnsn
321.1Salnsn#ifdef _LP64
331.2Ssimonb#define	SLJIT_CONFIG_MIPS_64 1
341.1Salnsn#else
351.2Ssimonb#define	SLJIT_CONFIG_MIPS_32 1
361.1Salnsn#endif
371.1Salnsn
381.1Salnsn#include <sys/types.h>
391.1Salnsn
401.1Salnsn#ifdef _KERNEL
411.1Salnsn#include <mips/cache.h>
421.1Salnsn
431.2Ssimonb#define	SLJIT_CACHE_FLUSH(from, to) mips_icache_sync_range( \
441.1Salnsn	(vaddr_t)(from), (vsize_t)((const char *)(to) - (const char *)(from)))
451.1Salnsn#else
461.1Salnsn#include <mips/cachectl.h>
471.1Salnsn
481.2Ssimonb#define	SLJIT_CACHE_FLUSH(from, to) \
491.1Salnsn	(void)_cacheflush((void*)(from), (size_t)((to) - (from)), ICACHE)
501.1Salnsn#endif
511.1Salnsn
521.1Salnsn#endif
53