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