sljit_machdep.h revision 1.1
11.1Srjs/*	$NetBSD: sljit_machdep.h,v 1.1 2018/08/26 21:06:46 rjs Exp $	*/
21.1Srjs
31.1Srjs/*-
41.1Srjs * Copyright (c) 2014 Alexander Nasonov.
51.1Srjs * All rights reserved.
61.1Srjs *
71.1Srjs * Redistribution and use in source and binary forms, with or without
81.1Srjs * modification, are permitted provided that the following conditions
91.1Srjs * are met:
101.1Srjs * 1. Redistributions of source code must retain the above copyright
111.1Srjs *    notice, this list of conditions and the following disclaimer.
121.1Srjs * 2. Redistributions in binary form must reproduce the above copyright
131.1Srjs *    notice, this list of conditions and the following disclaimer in the
141.1Srjs *    documentation and/or other materials provided with the distribution.
151.1Srjs *
161.1Srjs * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
171.1Srjs * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
181.1Srjs * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
191.1Srjs * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
201.1Srjs * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
211.1Srjs * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
221.1Srjs * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
231.1Srjs * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
241.1Srjs * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
251.1Srjs * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
261.1Srjs * POSSIBILITY OF SUCH DAMAGE.
271.1Srjs */
281.1Srjs
291.1Srjs#ifndef _AARCH64_SLJITARCH_H
301.1Srjs#define _AARCH64_SLJITARCH_H
311.1Srjs
321.1Srjs#include <sys/cdefs.h>
331.1Srjs
341.1Srjs#ifdef _KERNEL
351.1Srjs#include <machine/types.h>
361.1Srjs#include <aarch64/cpufunc.h>
371.1Srjs#else
381.1Srjs#include <stddef.h>
391.1Srjs#include <stdint.h>
401.1Srjs#include <aarch64/sysarch.h>
411.1Srjs#endif
421.1Srjs
431.1Srjs#define SLJIT_CONFIG_ARM_64 1
441.1Srjs
451.1Srjs#ifdef _KERNEL
461.1Srjs#define SLJIT_CACHE_FLUSH(from, to) \
471.1Srjs	cpu_icache_sync_range((vaddr_t)(from), (vsize_t)((to) - (from)))
481.1Srjs#else
491.1Srjs#define SLJIT_CACHE_FLUSH(from, to) \
501.1Srjs	(void)aarch64_sync_icache((uintptr_t)(from), (size_t)((to) - (from)))
511.1Srjs#endif
521.1Srjs
531.1Srjs#endif
54