Home | History | Annotate | Line # | Download | only in arm
      1 /*	$NetBSD: bus_space_notimpl.S,v 1.5 2013/08/18 06:29:29 matt 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)						;	\
     58 LABEL(func)							;	\
     59 	push	{r0-r3}						;	\
     60 	adr	r1, LNAME(__C(func,_funcname))			;	\
     61 	mov	r2, sp						;	\
     62 	b	.Lbs_notimpl_panic				;	\
     63 								;	\
     64 LLABEL(__C(func,_funcname))					;	\
     65 	.asciz	__S(func)					;	\
     66 	.align	0						;	\
     67 	END(NAME(func))
     68 
     69 .Lbs_notimpl_message:
     70 	.ascii	__S(BUS_SPACE)
     71 	.asciz	"_%s: args at %p"
     72 
     73 	.align	0
     74 .Lbs_notimpl_panic:
     75 	adr	r0, .Lbs_notimpl_message
     76 	b	_C_LABEL(panic)
     77 
     78 /*
     79  * misc functions
     80  */
     81 
     82 NOT_IMPL(mmap)
     83 
     84 
     85 /*
     86  * Generic bus_space I/O functions
     87  */
     88 
     89 /*
     90  * read single
     91  */
     92 
     93 NOT_IMPL(r_1)
     94 NOT_IMPL(r_2)
     95 NOT_IMPL(r_4)
     96 NOT_IMPL(r_8)
     97 
     98 /*
     99  * write single
    100  */
    101 
    102 NOT_IMPL(w_1)
    103 NOT_IMPL(w_2)
    104 NOT_IMPL(w_4)
    105 NOT_IMPL(w_8)
    106 
    107 /*
    108  * read multiple
    109  */
    110 
    111 NOT_IMPL(rm_1)
    112 NOT_IMPL(rm_2)
    113 NOT_IMPL(rm_4)
    114 NOT_IMPL(rm_8)
    115 
    116 /*
    117  * write multiple
    118  */
    119 
    120 NOT_IMPL(wm_1)
    121 NOT_IMPL(wm_2)
    122 NOT_IMPL(wm_4)
    123 NOT_IMPL(wm_8)
    124 
    125 /*
    126  * read region
    127  */
    128 
    129 NOT_IMPL(rr_1)
    130 NOT_IMPL(rr_2)
    131 NOT_IMPL(rr_4)
    132 NOT_IMPL(rr_8)
    133 
    134 /*
    135  * write region
    136  */
    137 
    138 NOT_IMPL(wr_1)
    139 NOT_IMPL(wr_2)
    140 NOT_IMPL(wr_4)
    141 NOT_IMPL(wr_8)
    142 
    143 /*
    144  * set multiple
    145  */
    146 
    147 NOT_IMPL(sm_1)
    148 NOT_IMPL(sm_2)
    149 NOT_IMPL(sm_4)
    150 NOT_IMPL(sm_8)
    151 
    152 /*
    153  * set region
    154  */
    155 
    156 NOT_IMPL(sr_1)
    157 NOT_IMPL(sr_2)
    158 NOT_IMPL(sr_4)
    159 NOT_IMPL(sr_8)
    160 
    161 /*
    162  * copy
    163  */
    164 
    165 NOT_IMPL(c_1)
    166 NOT_IMPL(c_2)
    167 NOT_IMPL(c_4)
    168 NOT_IMPL(c_8)
    169