Home | History | Annotate | Line # | Download | only in include
apcall.h revision 1.1
      1 /*	$NetBSD: apcall.h,v 1.1 1999/12/22 05:53:21 tsubai Exp $	*/
      2 
      3 /*-
      4  * Copyright (C) 1999 SHIMIZU Ryo.  All rights reserved.
      5  *
      6  * Redistribution and use in source and binary forms, with or without
      7  * modification, are permitted provided that the following conditions
      8  * are met:
      9  * 1. Redistributions of source code must retain the above copyright
     10  *    notice, this list of conditions and the following disclaimer.
     11  * 2. Redistributions in binary form must reproduce the above copyright
     12  *    notice, this list of conditions and the following disclaimer in the
     13  *    documentation and/or other materials provided with the distribution.
     14  * 3. The name of the author may not be used to endorse or promote products
     15  *    derived from this software without specific prior written permission.
     16  *
     17  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     18  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     19  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     20  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     21  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     22  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     23  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     24  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
     26  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     27  */
     28 
     29 #ifndef __MACHINE_APCALL_H__
     30 #define __MACHINE_APCALL_H__
     31 
     32 #include <machine/apbus.h>
     33 
     34 #define APCALL		(*(_sip->apbsi_call))
     35 
     36 #define	APCALL_EXIT		1
     37 #define	APCALL_READ		3
     38 #define	APCALL_WRITE		4
     39 #define	APCALL_OPEN		5
     40 #define	APCALL_CLOSE		6
     41 #define	APCALL_LSEEK		19
     42 #define	APCALL_IOCTL		54
     43 
     44 #define	APCALL_GETBASE		1001
     45 #define	APCALL_BOOT		1002
     46 #define	APCALL_BADADDR		1003
     47 #define	APCALL_GETENV		1004
     48 #define	APCALL_SETENV		1005
     49 #define	APCALL_FLCACHE		1006
     50 #define	APCALL_SLEEP		1007
     51 #define	APCALL_USLEEP		1008
     52 #define	APCALL_PHYSADDR		1009
     53 #define	APCALL_MALLOC		1010
     54 #define	APCALL_FREE		1011
     55 #define	APCALL_NSECTIME		1012
     56 #define	APCALL_IOMAP		1013
     57 #define	APCALL_DMAMAP		1014
     58 #define	APCALL_OPENBFS		1015
     59 #define	APCALL_READBFS		1016
     60 #define	APCALL_CLOSEBFS		1017
     61 
     62 #define	APCALL_PRINTF		1101
     63 #define	APCALL_FPRINTF		1103
     64 #define	APCALL_SPRINTF		1104
     65 #define	APCALL_BCOPY		1105
     66 #define	APCALL_BCMP		1106
     67 #define	APCALL_BZERO		1107
     68 
     69 #define	APCALL_PANIC		2001
     70 #define	APCALL_READDIPSW	2002
     71 #define	APCALL_STRCPY		2003
     72 #define	APCALL_STRCAT		2004
     73 #define	APCALL_STRCMP		2005
     74 #define	APCALL_STRLEN		2006
     75 #define	APCALL_STRNCPY		2007
     76 #define	APCALL_STRNCAT		2008
     77 #define	APCALL_STRNCMP		2009
     78 #define	APCALL_STRTOL		2010
     79 #define	APCALL_LTOSTR		2011
     80 #define	APCALL_EPRINTF		2012
     81 #define	APCALL_FONTADDR		2013
     82 
     83 #define	APIOCGIFHWADDR		9200	/* get hardware address */
     84 
     85 #define	apcall_exit(a)		APCALL(APCALL_EXIT,(a))
     86 #define	apcall_read(a,b,c)	APCALL(APCALL_READ,(a),(b),(c))
     87 #define	apcall_write(a,b,c)	APCALL(APCALL_WRITE,(a),(b),(c))
     88 #define	apcall_open(a,b)	APCALL(APCALL_OPEN,(a),(b))
     89 #define	apcall_close(a)		APCALL(APCALL_CLOSE,(a))
     90 #define	apcall_lseek(a,b,c)	APCALL(APCALL_LSEEK,(a),(b),(c))
     91 #define	apcall_ioctl(a,b,c)	APCALL(APCALL_IOCTL,(a),(b),(c))
     92 
     93 #define	apcall_getbase(a,b,c)	APCALL(APCALL_GETBASE,(a),(b),(c))
     94 #define	apcall_boot(a)		APCALL(APCALL_BOOT,(a))
     95 #define	apcall_badaddr(a,b)	APCALL(APCALL_BADADDR,(a),(b))
     96 #define	apcall_getenv(a)	APCALL(APCALL_GETENV,(a))
     97 #define	apcall_setenv(a,b)	APCALL(APCALL_SETENV,(a),(b))
     98 #define	apcall_flush_cache()	APCALL(APCALL_FLCACHE)
     99 #define	apcall_sleep(a)		APCALL(APCALL_SLEEP,(a))
    100 #define	apcall_usleep(a)	APCALL(APCALL_USLEEP,(a))
    101 #define	apcall_physaddr(a,b,c)	APCALL(APCALL_PHYSADDR,(a),(b),(c))
    102 #define	apcall_malloc(a)	APCALL(APCALL_MALLOC,(a))
    103 #define	apcall_free(a)		APCALL(APCALL_FREE,(a))
    104 #define	apcall_nsectime(a)	APCALL(APCALL_NSECTIME,(a))
    105 #define	apcall_iomap(a,b)	APCALL(APCALL_IOMAP,(a),(b))
    106 #define	apcall_dmamap(a,b)	APCALL(APCALL_DMAMAP,(a),(b))
    107 #define	apcall_openbfs(a,b)	APCALL(APCALL_OPENBFS,(a),(b))
    108 #define	apcall_readbfs(a,b)	APCALL(APCALL_READBFS,(a),(b))
    109 #define	apcall_closebfs()	APCALL(APCALL_CLOSEBFS)
    110 
    111 #define	apcall_bcopy(a,b,c)	APCALL(APCALL_BCOPY,(a),(b),(c))
    112 #define	apcall_bcmp(a,b,c)	APCALL(APCALL_BCMP,(a),(b),(c))
    113 #define	apcall_bzero(a,b)	APCALL(APCALL_BZERO,(a),(b))
    114 
    115 #define	apcall_panic(a,b)	APCALL(APCALL_PANIC,(a),(b))
    116 #define	apcall_readdipsw()	APCALL(APCALL_READDIPSW)
    117 #define	apcall_strcpy(a,b)	APCALL(APCALL_STRCPY,(a),(b))
    118 #define	apcall_strcat(a,b)	APCALL(APCALL_STRCAT,(a),(b))
    119 #define	apcall_strcmp(a,b)	APCALL(APCALL_STRCMP,(a),(b))
    120 #define	apcall_strlen(a)	APCALL(APCALL_STRLEN,(a))
    121 #define	apcall_strncpy(a,b,c)	APCALL(APCALL_STRNCPY,(a),(b),(c))
    122 #define	apcall_strncat(a,b,c)	APCALL(APCALL_STRNCAT,(a),(b),(c))
    123 #define	apcall_strncmp(a,b,c)	APCALL(APCALL_STRNCMP,(a),(b),(c))
    124 #define	apcall_getsx(a,b)	APCALL(APCALL_GETSX,(a),(b))
    125 #define	apcall_strtol(a,b,c)	APCALL(APCALL_STRTOL,(a),(b),(c))
    126 #define	apcall_ltostr(a,b,c)	APCALL(APCALL_LTOSTR,(a),(b),(c))
    127 #define	apcall_fontaddr(a,b)	APCALL(APCALL_FONTADDR,(a),(b))
    128 
    129 #endif	/* !__MACHINE_APCALL_H__ */
    130