1371853e5SOlivier Houchard /* $NetBSD: sysarch.h,v 1.5 2003/09/11 09:40:12 kleink Exp $ */ 2371853e5SOlivier Houchard 3d8315c79SWarner Losh /*- 4371853e5SOlivier Houchard * Copyright (c) 1996-1997 Mark Brinicombe. 5371853e5SOlivier Houchard * All rights reserved. 6371853e5SOlivier Houchard * 7371853e5SOlivier Houchard * Redistribution and use in source and binary forms, with or without 8371853e5SOlivier Houchard * modification, are permitted provided that the following conditions 9371853e5SOlivier Houchard * are met: 10371853e5SOlivier Houchard * 1. Redistributions of source code must retain the above copyright 11371853e5SOlivier Houchard * notice, this list of conditions and the following disclaimer. 12371853e5SOlivier Houchard * 2. Redistributions in binary form must reproduce the above copyright 13371853e5SOlivier Houchard * notice, this list of conditions and the following disclaimer in the 14371853e5SOlivier Houchard * documentation and/or other materials provided with the distribution. 15371853e5SOlivier Houchard * 3. All advertising materials mentioning features or use of this software 16371853e5SOlivier Houchard * must display the following acknowledgement: 17371853e5SOlivier Houchard * This product includes software developed by Mark Brinicombe. 18371853e5SOlivier Houchard * 4. The name of the company nor the name of the author may be used to 19371853e5SOlivier Houchard * endorse or promote products derived from this software without specific 20371853e5SOlivier Houchard * prior written permission. 21371853e5SOlivier Houchard * 22371853e5SOlivier Houchard * THIS SOFTWARE IS PROVIDED BY AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 23371853e5SOlivier Houchard * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 24371853e5SOlivier Houchard * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 25371853e5SOlivier Houchard * IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 26371853e5SOlivier Houchard * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 27371853e5SOlivier Houchard * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 28371853e5SOlivier Houchard * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29371853e5SOlivier Houchard * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30371853e5SOlivier Houchard * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31371853e5SOlivier Houchard * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32371853e5SOlivier Houchard * SUCH DAMAGE. 33371853e5SOlivier Houchard */ 34371853e5SOlivier Houchard 35371853e5SOlivier Houchard /* $FreeBSD$ */ 36371853e5SOlivier Houchard 37371853e5SOlivier Houchard #ifndef _ARM_SYSARCH_H_ 38371853e5SOlivier Houchard #define _ARM_SYSARCH_H_ 39371853e5SOlivier Houchard 40e081d0acSRafal Jaworowski #include <machine/armreg.h> 41e081d0acSRafal Jaworowski /* 42e081d0acSRafal Jaworowski * The ARM_TP_ADDRESS points to a special purpose page, which is used as local 43e081d0acSRafal Jaworowski * store for the ARM per-thread data and Restartable Atomic Sequences support. 44e081d0acSRafal Jaworowski * Put it just above the "high" vectors' page. 45e081d0acSRafal Jaworowski */ 46e081d0acSRafal Jaworowski #define ARM_TP_ADDRESS (ARM_VECTORS_HIGH + 0x1000) 47e081d0acSRafal Jaworowski #define ARM_RAS_START (ARM_TP_ADDRESS + 4) 48e081d0acSRafal Jaworowski #define ARM_RAS_END (ARM_TP_ADDRESS + 8) 49e081d0acSRafal Jaworowski 50e081d0acSRafal Jaworowski #ifndef LOCORE 51e081d0acSRafal Jaworowski 52371853e5SOlivier Houchard #include <sys/cdefs.h> 53371853e5SOlivier Houchard 54371853e5SOlivier Houchard /* 55371853e5SOlivier Houchard * Pickup definition of uintptr_t 56371853e5SOlivier Houchard */ 57371853e5SOlivier Houchard #include <sys/stdint.h> 58371853e5SOlivier Houchard 59371853e5SOlivier Houchard /* 60371853e5SOlivier Houchard * Architecture specific syscalls (arm) 61371853e5SOlivier Houchard */ 62371853e5SOlivier Houchard 63371853e5SOlivier Houchard #define ARM_SYNC_ICACHE 0 64371853e5SOlivier Houchard #define ARM_DRAIN_WRITEBUF 1 65a74985cdSOlivier Houchard #define ARM_SET_TP 2 66a74985cdSOlivier Houchard #define ARM_GET_TP 3 67371853e5SOlivier Houchard 68371853e5SOlivier Houchard struct arm_sync_icache_args { 69371853e5SOlivier Houchard uintptr_t addr; /* Virtual start address */ 70371853e5SOlivier Houchard size_t len; /* Region size */ 71371853e5SOlivier Houchard }; 72371853e5SOlivier Houchard 73371853e5SOlivier Houchard #ifndef _KERNEL 74371853e5SOlivier Houchard __BEGIN_DECLS 75371853e5SOlivier Houchard int arm_sync_icache (u_int addr, int len); 76371853e5SOlivier Houchard int arm_drain_writebuf (void); 77a74985cdSOlivier Houchard int sysarch(int, void *); 78371853e5SOlivier Houchard __END_DECLS 79371853e5SOlivier Houchard #endif 80371853e5SOlivier Houchard 81e081d0acSRafal Jaworowski #endif /* LOCORE */ 82e081d0acSRafal Jaworowski 83371853e5SOlivier Houchard #endif /* !_ARM_SYSARCH_H_ */ 84