1*00a02679Sskrll /* $NetBSD: sysarch.h,v 1.15 2021/10/06 05:33:15 skrll Exp $ */ 224a2b394Smatt 324a2b394Smatt /* 424a2b394Smatt * Copyright (c) 1996-1997 Mark Brinicombe. 524a2b394Smatt * All rights reserved. 624a2b394Smatt * 724a2b394Smatt * Redistribution and use in source and binary forms, with or without 824a2b394Smatt * modification, are permitted provided that the following conditions 924a2b394Smatt * are met: 1024a2b394Smatt * 1. Redistributions of source code must retain the above copyright 1124a2b394Smatt * notice, this list of conditions and the following disclaimer. 1224a2b394Smatt * 2. Redistributions in binary form must reproduce the above copyright 1324a2b394Smatt * notice, this list of conditions and the following disclaimer in the 1424a2b394Smatt * documentation and/or other materials provided with the distribution. 1524a2b394Smatt * 3. All advertising materials mentioning features or use of this software 1624a2b394Smatt * must display the following acknowledgement: 1724a2b394Smatt * This product includes software developed by Mark Brinicombe. 1824a2b394Smatt * 4. The name of the company nor the name of the author may be used to 1924a2b394Smatt * endorse or promote products derived from this software without specific 2024a2b394Smatt * prior written permission. 2124a2b394Smatt * 2224a2b394Smatt * THIS SOFTWARE IS PROVIDED BY AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 2324a2b394Smatt * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 2424a2b394Smatt * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 2524a2b394Smatt * IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 2624a2b394Smatt * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 2724a2b394Smatt * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 2824a2b394Smatt * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2924a2b394Smatt * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 3024a2b394Smatt * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 3124a2b394Smatt * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3224a2b394Smatt * SUCH DAMAGE. 3324a2b394Smatt */ 3424a2b394Smatt 3524a2b394Smatt #ifndef _ARM_SYSARCH_H_ 3624a2b394Smatt #define _ARM_SYSARCH_H_ 3724a2b394Smatt 38d440784bSkleink #include <sys/cdefs.h> 39d440784bSkleink 4024a2b394Smatt /* 414d7f10fdSjoerg * Pickup definition of size_t and uintptr_t 42af16732aSchris */ 434d7f10fdSjoerg #include <machine/ansi.h> 44af16732aSchris #include <sys/stdint.h> 458ce910e7Smatt #ifndef _KERNEL 468ce910e7Smatt #include <stdbool.h> 478ce910e7Smatt #endif 48af16732aSchris 494d7f10fdSjoerg #ifdef _BSD_SIZE_T_ 504d7f10fdSjoerg typedef _BSD_SIZE_T_ size_t; 514d7f10fdSjoerg #undef _BSD_SIZE_T_ 524d7f10fdSjoerg #endif 534d7f10fdSjoerg 54af16732aSchris /* 55243dc1d4Sthorpej * Architecture specific syscalls (arm) 5624a2b394Smatt */ 5724a2b394Smatt 58243dc1d4Sthorpej #define ARM_SYNC_ICACHE 0 59243dc1d4Sthorpej #define ARM_DRAIN_WRITEBUF 1 60c58ada7bSmatt #define ARM_VFP_FPSCR 2 6199fb32eeSmatt #define ARM_FPU_USED 3 6224a2b394Smatt 63243dc1d4Sthorpej struct arm_sync_icache_args { 64384a403cSmatt uintptr_t addr; /* Virtual start address */ 65384a403cSmatt size_t len; /* Region size */ 6624a2b394Smatt }; 6724a2b394Smatt 68c58ada7bSmatt struct arm_vfp_fpscr_args { 69c58ada7bSmatt uint32_t fpscr_clear; /* bits to clear */ 70c58ada7bSmatt uint32_t fpscr_set; /* bits to set */ 71c58ada7bSmatt }; 72c58ada7bSmatt 7399fb32eeSmatt struct arm_unaligned_faults_args { 7499fb32eeSmatt bool enabled; /* unaligned faults are enabled */ 7599fb32eeSmatt }; 7699fb32eeSmatt 7724a2b394Smatt #ifndef _KERNEL 78d440784bSkleink __BEGIN_DECLS 79223f5b40Schristos int arm_sync_icache(uintptr_t, size_t); 80223f5b40Schristos int arm_drain_writebuf(void); 81223f5b40Schristos int sysarch(int, void *); 82d440784bSkleink __END_DECLS 8324a2b394Smatt #endif 8424a2b394Smatt 8524a2b394Smatt #endif /* !_ARM_SYSARCH_H_ */ 86