11.1Salnsn/* $NetBSD: cpufunc.c,v 1.1 2019/01/21 00:30:14 alnsn Exp $ */ 21.1Salnsn 31.1Salnsn/*- 41.1Salnsn * Copyright (c) 2019 Alexander Nasonov. 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 AUTHOR ``AS IS'' AND ANY EXPRESS 171.1Salnsn * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 181.1Salnsn * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 191.1Salnsn * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 201.1Salnsn * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 211.1Salnsn * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 221.1Salnsn * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 231.1Salnsn * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 241.1Salnsn * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 251.1Salnsn * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 261.1Salnsn * SUCH DAMAGE. 271.1Salnsn */ 281.1Salnsn 291.1Salnsn#include <sys/cdefs.h> 301.1Salnsn__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.1 2019/01/21 00:30:14 alnsn Exp $"); 311.1Salnsn 321.1Salnsn/* 331.1Salnsn * Barebone implementation of arm cpufunc routines for rump. 341.1Salnsn */ 351.1Salnsn 361.1Salnsn#include <machine/types.h> 371.1Salnsn#include <sys/types.h> 381.1Salnsn 391.1Salnsn#include "sljit_rump.h" 401.1Salnsn 411.1Salnsnvoid aarch64_icache_sync_range(vaddr_t, vsize_t); 421.1Salnsn 431.1Salnsnvoid 441.1Salnsnaarch64_icache_sync_range(vaddr_t va, vsize_t sz) 451.1Salnsn{ 461.1Salnsn 471.1Salnsn // XXX MIPS and 32-bit ARM make this call: 481.1Salnsn // (void)rumpcomp_sync_icache((void *)va, (uint64_t)sz); 491.1Salnsn // but it doesn't link. Fix Makefiles to make it link. 501.1Salnsn __builtin___clear_cache((void *)va, (char *)va + sz); 511.1Salnsn} 52