apbus.h revision 1.2.6.3       1  1.2.6.3  bouyer /*	$NetBSD: apbus.h,v 1.2.6.3 2000/12/08 09:28:51 bouyer Exp $	*/
      2  1.2.6.2  bouyer 
      3  1.2.6.2  bouyer /*-
      4  1.2.6.2  bouyer  * Copyright (C) 1999 SHIMIZU Ryo.  All rights reserved.
      5  1.2.6.2  bouyer  *
      6  1.2.6.2  bouyer  * Redistribution and use in source and binary forms, with or without
      7  1.2.6.2  bouyer  * modification, are permitted provided that the following conditions
      8  1.2.6.2  bouyer  * are met:
      9  1.2.6.2  bouyer  * 1. Redistributions of source code must retain the above copyright
     10  1.2.6.2  bouyer  *    notice, this list of conditions and the following disclaimer.
     11  1.2.6.2  bouyer  * 2. Redistributions in binary form must reproduce the above copyright
     12  1.2.6.2  bouyer  *    notice, this list of conditions and the following disclaimer in the
     13  1.2.6.2  bouyer  *    documentation and/or other materials provided with the distribution.
     14  1.2.6.2  bouyer  * 3. The name of the author may not be used to endorse or promote products
     15  1.2.6.2  bouyer  *    derived from this software without specific prior written permission.
     16  1.2.6.2  bouyer  *
     17  1.2.6.2  bouyer  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     18  1.2.6.2  bouyer  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     19  1.2.6.2  bouyer  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     20  1.2.6.2  bouyer  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     21  1.2.6.2  bouyer  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     22  1.2.6.2  bouyer  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     23  1.2.6.2  bouyer  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     24  1.2.6.2  bouyer  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     25  1.2.6.2  bouyer  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
     26  1.2.6.2  bouyer  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     27  1.2.6.2  bouyer  */
     28  1.2.6.2  bouyer 
     29  1.2.6.2  bouyer #ifndef __MACHINE_APBUS__
     30  1.2.6.2  bouyer #define __MACHINE_APBUS__
     31  1.2.6.2  bouyer 
     32  1.2.6.2  bouyer struct apbus_ctl {
     33  1.2.6.2  bouyer 	u_int	apbc_ctlno;
     34  1.2.6.2  bouyer 	u_int	apbc_mu;
     35  1.2.6.2  bouyer 	u_int	apbc_unknown2;
     36  1.2.6.2  bouyer 	void	*apbc_sladdr;
     37  1.2.6.2  bouyer 
     38  1.2.6.2  bouyer 	u_int	apbc_unknown4;
     39  1.2.6.2  bouyer 	u_int	apbc_hwbase;
     40  1.2.6.2  bouyer 	char	*apbc_softc;
     41  1.2.6.2  bouyer 	u_int	*apbc_ent7;
     42  1.2.6.2  bouyer 
     43  1.2.6.2  bouyer 	u_int	apbc_unknown8;
     44  1.2.6.2  bouyer 	u_int	apbc_sl;
     45  1.2.6.2  bouyer 
     46  1.2.6.2  bouyer 	struct apbus_ctl *apbc_child0;
     47  1.2.6.2  bouyer 	u_int	apbc_child0no[3];
     48  1.2.6.2  bouyer 
     49  1.2.6.2  bouyer 	struct apbus_ctl *apbc_child1;
     50  1.2.6.2  bouyer 	u_int	apbc_child1no[3];
     51  1.2.6.2  bouyer 
     52  1.2.6.2  bouyer 	struct apbus_ctl *apbc_child2;
     53  1.2.6.2  bouyer 	u_int	apbc_child2no[3];
     54  1.2.6.2  bouyer 
     55  1.2.6.2  bouyer 	struct apbus_ctl *apbc_parent;
     56  1.2.6.2  bouyer 	u_int	apbc_parentno[3];
     57  1.2.6.2  bouyer 
     58  1.2.6.2  bouyer 	struct apbus_ctl *apbc_link;
     59  1.2.6.2  bouyer };
     60  1.2.6.2  bouyer 
     61  1.2.6.2  bouyer struct apbus_dev {
     62  1.2.6.2  bouyer 	char	*apbd_name;
     63  1.2.6.2  bouyer 	char	*apbd_vendor;
     64  1.2.6.2  bouyer 	u_int	apbd_atr;
     65  1.2.6.2  bouyer 	u_int	apbd_rev;
     66  1.2.6.2  bouyer 	void	*apbd_driver;
     67  1.2.6.2  bouyer 	void	*table[16];
     68  1.2.6.2  bouyer 	struct apbus_ctl *apbd_ctl;
     69  1.2.6.2  bouyer 	struct apbus_dev *apbd_link;
     70  1.2.6.2  bouyer };
     71  1.2.6.2  bouyer 
     72  1.2.6.2  bouyer struct apbus_sysinfo {
     73  1.2.6.2  bouyer 	int	apbsi_revision;
     74  1.2.6.3  bouyer 	int	(*apbsi_call)(int, ...);/* apcall entry */
     75  1.2.6.2  bouyer 	int	apbsi_errno;		/* errno from apcall? */
     76  1.2.6.2  bouyer 	void	*apbsi_bootstart;	/* entry of primary boot */
     77  1.2.6.2  bouyer 	void	*apbsi_bootend;
     78  1.2.6.2  bouyer 	struct apbus_dev *apbsi_dev;
     79  1.2.6.2  bouyer 	struct apbus_bus *apbsi_bus;
     80  1.2.6.2  bouyer 	int	apbsi_exterr;		/* ? */
     81  1.2.6.2  bouyer 
     82  1.2.6.2  bouyer 	int	apbsi_pad1[2];
     83  1.2.6.2  bouyer 	int	apbsi_memsize;		/* memory size */
     84  1.2.6.2  bouyer 	int	apbsi_pad2[24];
     85  1.2.6.2  bouyer 	int	apbsi_romversion;
     86  1.2.6.2  bouyer 	int	apbsi_pad3[28];
     87  1.2.6.2  bouyer };
     88  1.2.6.2  bouyer 
     89  1.2.6.2  bouyer /*
     90  1.2.6.2  bouyer  * FYI: result of 'ss -m' command on NEWS5000 rom monitor on my machine...
     91  1.2.6.2  bouyer  *
     92  1.2.6.2  bouyer  * > ss -m
     93  1.2.6.2  bouyer  * Memory use:
     94  1.2.6.2  bouyer  *  diag info:  bf881800
     95  1.2.6.2  bouyer  *    environ:  bf881000
     96  1.2.6.2  bouyer  *     apinfo:  bf880000
     97  1.2.6.2  bouyer  *    sysinfo:  9ff03270	->	struct apbus_sysinfo
     98  1.2.6.2  bouyer  * alloc list:  ffffbff8
     99  1.2.6.2  bouyer  *    max mem:  04000000
    100  1.2.6.2  bouyer  *   free mem:  03ff1678
    101  1.2.6.2  bouyer  *   mem base: 100000000
    102  1.2.6.2  bouyer  *
    103  1.2.6.2  bouyer  */
    104  1.2.6.2  bouyer 
    105  1.2.6.2  bouyer extern struct apbus_sysinfo *_sip;
    106  1.2.6.2  bouyer void apbus_wbflush __P((void));
    107  1.2.6.2  bouyer 
    108  1.2.6.2  bouyer #endif /* !__MACHINE_APBUS__ */
    109