sljit_machdep.h revision 1.4
11.4Sriastrad/* $NetBSD: sljit_machdep.h,v 1.4 2024/04/02 22:37:34 riastradh 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.3Sskrll 371.3Sskrll#include <arm/cpufunc.h> 381.1Srjs#else 391.1Srjs#include <stddef.h> 401.1Srjs#include <stdint.h> 411.1Srjs#include <aarch64/sysarch.h> 421.1Srjs#endif 431.1Srjs 441.1Srjs#define SLJIT_CONFIG_ARM_64 1 451.1Srjs 461.4Sriastrad#ifdef _HARDKERNEL 471.4Sriastrad/* 481.4Sriastrad * XXX Currently sys/rump/include/machine/cpu.h doesn't have 491.4Sriastrad * ci_cpufuncs for cpu_icache_sync_range, so we do this only for 501.4Sriastrad * non-rump kernels for now. 511.4Sriastrad */ 521.1Srjs#define SLJIT_CACHE_FLUSH(from, to) \ 531.1Srjs cpu_icache_sync_range((vaddr_t)(from), (vsize_t)((to) - (from))) 541.1Srjs#else 551.1Srjs#define SLJIT_CACHE_FLUSH(from, to) \ 561.2Salnsn (void)__builtin___clear_cache((char *)(from), (char *)(to)) 571.1Srjs#endif 581.1Srjs 591.1Srjs#endif 60