1/* $OpenBSD: bus_space_notimpl.S,v 1.4 2022/12/08 01:25:44 guenther Exp $ */ 2/* $NetBSD: bus_space_notimpl.S,v 1.2 2001/09/10 02:20:19 reinoud Exp $ */ 3 4/* 5 * Copyright (c) 1997 Mark Brinicombe. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions 10 * are met: 11 * 1. Redistributions of source code must retain the above copyright 12 * notice, this list of conditions and the following disclaimer. 13 * 2. Redistributions in binary form must reproduce the above copyright 14 * notice, this list of conditions and the following disclaimer in the 15 * documentation and/or other materials provided with the distribution. 16 * 3. All advertising materials mentioning features or use of this software 17 * must display the following acknowledgement: 18 * This product includes software developed by Mark Brinicombe. 19 * 4. The name of the company nor the name of the author may be used to 20 * endorse or promote products derived from this software without specific 21 * prior written permission. 22 * 23 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 24 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 25 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 26 * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 27 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 29 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 * SUCH DAMAGE. 34 */ 35 36#include <machine/asm.h> 37 38/* 39 * BUS_SPACE - name of this bus space 40 */ 41 42#define BUS_SPACE bs_notimpl 43 44#define __C(x,y) __CONCAT(x,y) 45#define __S(s) __STRING(s) 46#define NAME(func) __C(BUS_SPACE,__C(_bs_,func)) 47#define LNAME(func) __C(L,NAME(func)) 48 49#define __L(x) x 50#define GLOBAL(func) .global __L(NAME(func)) 51#define LABEL(func) __L(NAME(func)): 52#define LLABEL(func) LNAME(func): 53 54#define FTEXT(func,text) __S(__C(NAME(func),text)) 55 56 57#define NOT_IMPL(func) \ 58 GLOBAL(func) ; \ 59LABEL(func) ; \ 60 adr r4, LNAME(__C(func,_text)) ; \ 61 b bs_notimpl_panic ; \ 62 ; \ 63LLABEL(__C(func,_text)) ; \ 64 .asciz __S(func) ; \ 65 .align 0 ; 66 67bs_notimpl_message: 68 .asciz __S(BUS_SPACE), "_%s: args at %p" 69 70 .align 2 71bs_notimpl_panic: 72 stmfd sp!, {r0-r3} 73 adr r0, bs_notimpl_message 74 mov r1, r4 75 mov r2, sp 76 b panic 77 78 79 80/* 81 * misc functions 82 */ 83 84NOT_IMPL(mmap) 85 86 87/* 88 * Generic bus_space I/O functions 89 */ 90 91/* 92 * read single 93 */ 94 95NOT_IMPL(r_1) 96NOT_IMPL(r_2) 97NOT_IMPL(r_4) 98NOT_IMPL(r_8) 99 100/* 101 * write single 102 */ 103 104NOT_IMPL(w_1) 105NOT_IMPL(w_2) 106NOT_IMPL(w_4) 107NOT_IMPL(w_8) 108 109/* 110 * read multiple 111 */ 112 113NOT_IMPL(rm_1) 114NOT_IMPL(rm_2) 115NOT_IMPL(rm_4) 116NOT_IMPL(rm_8) 117 118/* 119 * write multiple 120 */ 121 122NOT_IMPL(wm_1) 123NOT_IMPL(wm_2) 124NOT_IMPL(wm_4) 125NOT_IMPL(wm_8) 126 127/* 128 * read region 129 */ 130 131NOT_IMPL(rr_1) 132NOT_IMPL(rr_2) 133NOT_IMPL(rr_4) 134NOT_IMPL(rr_8) 135 136/* 137 * write region 138 */ 139 140NOT_IMPL(wr_1) 141NOT_IMPL(wr_2) 142NOT_IMPL(wr_4) 143NOT_IMPL(wr_8) 144 145/* 146 * set multiple 147 */ 148 149NOT_IMPL(sm_1) 150NOT_IMPL(sm_2) 151NOT_IMPL(sm_4) 152NOT_IMPL(sm_8) 153 154/* 155 * set region 156 */ 157 158NOT_IMPL(sr_1) 159NOT_IMPL(sr_2) 160NOT_IMPL(sr_4) 161NOT_IMPL(sr_8) 162 163/* 164 * copy 165 */ 166 167NOT_IMPL(c_1) 168NOT_IMPL(c_2) 169NOT_IMPL(c_4) 170NOT_IMPL(c_8) 171