Initial import. Gets as far as nfs_mountroot.
This commit is contained in:
parent
2ad3428397
commit
99f640b958
337
sys/arch/sun3/include/mc68851.h
Normal file
337
sys/arch/sun3/include/mc68851.h
Normal file
@ -0,0 +1,337 @@
|
||||
/* $NetBSD: mc68851.h,v 1.1.1.1 1997/01/14 20:57:07 gwr Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Jeremy Cooper.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _SUN3X_MC68851_H
|
||||
#define _SUN3X_MC68851_H
|
||||
|
||||
/**************************** MMU STRUCTURES ****************************
|
||||
* MMU structures define the format of data used by the MC68851. *
|
||||
************************************************************************
|
||||
* A virtual address is translated into a physical address by dividing its
|
||||
* bits into four fields. The first three fields are used as indexes into
|
||||
* descriptor tables and the last field (the 13 lowest significant
|
||||
* bits) is an offset to be added to the base address found at the final
|
||||
* table. The first three fields are named TIA, TIB and TIC respectively.
|
||||
* 31 12 0
|
||||
* +-.-.-.-.-.-.-+-.-.-.-.-.-+-.-.-.-.-.-+-.-.-.-.-.-.-.-.-.-.-.-.-+
|
||||
* | TIA | TIB | TIC | OFFSET |
|
||||
* +-.-.-.-.-.-.-+-.-.-.-.-.-+-.-.-.-.-.-+-.-.-.-.-.-.-.-.-.-.-.-.-+
|
||||
*/
|
||||
#define MMU_TIA_SHIFT (13+6+6)
|
||||
#define MMU_TIA_MASK (0xfe000000)
|
||||
#define MMU_TIA_RANGE (0x02000000)
|
||||
#define MMU_TIB_SHIFT (13+6)
|
||||
#define MMU_TIB_MASK (0x01f80000)
|
||||
#define MMU_TIB_RANGE (0x00080000)
|
||||
#define MMU_TIC_SHIFT (13)
|
||||
#define MMU_TIC_MASK (0x0007e000)
|
||||
#define MMU_TIC_RANGE (0x00002000)
|
||||
#define MMU_PAGE_SHIFT (13)
|
||||
#define MMU_PAGE_MASK (0xffffe000)
|
||||
#define MMU_PAGE_SIZE (0x00002000)
|
||||
|
||||
/* Macros which extract each of these fields out of a given
|
||||
* VA.
|
||||
*/
|
||||
#define MMU_TIA(va) \
|
||||
((unsigned long) ((va) & MMU_TIA_MASK) >> MMU_TIA_SHIFT)
|
||||
#define MMU_TIB(va) \
|
||||
((unsigned long) ((va) & MMU_TIB_MASK) >> MMU_TIB_SHIFT)
|
||||
#define MMU_TIC(va) \
|
||||
((unsigned long) ((va) & MMU_TIC_MASK) >> MMU_TIC_SHIFT)
|
||||
|
||||
/* The widths of the TIA, TIB, and TIC fields determine the size (in
|
||||
* elements) of the tables they index.
|
||||
*/
|
||||
#define MMU_A_TBL_SIZE (128)
|
||||
#define MMU_B_TBL_SIZE (64)
|
||||
#define MMU_C_TBL_SIZE (64)
|
||||
|
||||
/* Rounding macros.
|
||||
* The MMU_ROUND macros are named misleadingly. MMU_ROUND_A actually
|
||||
* rounds an address to the nearest B table boundary, and so on.
|
||||
* MMU_ROUND_C() is synonmous with sun3x_round_page().
|
||||
*/
|
||||
#define MMU_ROUND_A(pa)\
|
||||
((unsigned long) (pa) & MMU_TIA_MASK)
|
||||
#define MMU_ROUND_UP_A(pa)\
|
||||
((unsigned long) (pa + MMU_TIA_RANGE - 1) & MMU_TIA_MASK)
|
||||
#define MMU_ROUND_B(pa)\
|
||||
((unsigned long) (pa) & (MMU_TIA_MASK|MMU_TIB_MASK))
|
||||
#define MMU_ROUND_UP_B(pa)\
|
||||
((unsigned long) (pa + MMU_TIB_RANGE - 1) & (MMU_TIA_MASK|MMU_TIB_MASK))
|
||||
#define MMU_ROUND_C(pa)\
|
||||
((unsigned long) (pa) & MMU_PAGE_MASK)
|
||||
#define MMU_ROUND_UP_C(pa)\
|
||||
((unsigned long) (pa + MMU_PAGE_SIZE - 1) & MMU_PAGE_MASK)
|
||||
|
||||
#if 0 /* in param.h */
|
||||
#define sun3x_round_page(pa)\
|
||||
((unsigned long) (pa) & MMU_PAGE_MASK)
|
||||
#endif
|
||||
#define sun3x_round_up_page(pa)\
|
||||
((unsigned long) (pa + MMU_PAGE_SIZE - 1) & MMU_PAGE_MASK)
|
||||
|
||||
/** MC68851 Long Format Table Descriptor
|
||||
* The root table for a sun3x pmap is a 128 element array of 'long format
|
||||
* table descriptors'. The structure of a long format table descriptor is:
|
||||
*
|
||||
* 63 48
|
||||
* +---+---.---.---.---.---.---.---.---.---.---.---.---.---.---.---+
|
||||
* |L/U| LIMIT |
|
||||
* +---+---.---+---.---.---+---+---+---+---+---+---+---+---+---.---+
|
||||
* | RAL | WAL |SG | S | 0 | 0 | 0 | 0 | U |WP |DT (10)|
|
||||
* +---.---.---+---.---.---+---+---+---+---+---+---+---+---+---.---+
|
||||
* | TABLE PHYSICAL ADDRESS (BITS 31-16) |
|
||||
* +---.---.---.---.---.---.---.---.---.---.---.---+---.---.---.---+
|
||||
* | TABLE PHYSICAL ADDRESS (15-4) | UNUSED |
|
||||
* +---.---.---.---.---.---.---.---.---.---.---.---+---.---.---.---+
|
||||
* 15 0
|
||||
*
|
||||
* Note: keep the unused bits set to zero so that no masking of the
|
||||
* base address is needed.
|
||||
*/
|
||||
struct mmu_long_dte_struct { /* 'dte' stands for 'descriptor table entry' */
|
||||
union {
|
||||
struct {
|
||||
char lu_flag:1; /* Lower/Upper Limit flag */
|
||||
int limit:15; /* Table Size limit */
|
||||
char ral:3; /* Read Access Level */
|
||||
char wal:3; /* Write Access Level */
|
||||
char sg:1; /* Shared Globally flag */
|
||||
char supv:1; /* Supervisor Only flag */
|
||||
char rsvd:4; /* Reserved (All zeros) */
|
||||
char u:1; /* Used flag */
|
||||
char wp:1; /* Write Protect flag */
|
||||
char dt:2; /* Descriptor Type */
|
||||
/* Bit masks for fields above */
|
||||
#define MMU_LONG_DTE_LU 0x80000000
|
||||
#define MMU_LONG_DTE_LIMIT 0x7fff0000
|
||||
#define MMU_LONG_DTE_RAL 0x0000e000
|
||||
#define MMU_LONG_DTE_WAL 0x00001c00
|
||||
#define MMU_LONG_DTE_SG 0x00000200
|
||||
#define MMU_LONG_DTE_SUPV 0x00000100
|
||||
#define MMU_LONG_DTE_USED 0x00000008
|
||||
#define MMU_LONG_DTE_WP 0x00000004
|
||||
#define MMU_LONG_DTE_DT 0x00000003
|
||||
} attr_struct;
|
||||
u_long raw; /* struct above, addressable as a long */
|
||||
} attr;
|
||||
union {
|
||||
struct {
|
||||
int base_addr:28; /* Physical base address
|
||||
char unused:4; * of the table pointed to
|
||||
* by this entry.
|
||||
*/
|
||||
/* Bit masks for fields above */
|
||||
#define MMU_LONG_DTE_BASEADDR 0xfffffff0
|
||||
} addr_struct;
|
||||
u_long raw; /* struct above, addressable as a long */
|
||||
} addr;
|
||||
};
|
||||
typedef struct mmu_long_dte_struct mmu_long_dte_t;
|
||||
typedef struct mmu_long_dte_struct *mmu_long_dtbl_t;
|
||||
|
||||
/** MC68851 Long Format Page Descriptor
|
||||
* Although not likely to be used in this implementation, a level
|
||||
* 'A' table may contain long format PAGE descriptors. A long format
|
||||
* page descriptor is the same size as a long format table descriptor.
|
||||
* Its discriminating feature to the MMU is its descriptor field: 01.
|
||||
* 63 48
|
||||
* +---.---.---.---.---.---.---.---.---.---.---.---.---.---.---.---+
|
||||
* | UNUSED |
|
||||
* +---.---.---+---.---.---+---+---+---+---+---+---+---+---+---.---+
|
||||
* | RAL | WAL |SG | S | G |CI | L | M | U |WP |DT (01)|
|
||||
* +---.---.---+---.---.---+---+---+---+---+---+---+---+---+---.---+
|
||||
* | TABLE PHYSICAL ADDRESS (BITS 31-16) |
|
||||
* +---.---.---.---.---.---.---.---.---.---.---.---.---.---.---.---+
|
||||
* |TABLE PHYS. ADDRESS (15-8) | UNUSED |
|
||||
* +---.---.---.---.---.---.---.---.---.---.---.---.---.---.---.---+
|
||||
* 15 0
|
||||
*/
|
||||
struct mmu_long_pte_struct { /* 'pte' stands for 'page table entry' */
|
||||
union {
|
||||
struct {
|
||||
int unused:16; /* Unused */
|
||||
char ral:3; /* Read Access Level */
|
||||
char wal:3; /* Write Access Level */
|
||||
char sg:1; /* Shared Globally flag */
|
||||
char supv:1; /* Supervisor Only flag */
|
||||
char g:1; /* Gate allowed */
|
||||
char ci:1; /* Cache inhibit */
|
||||
char l:1; /* Lock entry */
|
||||
char m:1; /* Modified flag */
|
||||
char u:1; /* Used flag */
|
||||
char wp:1; /* Write Protect flag */
|
||||
char dt:2; /* Descriptor Type */
|
||||
/* Bit masks for fields above */
|
||||
#define MMU_LONG_PTE_RAL 0x0000e000
|
||||
#define MMU_LONG_PTE_WAL 0x00001c00
|
||||
#define MMU_LONG_PTE_SG 0x00000200
|
||||
#define MMU_LONG_PTE_SUPV 0x00000100
|
||||
#define MMU_LONG_PTE_GATE 0x00000080
|
||||
#define MMU_LONG_PTE_CI 0x00000040
|
||||
#define MMU_LONG_PTE_LOCK 0x00000020
|
||||
#define MMU_LONG_PTE_M 0x00000010
|
||||
#define MMU_LONG_PTE_USED 0x00000008
|
||||
#define MMU_LONG_PTE_WP 0x00000004
|
||||
#define MMU_LONG_PTE_DT 0x00000003
|
||||
} attr_struct;
|
||||
u_long raw; /* struct above, addressable as a long */
|
||||
} attr;
|
||||
union {
|
||||
struct {
|
||||
long base_addr:24; /* Physical base address
|
||||
char unused:8; * of page this entry
|
||||
* points to.
|
||||
*/
|
||||
/* Bit masks for fields above */
|
||||
#define MMU_LONG_PTE_BASEADDR 0xffffff00
|
||||
} addr_struct;
|
||||
u_long raw; /* struct above, addressable as a long */
|
||||
} addr;
|
||||
};
|
||||
typedef struct mmu_long_pte_struct mmu_long_pte_t;
|
||||
typedef struct mmu_long_pte_struct *mmu_long_ptbl_t;
|
||||
|
||||
/* Every entry in the level A table (except for the page entries
|
||||
* described above) points to a level B table. Level B tables are
|
||||
* arrays of 'short format' table descriptors. Their structure
|
||||
* is smaller than an A table descriptor and is as follows:
|
||||
*
|
||||
* 31 16
|
||||
* +---.---.---.---.---.---.---.---.---.---.---.---.---.---.---.---+
|
||||
* | TABLE PHYSICAL BASE ADDRESS (BITS 31-16) |
|
||||
* +---.---.---.---.---.---.---.---.---.---.---.---+---+---+---.---+
|
||||
* | TABLE PHYSICAL BASE ADDRESS (15-4) | U |WP |DT (10)|
|
||||
* +---.---.---.---.---.---.---.---.---.---.---.---+---+---+---.---+
|
||||
* 15 0
|
||||
*/
|
||||
struct mmu_short_dte_struct { /* 'dte' stands for 'descriptor table entry' */
|
||||
union {
|
||||
struct {
|
||||
long base_addr:28;
|
||||
char u:1;
|
||||
char wp:1;
|
||||
char dt:2;
|
||||
#define MMU_SHORT_DTE_BASEADDR 0xfffffff0
|
||||
#define MMU_SHORT_DTE_USED 0x00000008
|
||||
#define MMU_SHORT_DTE_WP 0x00000004
|
||||
#define MMU_SHORT_DTE_DT 0x00000003
|
||||
} attr_struct;
|
||||
u_long raw;
|
||||
} attr;
|
||||
};
|
||||
typedef struct mmu_short_dte_struct mmu_short_dte_t;
|
||||
typedef struct mmu_short_dte_struct *mmu_short_dtbl_t;
|
||||
|
||||
/* Every entry in a level B table points to a level C table. Level C tables
|
||||
* contain arrays of short format page 'entry' descriptors. A short format
|
||||
* page 'entry' is the same size as a short format page 'table'
|
||||
* descriptor (a B table entry). Thus B and C tables can be allocated
|
||||
* interchangeably from the same pool. However, we will keep them separate.
|
||||
*
|
||||
* The descriptor type (DT) field of a Page Table Entry (PTE) is '01'. This
|
||||
* indicates to the MMU that the address contained in the PTE's 'base
|
||||
* address' field is the base address for a physical page in memory to which
|
||||
* the VA should be mapped, and not a base address for a yet another
|
||||
* descriptor table, thus ending the table walk.
|
||||
*
|
||||
* 31 16
|
||||
* +---.---.---.---.---.---.---.---.---.---.---.---.---.---.---.---+
|
||||
* | TABLE PHYSICAL BASE ADDRESS (BITS 31-16) |
|
||||
* +---.---.---.---.---.---.---.---+---+---+---+---+---+---+---.---+
|
||||
* |TABLE PHYS. BASE ADDRESS (15-8)| G |CI | L | M | U |WP |DT (10)|
|
||||
* +---.---.---.---.---.---.---.---+---+---+---+---+---+---+---.---+
|
||||
* 15 0
|
||||
*/
|
||||
struct mmu_short_pte_struct { /* 'pte' stands for 'page table entry' */
|
||||
union {
|
||||
struct {
|
||||
long base_addr:24;
|
||||
char g:1;
|
||||
char ci:1;
|
||||
char l:1;
|
||||
char m:1;
|
||||
char u:1;
|
||||
char wp:1;
|
||||
char dt:2;
|
||||
#define MMU_SHORT_PTE_BASEADDR 0xffffff00
|
||||
#define MMU_SHORT_PTE_UN2 0x00000080
|
||||
#define MMU_SHORT_PTE_CI 0x00000040
|
||||
#define MMU_SHORT_PTE_UN1 0x00000020
|
||||
#define MMU_SHORT_PTE_M 0x00000010
|
||||
#define MMU_SHORT_PTE_USED 0x00000008
|
||||
#define MMU_SHORT_PTE_WP 0x00000004
|
||||
#define MMU_SHORT_PTE_DT 0x00000003
|
||||
} attr_struct;
|
||||
u_long raw;
|
||||
} attr;
|
||||
};
|
||||
typedef struct mmu_short_pte_struct mmu_short_pte_t;
|
||||
typedef struct mmu_short_pte_struct *mmu_short_ptbl_t;
|
||||
|
||||
/* These are bit masks and other values that are common to all types of
|
||||
* descriptors.
|
||||
*/
|
||||
/* Page table descriptors have a 'Descriptor Type' field describing the
|
||||
* format of the tables they point to. It is two bits wide and is one of:
|
||||
*/
|
||||
#define MMU_DT_INVALID 0x0 /* Invalid descriptor entry */
|
||||
#define MMU_DT_PAGE 0x1 /* Descriptor describes a page entry */
|
||||
#define MMU_DT_SHORT 0x2 /* describes a short format table */
|
||||
#define MMU_DT_LONG 0x3 /* describes a long format table */
|
||||
#define MMU_DT_MASK 0x00000003 /* Bit location of the DT field */
|
||||
|
||||
/* Various macros for manipulating and setting MMU descriptor
|
||||
* characteristics.
|
||||
*/
|
||||
/* returns true if a descriptor is valid. */
|
||||
#define MMU_VALID_DT(dte) ((dte).attr.raw & MMU_DT_MASK)
|
||||
/* returns true if a descriptor is invalid */
|
||||
#define MMU_INVALID_DT(dte) (!((dte).attr.raw & MMU_DT_MASK))
|
||||
/* returns true if a descriptor has been referenced */
|
||||
#define MMU_PTE_USED(pte) ((pte).attr.raw & MMU_SHORT_PTE_USED)
|
||||
/* returns true if a descriptor has been modified */
|
||||
#define MMU_PTE_MODIFIED(pte) ((pte).attr.raw & MMU_SHORT_PTE_M)
|
||||
/* extracts the physical address from a pte */
|
||||
#define MMU_PTE_PA(pte) ((pte).attr.raw & MMU_SHORT_PTE_BASEADDR)
|
||||
/* extracts the physical address from a dte */
|
||||
#define MMU_DTE_PA(dte) ((dte).attr.raw & MMU_SHORT_DTE_BASEADDR)
|
||||
|
||||
#endif /* _SUN3X_MC68851_H */
|
151
sys/arch/sun3/include/vmparam3x.h
Normal file
151
sys/arch/sun3/include/vmparam3x.h
Normal file
@ -0,0 +1,151 @@
|
||||
/* $NetBSD: vmparam3x.h,v 1.1.1.1 1997/01/14 20:57:07 gwr Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988 University of Utah.
|
||||
* Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* the Systems Programming Group of the University of Utah Computer
|
||||
* Science Department.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: Utah $Hdr: vmparam.h 1.16 91/01/18$
|
||||
* from: @(#)vmparam.h 7.3 (Berkeley) 5/7/91
|
||||
* vmparam.h,v 1.2 1993/05/22 07:58:38 cgd Exp
|
||||
*/
|
||||
|
||||
/*
|
||||
* Machine dependent constants for Sun3x
|
||||
*/
|
||||
|
||||
/*
|
||||
* USRTEXT is the start of the user text/data space, while
|
||||
* USRSTACK is the top (end) of the user stack.
|
||||
*/
|
||||
#define USRTEXT NBPG /* Start of user text */
|
||||
#define USRSTACK KERNBASE /* High end of user stack */
|
||||
|
||||
/*
|
||||
* Virtual memory related constants, all in bytes
|
||||
*/
|
||||
#ifndef MAXTSIZ
|
||||
#define MAXTSIZ (8*1024*1024) /* max text size */
|
||||
#endif
|
||||
#ifndef DFLDSIZ
|
||||
#define DFLDSIZ (32*1024*1024) /* initial data size limit */
|
||||
#endif
|
||||
#ifndef MAXDSIZ
|
||||
#define MAXDSIZ (128*1024*1024) /* max data size */
|
||||
#endif
|
||||
#ifndef DFLSSIZ
|
||||
#define DFLSSIZ (2*1024*1024) /* initial stack size limit */
|
||||
#endif
|
||||
#ifndef MAXSSIZ
|
||||
#define MAXSSIZ (32*1024*1024) /* max stack size */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Default sizes of swap allocation chunks (see dmap.h).
|
||||
* The actual values may be changed in vminit() based on MAXDSIZ.
|
||||
* With MAXDSIZ of 16Mb and NDMAP of 38, dmmax will be 1024.
|
||||
* DMMIN should be at least ctod(1) so that vtod() works.
|
||||
* vminit() insures this.
|
||||
*/
|
||||
#define DMMIN 32 /* smallest swap allocation */
|
||||
#define DMMAX 4096 /* largest potential swap allocation */
|
||||
|
||||
/*
|
||||
* PTEs for mapping user space into the kernel for phyio operations.
|
||||
* The actual limitation for physio requests will be the DVMA space,
|
||||
* and that is fixed by hardware design at 16MB. We could make the
|
||||
* physio map larger than that, but it would not buy us much.
|
||||
*/
|
||||
#ifndef USRIOSIZE
|
||||
#define USRIOSIZE 2048 /* 16 MB */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* PTEs for system V style shared memory.
|
||||
* This is basically slop for kmempt which we actually allocate (malloc) from.
|
||||
*/
|
||||
#ifndef SHMMAXPGS
|
||||
#define SHMMAXPGS 2048 /* 16 MB */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The time for a process to be blocked before being very swappable.
|
||||
* This is a number of seconds which the system takes as being a non-trivial
|
||||
* amount of real time. You probably shouldn't change this;
|
||||
* it is used in subtle ways (fractions and multiples of it are, that is, like
|
||||
* half of a ``long time'', almost a long time, etc.)
|
||||
* It is related to human patience and other factors which don't really
|
||||
* change over time.
|
||||
*/
|
||||
#define MAXSLP 20
|
||||
|
||||
/*
|
||||
* A swapped in process is given a small amount of core without being bothered
|
||||
* by the page replacement algorithm. Basically this says that if you are
|
||||
* swapped in you deserve some resources. We protect the last SAFERSS
|
||||
* pages against paging and will just swap you out rather than paging you.
|
||||
* Note that each process has at least UPAGES+CLSIZE pages which are not
|
||||
* paged anyways (this is currently 8+2=10 pages or 5k bytes), so this
|
||||
* number just means a swapped in process is given around 25k bytes.
|
||||
* Just for fun: current memory prices are 4600$ a megabyte on VAX (4/22/81),
|
||||
* so we loan each swapped in process memory worth 100$, or just admit
|
||||
* that we don't consider it worthwhile and swap it out to disk which costs
|
||||
* $30/mb or about $0.75.
|
||||
*/
|
||||
#define SAFERSS 4 /* nominal ``small'' resident set size
|
||||
protected against replacement */
|
||||
|
||||
/*
|
||||
* Mach-derived constants, virtual memory map:
|
||||
*
|
||||
* 0000.0000 user space
|
||||
* F800.0000 kernel space
|
||||
* FE00.0000 monitor map (devices)
|
||||
* FF00.0000 DVMA space
|
||||
*/
|
||||
|
||||
/* user/kernel map constants */
|
||||
#define VM_MIN_ADDRESS ((vm_offset_t)0)
|
||||
#define VM_MAX_ADDRESS ((vm_offset_t)KERNBASE)
|
||||
#define VM_MAXUSER_ADDRESS ((vm_offset_t)KERNBASE)
|
||||
#define VM_MIN_KERNEL_ADDRESS ((vm_offset_t)KERNBASE)
|
||||
#define VM_MAX_KERNEL_ADDRESS ((vm_offset_t)KERN_END)
|
||||
|
||||
/* virtual sizes (bytes) for various kernel submaps */
|
||||
#define VM_MBUF_SIZE (NMBCLUSTERS*MCLBYTES)
|
||||
#define VM_KMEM_SIZE (NKMEMCLUSTERS*CLBYTES)
|
||||
#define VM_PHYS_SIZE (USRIOSIZE*CLBYTES)
|
||||
|
||||
#define MACHINE_NONCONTIG /* VM <=> pmap interface modifier */
|
243
sys/arch/sun3/sun3x/dvma.c
Normal file
243
sys/arch/sun3/sun3x/dvma.c
Normal file
@ -0,0 +1,243 @@
|
||||
/* $NetBSD: dvma.c,v 1.1.1.1 1997/01/14 20:57:07 gwr Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Gordon W. Ross and Jeremy Cooper.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* DVMA (Direct Virtual Memory Access - like DMA)
|
||||
*
|
||||
* In the Sun3 architecture, memory cycles initiated by secondary bus
|
||||
* masters (DVMA devices) passed through the same MMU that governed CPU
|
||||
* accesses. All DVMA devices were wired in such a way so that an offset
|
||||
* was added to the addresses they issued, causing them to access virtual
|
||||
* memory starting at address 0x0FF00000 - the offset. The task of
|
||||
* enabling a DVMA device to access main memory only involved creating
|
||||
* valid mapping in the MMU that translated these high addresses into the
|
||||
* appropriate physical addresses.
|
||||
*
|
||||
* The Sun3x presents a challenge to programming DVMA because the MMU is no
|
||||
* longer shared by both secondary bus masters and the CPU. The MC68030's
|
||||
* built-in MMU serves only to manage virtual memory accesses initiated by
|
||||
* the CPU. Secondary bus master bus accesses pass through a different MMU,
|
||||
* aptly named the 'I/O Mapper'. To enable every device driver that uses
|
||||
* DVMA to understand that these two address spaces are disconnected would
|
||||
* require a tremendous amount of code re-writing. To avoid this, we will
|
||||
* ensure that the I/O Mapper and the MC68030 MMU are programmed together,
|
||||
* so that DVMA mappings are consistent in both the CPU virtual address
|
||||
* space and secondary bus master address space - creating an environment
|
||||
* just like the Sun3 system.
|
||||
*
|
||||
* The maximum address space that any DVMA device in the Sun3x architecture
|
||||
* is capable of addressing is 24 bits wide (16 Megabytes.) We can alias
|
||||
* all of the mappings that exist in the I/O mapper by duplicating them in
|
||||
* a specially reserved section of the CPU's virtual address space, 16
|
||||
* Megabytes in size. Whenever a DVMA buffer is allocated, the allocation
|
||||
* code will enter in a mapping both in the MC68030 MMU page tables and the
|
||||
* I/O mapper.
|
||||
*
|
||||
* The address returned by the allocation routine is a virtual address that
|
||||
* the requesting driver must use to access the buffer. It is up to the
|
||||
* device driver to convert this virtual address into the appropriate slave
|
||||
* address that its device should issue to access the buffer. (The will be
|
||||
* routines that will assist the driver in doing so.)
|
||||
*
|
||||
* XXX - This needs work. The address from dvma_malloc() faults!
|
||||
*/
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/device.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/map.h>
|
||||
#include <sys/buf.h>
|
||||
#include <sys/vnode.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/core.h>
|
||||
#include <sys/exec.h>
|
||||
|
||||
#include <vm/vm.h>
|
||||
#include <vm/vm_kern.h>
|
||||
#include <vm/vm_map.h>
|
||||
|
||||
#include <machine/autoconf.h>
|
||||
#include <machine/cpu.h>
|
||||
#include <machine/enable.h>
|
||||
#include <machine/reg.h>
|
||||
#include <machine/pmap.h>
|
||||
#include <machine/dvma.h>
|
||||
|
||||
#include "machdep.h"
|
||||
#include "iommu.h"
|
||||
|
||||
/*
|
||||
* Use a resource map to manage DVMA scratch-memory pages.
|
||||
*/
|
||||
|
||||
/* Number of slots in dvmamap. */
|
||||
int dvma_max_segs = 256;
|
||||
struct map *dvmamap;
|
||||
|
||||
void
|
||||
dvma_init()
|
||||
{
|
||||
|
||||
/*
|
||||
* Create the resource map for DVMA pages.
|
||||
*/
|
||||
dvmamap = malloc((sizeof(struct map) * dvma_max_segs),
|
||||
M_DEVBUF, M_WAITOK);
|
||||
|
||||
rminit(dvmamap, btoc(DVMA_SPACE_LENGTH), btoc(0xFF000000),
|
||||
"dvmamap", dvma_max_segs);
|
||||
|
||||
/*
|
||||
* Enable DVMA in the System Enable register.
|
||||
* Note: This is only necessary for VME slave accesses.
|
||||
* On-board devices are always capable of DVMA.
|
||||
* *enable_reg |= ENA_SDVMA;
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Given a DVMA address, return the physical address that
|
||||
* would be used by some OTHER bus-master besides the CPU.
|
||||
* (Examples: on-board ie/le, VME xy board).
|
||||
*/
|
||||
u_long
|
||||
dvma_kvtopa(kva, bustype)
|
||||
void * kva;
|
||||
int bustype;
|
||||
{
|
||||
u_long addr, mask;
|
||||
|
||||
addr = (u_long)kva;
|
||||
if ((addr & DVMA_SPACE_START) != DVMA_SPACE_START)
|
||||
panic("dvma_kvtopa: bad dmva addr=0x%x\n", addr);
|
||||
|
||||
/* Everything has just 24 bits. */
|
||||
mask = DVMA_SLAVE_MASK;
|
||||
|
||||
return(addr & mask);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Map a range [va, va+len] of wired virtual addresses in the given map
|
||||
* to a kernel address in DVMA space.
|
||||
*/
|
||||
void *
|
||||
dvma_mapin(kmem_va, len, canwait)
|
||||
void * kmem_va;
|
||||
int len, canwait;
|
||||
{
|
||||
void * dvma_addr;
|
||||
vm_offset_t kva, tva;
|
||||
register int npf, s;
|
||||
register vm_offset_t pa;
|
||||
long off, pn;
|
||||
|
||||
kva = (u_long)kmem_va;
|
||||
if (kva < VM_MIN_KERNEL_ADDRESS)
|
||||
panic("dvma_mapin: bad kva");
|
||||
|
||||
off = (int)kva & PGOFSET;
|
||||
kva -= off;
|
||||
len = round_page(len + off);
|
||||
npf = btoc(len);
|
||||
|
||||
s = splimp();
|
||||
for (;;) {
|
||||
|
||||
pn = rmalloc(dvmamap, npf);
|
||||
|
||||
if (pn != 0)
|
||||
break;
|
||||
if (canwait) {
|
||||
(void)tsleep(dvmamap, PRIBIO+1, "physio", 0);
|
||||
continue;
|
||||
}
|
||||
splx(s);
|
||||
return NULL;
|
||||
}
|
||||
splx(s);
|
||||
|
||||
tva = ctob(pn);
|
||||
dvma_addr = (void *) (tva + off);
|
||||
|
||||
while (npf--) {
|
||||
pa = pmap_extract(pmap_kernel(), kva);
|
||||
if (pa == 0)
|
||||
panic("dvma_mapin: null page frame");
|
||||
pa = trunc_page(pa);
|
||||
|
||||
iommu_enter((tva & DVMA_SLAVE_MASK), pa);
|
||||
|
||||
pmap_enter(pmap_kernel(), tva, pa | PMAP_NC,
|
||||
VM_PROT_READ|VM_PROT_WRITE, 1);
|
||||
|
||||
kva += NBPG;
|
||||
tva += NBPG;
|
||||
}
|
||||
|
||||
return (dvma_addr);
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove double map of `va' in DVMA space at `kva'.
|
||||
*/
|
||||
void
|
||||
dvma_mapout(dvma_addr, len)
|
||||
void * dvma_addr;
|
||||
int len;
|
||||
{
|
||||
u_long kva;
|
||||
int s, off;
|
||||
|
||||
kva = (u_long)dvma_addr;
|
||||
off = (int)kva & PGOFSET;
|
||||
kva -= off;
|
||||
len = round_page(len + off);
|
||||
|
||||
iommu_remove((kva & DVMA_SLAVE_MASK), len);
|
||||
|
||||
pmap_remove(pmap_kernel(), kva, kva + len);
|
||||
|
||||
s = splimp();
|
||||
rmfree(dvmamap, btoc(len), btoc(kva));
|
||||
wakeup(dvmamap);
|
||||
splx(s);
|
||||
}
|
442
sys/arch/sun3x/include/mon.h
Normal file
442
sys/arch/sun3x/include/mon.h
Normal file
@ -0,0 +1,442 @@
|
||||
/* $NetBSD: mon.h,v 1.1.1.1 1997/01/14 20:57:06 gwr Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Adam Glass.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This file derived from kernel/mach/sun3.md/machMon.h from the
|
||||
* sprite distribution.
|
||||
*
|
||||
* In particular, this file came out of the Walnut Creek cdrom collection
|
||||
* which contained no warnings about any possible copyright infringement.
|
||||
* It was also indentical to a file in the sprite kernel tar file found on
|
||||
* allspice.berkeley.edu.
|
||||
* It also written in the annoying sprite coding style. I've made
|
||||
* efforts not to heavily edit their file, just ifdef parts out. -- glass
|
||||
*/
|
||||
|
||||
#ifndef _MACHINE_MON_H
|
||||
#define _MACHINE_MON_H
|
||||
/*
|
||||
* machMon.h --
|
||||
*
|
||||
* Structures, constants and defines for access to the sun monitor.
|
||||
* These are translated from the sun monitor header file "sunromvec.h".
|
||||
*
|
||||
* NOTE: The file keyboard.h in the monitor directory has all sorts of useful
|
||||
* keyboard stuff defined. I haven't attempted to translate that file
|
||||
* because I don't need it. If anyone wants to use it, be my guest.
|
||||
*
|
||||
* Copyright (C) 1985 Regents of the University of California
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Header: /cdrom/src/kernel/Cvsroot/kernel/mach/sun3.md/machMon.h,v 9.1
|
||||
* 90/10/03 13:52:34 mgbaker Exp SPRITE (Berkeley)
|
||||
*/
|
||||
|
||||
#ifndef _MACHMON
|
||||
#define _MACHMON
|
||||
|
||||
/*
|
||||
* Structure set up by the boot command to pass arguments to the program that
|
||||
* is booted.
|
||||
*/
|
||||
typedef struct bootparam {
|
||||
char *argPtr[8]; /* String arguments */
|
||||
char strings[100]; /* String table for string arguments */
|
||||
char devName[2]; /* Device name */
|
||||
int ctlrNum; /* Controller number */
|
||||
int unitNum; /* Unit number */
|
||||
int partNum; /* Partition/file number */
|
||||
char *fileName; /* File name, points into strings */
|
||||
struct boottab *bootDevice; /* Defined in saio.h */
|
||||
} MachMonBootParam;
|
||||
|
||||
#ifdef sun3x
|
||||
/*
|
||||
* This structure defines a segment of physical memory. To support
|
||||
* sparse physical memory, the PROM constructs a linked list of
|
||||
* these at power-on-self-test time.
|
||||
*/
|
||||
struct physmemory {
|
||||
unsigned int address;
|
||||
unsigned int size;
|
||||
struct physmemory *next;
|
||||
};
|
||||
#endif /* sun3x */
|
||||
|
||||
/*
|
||||
* Here is the structure of the vector table found at the front of the boot
|
||||
* rom. The functions defined in here are explained below.
|
||||
*
|
||||
* NOTE: This struct has references to the structures keybuf and globram which
|
||||
* I have not translated. If anyone needs to use these they should
|
||||
* translate these structs into Sprite format.
|
||||
*/
|
||||
typedef struct {
|
||||
char *initSp; /* Initial system stack ptr
|
||||
* for hardware */
|
||||
int (*startMon)__P((void)); /* Initial PC for hardware */
|
||||
|
||||
int *diagberr; /* Bus err handler for diags */
|
||||
|
||||
/*
|
||||
* Monitor and hardware revision and identification
|
||||
*/
|
||||
|
||||
struct bootparam **bootParam; /* Info for bootstrapped pgm */
|
||||
u_int *memorySize; /* Usable memory in bytes */
|
||||
|
||||
/*
|
||||
* Single-character input and output
|
||||
*/
|
||||
|
||||
u_char (*getChar)__P((void)); /* Get char from input source */
|
||||
int (*putChar)__P((int)); /* Put char to output sink */
|
||||
int (*mayGet)__P((void)); /* Maybe get char, or -1 */
|
||||
int (*mayPut)__P((int)); /* Maybe put char, or -1 */
|
||||
u_char *echo; /* Should getchar echo? */
|
||||
u_char *inSource; /* Input source selector */
|
||||
u_char *outSink; /* Output sink selector */
|
||||
|
||||
/*
|
||||
* Keyboard input (scanned by monitor nmi routine)
|
||||
*/
|
||||
|
||||
int (*getKey)__P((void)); /* Get next key if one exists */
|
||||
int (*initGetKey)__P((void*)); /* Initialize get key */
|
||||
u_int *translation; /* Kbd translation selector
|
||||
(see keyboard.h in sun
|
||||
monitor code) */
|
||||
u_char *keyBid; /* Keyboard ID byte */
|
||||
int *screen_x; /* V2: Screen x pos (R/O) */
|
||||
int *screen_y; /* V2: Screen y pos (R/O) */
|
||||
struct keybuf *keyBuf; /* Up/down keycode buffer */
|
||||
|
||||
/*
|
||||
* Monitor revision level.
|
||||
*/
|
||||
|
||||
char *monId;
|
||||
|
||||
/*
|
||||
* Frame buffer output and terminal emulation
|
||||
*/
|
||||
|
||||
int (*fbWriteChar)__P((int)); /* Write a character to FB */
|
||||
int *fbAddr; /* Address of frame buffer */
|
||||
char **font; /* Font table for FB */
|
||||
/* Quickly write string to FB */
|
||||
int (*fbWriteStr)__P((char *buf, int len));
|
||||
|
||||
/*
|
||||
* Reboot interface routine -- resets and reboots system. No return.
|
||||
*/
|
||||
|
||||
int (*reBoot)__P((char *)); /* e.g. reBoot("xy()vmunix") */
|
||||
|
||||
/*
|
||||
* Line input and parsing
|
||||
*/
|
||||
|
||||
u_char *lineBuf; /* The line input buffer */
|
||||
u_char **linePtr; /* Cur pointer into linebuf */
|
||||
int *lineSize; /* length of line in linebuf */
|
||||
int (*getLine)__P((int)); /* Get line from user */
|
||||
u_char (*getNextChar)__P((void)); /* Get next char from linebuf */
|
||||
u_char (*peekNextChar)__P((void)); /* Peek at next char */
|
||||
int *fbThere; /* =1 if frame buffer there */
|
||||
int (*getNum)__P((void)); /* Grab hex num from line */
|
||||
|
||||
/*
|
||||
* Print formatted output to current output sink
|
||||
*/
|
||||
|
||||
int (*printf)__P((char *, ...)); /* Like kernel printf */
|
||||
int (*printHex)__P((int,int)); /* Format N digits in hex */
|
||||
|
||||
/*
|
||||
* Led stuff
|
||||
*/
|
||||
|
||||
u_char *leds; /* RAM copy of LED register */
|
||||
int (*setLeds)__P((int)); /* Sets LED's and RAM copy */
|
||||
|
||||
/*
|
||||
* Non-maskable interrupt (nmi) information
|
||||
*/
|
||||
|
||||
int (*nmiAddr)__P((void*)); /* Addr for level 7 vector */
|
||||
int (*abortEntry)__P((void*)); /* Entry for keyboard abort */
|
||||
int *nmiClock; /* Counts up in msec */
|
||||
|
||||
/*
|
||||
* Frame buffer type: see <sun/fbio.h>
|
||||
*/
|
||||
|
||||
int *fbType;
|
||||
|
||||
/*
|
||||
* Assorted other things
|
||||
*/
|
||||
|
||||
u_int romvecVersion; /* Version # of Romvec */
|
||||
struct globram *globRam; /* monitor global variables */
|
||||
caddr_t kbdZscc; /* Addr of keyboard in use */
|
||||
|
||||
int *keyrInit; /* ms before kbd repeat */
|
||||
u_char *keyrTick; /* ms between repetitions */
|
||||
u_int *memoryAvail; /* V1: Main mem usable size */
|
||||
long *resetAddr; /* where to jump on a reset */
|
||||
long *resetMap; /* pgmap entry for resetaddr */
|
||||
/* Really struct pgmapent * */
|
||||
int (*exitToMon)__P((void)); /* Exit from user program */
|
||||
|
||||
/****************************************************************
|
||||
* Note: from here on, things vary per-architecture!
|
||||
****************************************************************/
|
||||
|
||||
u_char **memorybitmap; /* V1: &{0 or &bits} */
|
||||
|
||||
#ifdef sun3
|
||||
/* Set seg in all contexts */
|
||||
void (*setcxsegmap)__P((int,int,int));
|
||||
#endif /* sun3 */
|
||||
|
||||
/* V2: Handler for 'v' cmd */
|
||||
void (**vector_cmd)__P((int, char*));
|
||||
|
||||
#ifdef sun3x
|
||||
|
||||
/* Address of low memory PTEs (maps at least 4MB) */
|
||||
int **lomemptaddr;
|
||||
|
||||
/*
|
||||
* Address of debug/mon PTEs which map the 2MB space
|
||||
* starting at MON_KDB_START, ending at MONEND.
|
||||
*/
|
||||
int **monptaddr;
|
||||
|
||||
/*
|
||||
* Address of dvma PTEs. This is a VA that maps the I/O MMU
|
||||
* page table, but only the last part, which corresponds to
|
||||
* the CPU virtual space at MON_DVMA_BASE (see below).
|
||||
*/
|
||||
int **dvmaptaddr;
|
||||
|
||||
/*
|
||||
* Physical Address of the debug/mon PTEs found at the
|
||||
* virtual address given by *romVectorPtr->monptaddr;
|
||||
*/
|
||||
int **monptphysaddr;
|
||||
|
||||
/*
|
||||
* Address of shadow copy of DVMA PTEs. This is a VA that
|
||||
* maps the PTEs used by the CPU to map the same physical
|
||||
* pages as the I/O MMU into the CPU virtual space starting
|
||||
* at MON_DVMA_BASE, length MON_DVMA_SIZE (see below).
|
||||
*/
|
||||
int **shadowpteaddr;
|
||||
|
||||
struct physmemory *v_physmemory; /* Ptr to memory list for 3/80 */
|
||||
|
||||
#endif /* sun3x */
|
||||
|
||||
/* Why? */
|
||||
int dummy1z;
|
||||
int dummy2z;
|
||||
int dummy3z;
|
||||
int dummy4z;
|
||||
} MachMonRomVector;
|
||||
|
||||
/*
|
||||
* Functions defined in the vector:
|
||||
*
|
||||
*
|
||||
* getChar -- Return the next character from the input source
|
||||
*
|
||||
* u_char getChar()
|
||||
*
|
||||
* putChar -- Write the given character to the output source.
|
||||
*
|
||||
* void putChar(ch)
|
||||
* char ch;
|
||||
*
|
||||
* mayGet -- Maybe get a character from the current input source. Return -1
|
||||
* if don't return a character.
|
||||
*
|
||||
* int mayGet()
|
||||
*
|
||||
* mayPut -- Maybe put a character to the current output source. Return -1
|
||||
* if no character output.
|
||||
*
|
||||
* int mayPut(ch)
|
||||
* char ch;
|
||||
*
|
||||
* getKey -- Returns a key code (if up/down codes being returned),
|
||||
* a byte of ASCII (if that's requested),
|
||||
* NOKEY (if no key has been hit).
|
||||
*
|
||||
* int getKey()
|
||||
*
|
||||
* initGetKey -- Initialize things for get key.
|
||||
*
|
||||
* void initGetKey()
|
||||
*
|
||||
* fbWriteChar -- Write a character to the frame buffer
|
||||
*
|
||||
* void fwritechar(ch)
|
||||
* u_char ch;
|
||||
*
|
||||
* fbWriteStr -- Write a string to the frame buffer.
|
||||
*
|
||||
* void fwritestr(addr,len)
|
||||
* register u_char *addr; / * String to be written * /
|
||||
* register short len; / * Length of string * /
|
||||
*
|
||||
* getLine -- read the next input line into a global buffer
|
||||
*
|
||||
* getline(echop)
|
||||
* int echop; / * 1 if should echo input, 0 if not * /
|
||||
*
|
||||
* getNextChar -- return the next character from the global line buffer.
|
||||
*
|
||||
* u_char getNextChar()
|
||||
*
|
||||
* peekNextChar -- look at the next character in the global line buffer.
|
||||
*
|
||||
* u_char peekNextChar()
|
||||
*
|
||||
* getNum -- Grab hex num from the global line buffer.
|
||||
*
|
||||
* int getNum()
|
||||
*
|
||||
* printf -- Scaled down version of C library printf. Only %d, %x, %s, and %c
|
||||
* are recognized.
|
||||
*
|
||||
* printhex -- prints rightmost <digs> hex digits of <val>
|
||||
*
|
||||
* printhex(val,digs)
|
||||
* register int val;
|
||||
* register int digs;
|
||||
*
|
||||
* abortEntry -- Entry for keyboard abort.
|
||||
*
|
||||
* abortEntry()
|
||||
*/
|
||||
|
||||
/*
|
||||
* Where the rom vector is defined.
|
||||
*/
|
||||
|
||||
#define romVectorPtr ((MachMonRomVector *) PROM_BASE)
|
||||
/* #define romp romVectorPtr XXX */
|
||||
|
||||
/*
|
||||
* Functions and defines to access the monitor.
|
||||
*/
|
||||
|
||||
#define mon_printf (romVectorPtr->printf)
|
||||
#define mon_putchar (romVectorPtr->putChar)
|
||||
#define mon_may_getchar (romVectorPtr->mayGet)
|
||||
#define mon_exit_to_mon (romVectorPtr->exitToMon)
|
||||
#define mon_reboot (romVectorPtr->reBoot)
|
||||
#define mon_panic(x) { mon_printf(x); mon_exit_to_mon();}
|
||||
|
||||
#ifdef sun3
|
||||
|
||||
#define mon_setcxsegmap(context, va, sme) \
|
||||
romVectorPtr->setcxsegmap(context, va, sme)
|
||||
|
||||
/*
|
||||
* The memory addresses for the PROM, and the EEPROM.
|
||||
* On the sun2 these addresses are actually 0x00EF??00
|
||||
* but only the bottom 24 bits are looked at so these still
|
||||
* work ok.
|
||||
*/
|
||||
|
||||
#define PROM_BASE 0x0fef0000
|
||||
|
||||
/*
|
||||
* MONSTART and MONEND denote the range used by the monitor.
|
||||
*/
|
||||
#define MONSTART 0x0FE00000
|
||||
#define MONEND 0x0FF00000
|
||||
|
||||
/*
|
||||
* These describe the monitor's short segment which it basically uses to map
|
||||
* one stupid page that it uses for storage. MONSHORTPAGE is the page,
|
||||
* and MONSHORTSEG is the segment that it is in. Its mapping must not
|
||||
* be removed (or the PROM monitor will be unhappy).
|
||||
*/
|
||||
|
||||
#define MONSHORTPAGE 0x0FFFE000
|
||||
#define MONSHORTSEG 0x0FFE0000
|
||||
|
||||
#endif /* sun3 */
|
||||
#ifdef sun3x
|
||||
|
||||
/*
|
||||
* We don't have a separate kernel debugger like sun kadb,
|
||||
* but this range is setup by the monitor for such a thing.
|
||||
* We might as well preserve the mappings anyway.
|
||||
*/
|
||||
#define MON_KDB_START 0xFEE00000
|
||||
#define MON_KDB_SIZE 0x100000
|
||||
|
||||
/*
|
||||
* MONSTART and MONEND define the range used by the monitor.
|
||||
* MONDATA is its data page (do not touch!)
|
||||
* PROM_BASE is where the boot PROM lives.
|
||||
*/
|
||||
#define MONSTART 0xFEF00000
|
||||
#define MONDATA 0xFEF72000
|
||||
#define PROM_BASE 0xFEFE0000
|
||||
#define MONEND 0xFF000000
|
||||
|
||||
/*
|
||||
* These define the CPU virtual address range mapped by the
|
||||
* PROM for use as DVMA space. The physical pages mapped in
|
||||
* this range are also mapped by the I/O MMU.
|
||||
*/
|
||||
#define MON_DVMA_BASE 0xFFF00000
|
||||
#define MON_DVMA_SIZE 0x100000 /* 1MB */
|
||||
|
||||
#endif /* sun3x */
|
||||
|
||||
#endif /* _MACHMON */
|
||||
#endif /* MACHINE_MON_H */
|
110
sys/arch/sun3x/include/obio.h
Normal file
110
sys/arch/sun3x/include/obio.h
Normal file
@ -0,0 +1,110 @@
|
||||
/* $NetBSD: obio.h,v 1.1.1.1 1997/01/14 20:57:06 gwr Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Adam Glass and Gordon W. Ross.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This file defines addresses in Type 1 space for various devices
|
||||
* which can be on the motherboard directly.
|
||||
*
|
||||
* Supposedly these values are constant across the entire sun3 architecture.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* The obio or type "1" address space.
|
||||
*/
|
||||
#define OBIO_MIN_ADDRESS 0x58000000
|
||||
#define OBIO_MAX_ADDRESS 0x7BFFFFFF
|
||||
|
||||
/*
|
||||
* Physical addresses of nonconfigurable devices.
|
||||
*/
|
||||
#define OBIO_P4_REG 0x50300000
|
||||
#define OBIO_FPA_ADDR 0x5C000000
|
||||
|
||||
#define OBIO_IOMMU 0x60000000
|
||||
|
||||
/* Note that these six are all in the same page. */
|
||||
#define OBIO_ENABLEREG 0x61000000
|
||||
#define OBIO_BUSERRREG 0x61000400
|
||||
#define OBIO_DIAGREG 0x61000800
|
||||
#define OBIO_IDPROM1 0x61000C00 /* 3/470 only */
|
||||
#define OBIO_MEMREG 0x61001000
|
||||
#define OBIO_INTERREG 0x61001400
|
||||
|
||||
#define OBIO_ZS_KBD_MS 0x62000000
|
||||
#define OBIO_ZS_TTY_AB 0x62002000
|
||||
|
||||
/*
|
||||
* Note: there are two kinds of EEPROM/IDPROM/clock!
|
||||
* On the 3/80 one Mostek MK48T02 does it all.
|
||||
* The 3/470 uses the older, discrete parts.
|
||||
*/
|
||||
#define OBIO_EEPROM 0x64000000
|
||||
#define OBIO_IDPROM2 0x640007D8 /* 3/80 only (Mostek MK48T02) */
|
||||
#define OBIO_CLOCK2 0x640007F8 /* 3/80 only (Mostek MK48T02) */
|
||||
|
||||
#define OBIO_CLOCK1 0x64002000 /* 3/470 only */
|
||||
|
||||
#define OBIO_INTEL_ETHER 0x65000000
|
||||
#define OBIO_LANCE_ETHER 0x65002000
|
||||
|
||||
#define OBIO_PCACHE_TAGS 0x68000000
|
||||
#define OBIO_ECCPARREG 0x6A1E0000
|
||||
#define OBIO_IOC_TAGS 0x6C000000
|
||||
#define OBIO_IOC_FLUSH 0x6D000000
|
||||
|
||||
#define OBIO_FDC 0x6e000000 /* 3/80 only */
|
||||
#define OBIO_PRINTER_PORT 0x6f000000 /* 3/80 only */
|
||||
|
||||
#ifdef _KERNEL
|
||||
|
||||
caddr_t obio_alloc __P((int, int));
|
||||
void obio_init __P((void));
|
||||
caddr_t obio_find_mapping __P((int pa, int size));
|
||||
caddr_t obio_vm_alloc __P((int));
|
||||
|
||||
/*
|
||||
* These are some OBIO devices that need early init calls.
|
||||
*/
|
||||
void idprom_init __P((void));
|
||||
void eeprom_init __P((void));
|
||||
void zs_init __P((void));
|
||||
void intreg_init __P((void));
|
||||
void clock_init __P((void));
|
||||
|
||||
#endif /* _KERNEL */
|
43
sys/arch/sun3x/include/obmem.h
Normal file
43
sys/arch/sun3x/include/obmem.h
Normal file
@ -0,0 +1,43 @@
|
||||
/* $NetBSD: obmem.h,v 1.1.1.1 1997/01/14 20:57:06 gwr Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Adam Glass and Gordon W. Ross.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/* All physical memory is below this address. */
|
||||
#define OBMEM_RAM_END 0x40000000
|
||||
|
||||
#define OBMEM_BW2_ADDR 0x50400000
|
||||
|
147
sys/arch/sun3x/include/param.h
Normal file
147
sys/arch/sun3x/include/param.h
Normal file
@ -0,0 +1,147 @@
|
||||
/* $NetBSD: param.h,v 1.1.1.1 1997/01/14 20:57:06 gwr Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988 University of Utah.
|
||||
* Copyright (c) 1982, 1986, 1990, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* the Systems Programming Group of the University of Utah Computer
|
||||
* Science Department.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: Utah Hdr: machparam.h 1.16 92/12/20
|
||||
* from: @(#)param.h 8.1 (Berkeley) 6/10/93
|
||||
*/
|
||||
|
||||
#ifndef MACHINE
|
||||
|
||||
/*
|
||||
* Machine dependent constants for the Sun3x series.
|
||||
*/
|
||||
#define _MACHINE sun3x
|
||||
#define MACHINE "sun3x"
|
||||
#define _MACHINE_ARCH m68k
|
||||
#define MACHINE_ARCH "m68k"
|
||||
#define MID_MACHINE MID_M68K
|
||||
|
||||
/*
|
||||
* Round p (pointer or byte index) up to a correctly-aligned value
|
||||
* for all data types (int, long, ...). The result is u_int and
|
||||
* must be cast to any desired pointer type.
|
||||
*/
|
||||
#define ALIGNBYTES 3
|
||||
#define ALIGN(p) (((u_int)(p) + ALIGNBYTES) &~ ALIGNBYTES)
|
||||
|
||||
#define NBPG 8192 /* bytes/page */
|
||||
#define PGOFSET (NBPG-1) /* byte offset into page */
|
||||
#define PGSHIFT 13 /* LOG2(NBPG) */
|
||||
|
||||
#define NBSG 0x80000 /* bytes/segment */
|
||||
#define SEGOFSET (NBSG-1) /* byte offset into segment */
|
||||
#define SEGSHIFT 19 /* LOG2(NBSG) */
|
||||
|
||||
#define KERNBASE 0xF8000000 /* start of kernel virtual */
|
||||
#define BTOPKERNBASE ((u_long)KERNBASE >> PGSHIFT)
|
||||
#define KERNTEXTOFF 0xF8004000 /* start of kernel text */
|
||||
#define KERN_END 0xFE000000 /* end of kernel virtual */
|
||||
|
||||
#define DEV_BSIZE 512
|
||||
#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
|
||||
#define BLKDEV_IOSIZE 2048
|
||||
#define MAXPHYS 0x10000 /* max raw I/O transfer size */
|
||||
#define MAXBSIZE 0x8000 /* max FS block size - XXX */
|
||||
|
||||
#define CLSIZE 1
|
||||
#define CLSIZELOG2 0
|
||||
|
||||
/* NOTE: SSIZE, SINCR and UPAGES must be multiples of CLSIZE */
|
||||
#define SSIZE 1 /* initial stack size/NBPG */
|
||||
#define SINCR 1 /* increment of stack/NBPG */
|
||||
|
||||
#define UPAGES 2 /* pages of u-area */
|
||||
#define USPACE (UPAGES << PGSHIFT)
|
||||
|
||||
/*
|
||||
* Constants related to network buffer management.
|
||||
* MCLBYTES must be no larger than CLBYTES (the software page size), and,
|
||||
* on machines that exchange pages of input or output buffers with mbuf
|
||||
* clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple
|
||||
* of the hardware page size.
|
||||
*/
|
||||
#define MSIZE 128 /* size of an mbuf */
|
||||
#define MCLBYTES 2048 /* large enough for ether MTU */
|
||||
#define MCLSHIFT 11
|
||||
#define MCLOFSET (MCLBYTES - 1)
|
||||
#ifndef NMBCLUSTERS
|
||||
#ifdef GATEWAY
|
||||
#define NMBCLUSTERS 512 /* map size, max cluster allocation */
|
||||
#else
|
||||
#define NMBCLUSTERS 256 /* map size, max cluster allocation */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Size of kernel malloc arena in CLBYTES-sized logical pages
|
||||
*/
|
||||
#ifndef NKMEMCLUSTERS
|
||||
#define NKMEMCLUSTERS (2048*1024/CLBYTES)
|
||||
#endif
|
||||
|
||||
/* pages ("clicks") to disk blocks */
|
||||
#define ctod(x) ((x) << (PGSHIFT - DEV_BSHIFT))
|
||||
#define dtoc(x) ((x) >> (PGSHIFT - DEV_BSHIFT))
|
||||
|
||||
/* pages to bytes */
|
||||
#define ctob(x) ((x) << PGSHIFT)
|
||||
#define btoc(x) (((x) + PGOFSET) >> PGSHIFT)
|
||||
|
||||
/* bytes to disk blocks */
|
||||
#define btodb(x) ((x) >> DEV_BSHIFT)
|
||||
#define dbtob(x) ((x) << DEV_BSHIFT)
|
||||
|
||||
/*
|
||||
* Map a ``block device block'' to a file system block.
|
||||
* This should be device dependent, and should use the bsize
|
||||
* field from the disk label.
|
||||
* For now though just use DEV_BSIZE.
|
||||
*/
|
||||
#define bdbtofsb(bn) ((bn) / (BLKDEV_IOSIZE/DEV_BSIZE))
|
||||
|
||||
/* XXX - Does this really belong here? -gwr */
|
||||
#include <machine/psl.h>
|
||||
|
||||
#if defined(_KERNEL) && !defined(_LOCORE)
|
||||
extern void _delay __P((unsigned));
|
||||
#define delay(us) _delay((us)<<8)
|
||||
#define DELAY(n) delay(n)
|
||||
#endif /* _KERNEL && !_LOCORE */
|
||||
|
||||
#endif /* MACHINE */
|
65
sys/arch/sun3x/include/pcb.h
Normal file
65
sys/arch/sun3x/include/pcb.h
Normal file
@ -0,0 +1,65 @@
|
||||
/* $NetBSD: pcb.h,v 1.1.1.1 1997/01/14 20:57:06 gwr Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988 University of Utah.
|
||||
* Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* the Systems Programming Group of the University of Utah Computer
|
||||
* Science Department.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: Utah Hdr: pcb.h 1.14 91/03/25
|
||||
* from: @(#)pcb.h 8.1 (Berkeley) 6/10/93
|
||||
*/
|
||||
|
||||
#include <machine/frame.h>
|
||||
|
||||
/*
|
||||
* Sun3x process control block
|
||||
*/
|
||||
struct pcb {
|
||||
short pcb_flags; /* misc. process flags */
|
||||
short pcb_ps; /* processor status word */
|
||||
int pcb_mmuctx; /* MMU context number */
|
||||
int pcb_usp; /* user stack pointer */
|
||||
int pcb_regs[12]; /* D2-D7, A2-A7 */
|
||||
caddr_t pcb_onfault; /* for copyin/out faults */
|
||||
struct fpframe pcb_fpregs; /* 68881/2 context save area */
|
||||
};
|
||||
|
||||
/*
|
||||
* The pcb is augmented with machine-dependent additional data for
|
||||
* core dumps. For the sun3, this includes just an exec header.
|
||||
*/
|
||||
struct md_coredump {
|
||||
int md_exec[16]; /* exec structure for core dumps */
|
||||
};
|
84
sys/arch/sun3x/include/pmap.h
Normal file
84
sys/arch/sun3x/include/pmap.h
Normal file
@ -0,0 +1,84 @@
|
||||
/* $NetBSD: pmap.h,v 1.1.1.1 1997/01/14 20:57:06 gwr Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Jeremy Cooper.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _SUN3X_PMAP_H
|
||||
#define _SUN3X_PMAP_H
|
||||
|
||||
/*
|
||||
* Physical map structures exported to the VM code.
|
||||
*/
|
||||
|
||||
struct pmap {
|
||||
int pm_refcount; /* pmap reference count */
|
||||
simple_lock_data_t pm_lock; /* lock on pmap */
|
||||
struct pmap_statistics pm_stats; /* pmap statistics */
|
||||
struct a_tmgr_struct *pm_a_tbl; /* Root level MMU table to use */
|
||||
};
|
||||
|
||||
typedef struct pmap *pmap_t;
|
||||
|
||||
#ifdef _KERNEL
|
||||
extern struct pmap kernel_pmap;
|
||||
struct pcb;
|
||||
void pmap_activate __P((pmap_t pmap, struct pcb *pcbp));
|
||||
void pmap_deactivate __P((pmap_t pmap, struct pcb *pcbp));
|
||||
|
||||
#define pmap_kernel() (&kernel_pmap)
|
||||
|
||||
#define PMAP_ACTIVATE(pmap, pcbp, iscurproc) \
|
||||
pmap_activate(pmap, pcbp)
|
||||
#define PMAP_DEACTIVATE(pmap, pcbp) \
|
||||
pmap_deactivate(pmap, pcbp)
|
||||
|
||||
#define pmap_resident_count(pmap) ((pmap)->pm_stats.resident_count)
|
||||
#define pmap_wired_count(pmap) ((pmap)->pm_stats.wired_count)
|
||||
|
||||
#define pmap_phys_address(page) (page)
|
||||
|
||||
/*
|
||||
* Flags to tell pmap_enter `this is not to be cached', etc.
|
||||
* Since physical addresses are always aligned, we can use
|
||||
* the low order bits for this.
|
||||
*/
|
||||
#define PMAP_VME16 0x10 /* pmap will add the necessary offset */
|
||||
#define PMAP_VME32 0x20 /* etc. */
|
||||
#define PMAP_NC 0x40 /* tells pmap_enter to set PTE_CI */
|
||||
#define PMAP_SPEC 0xFF /* mask to get all above. */
|
||||
|
||||
#endif /* _KERNEL */
|
||||
#endif /* _SUN3X_PMAP_H */
|
52
sys/arch/sun3x/include/proc.h
Normal file
52
sys/arch/sun3x/include/proc.h
Normal file
@ -0,0 +1,52 @@
|
||||
/* $NetBSD: proc.h,v 1.1.1.1 1997/01/14 20:57:06 gwr Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1991, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: proc.h 8.1 (Berkeley) 6/10/93
|
||||
*/
|
||||
|
||||
/*
|
||||
* Machine-dependent part of the proc structure for sun3.
|
||||
*/
|
||||
struct mdproc {
|
||||
int *md_regs; /* registers on current frame */
|
||||
int md_flags; /* machine-dependent flags */
|
||||
};
|
||||
|
||||
/* md_flags */
|
||||
#define MDP_FPUSED 0x0001 /* floating point coprocessor used */
|
||||
#define MDP_STACKADJ 0x0002 /* frame SP adjusted, might have to
|
||||
undo when system call returns
|
||||
ERESTART. */
|
||||
#define MDP_HPUXTRACE 0x0004 /* being traced by HP-UX process */
|
||||
|
3
sys/arch/sun3x/include/profile.h
Normal file
3
sys/arch/sun3x/include/profile.h
Normal file
@ -0,0 +1,3 @@
|
||||
/* $NetBSD: profile.h,v 1.1.1.1 1997/01/14 20:57:06 gwr Exp $ */
|
||||
|
||||
#include <m68k/profile.h>
|
112
sys/arch/sun3x/include/psl.h
Normal file
112
sys/arch/sun3x/include/psl.h
Normal file
@ -0,0 +1,112 @@
|
||||
/* $NetBSD: psl.h,v 1.1.1.1 1997/01/14 20:57:06 gwr Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Gordon W. Ross.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef PSL_C
|
||||
#include <m68k/psl.h>
|
||||
|
||||
/* Could define this in the common <m68k/psl.h> instead. */
|
||||
|
||||
#if defined(_KERNEL) && !defined(_LOCORE)
|
||||
|
||||
#ifndef __GNUC__
|
||||
/* No inline, use real function in locore.s */
|
||||
extern int _spl(int new);
|
||||
#else /* GNUC */
|
||||
/*
|
||||
* Define an inline function for PSL manipulation.
|
||||
* This is as close to a macro as one can get.
|
||||
* If not optimizing, the one in locore.s is used.
|
||||
* (See the GCC extensions info document.)
|
||||
*/
|
||||
extern __inline__ int _spl(int new)
|
||||
{
|
||||
register int old;
|
||||
|
||||
__asm __volatile (
|
||||
"clrl %0; movew sr,%0; movew %1,sr" :
|
||||
"&=d" (old) : "di" (new));
|
||||
return (old);
|
||||
}
|
||||
#endif /* GNUC */
|
||||
|
||||
/*
|
||||
* The rest of this is sun3 specific, because other ports may
|
||||
* need to do special things in spl0() (i.e. simulate SIR).
|
||||
* Suns have a REAL interrupt register, so spl0() and splx(s)
|
||||
* have no need to check for any simulated interrupts, etc.
|
||||
*/
|
||||
|
||||
#define spl0() _spl(PSL_S|PSL_IPL0)
|
||||
#define spl1() _spl(PSL_S|PSL_IPL1)
|
||||
#define spl2() _spl(PSL_S|PSL_IPL2)
|
||||
#define spl3() _spl(PSL_S|PSL_IPL3)
|
||||
#define spl4() _spl(PSL_S|PSL_IPL4)
|
||||
#define spl5() _spl(PSL_S|PSL_IPL5)
|
||||
#define spl6() _spl(PSL_S|PSL_IPL6)
|
||||
#define spl7() _spl(PSL_S|PSL_IPL7)
|
||||
#define splx(x) _spl(x)
|
||||
|
||||
/* IPL used by soft interrupts: netintr(), softclock() */
|
||||
#define splsoftclock() spl1()
|
||||
#define splsoftnet() spl1()
|
||||
|
||||
/* Highest block device (strategy) IPL. */
|
||||
#define splbio() spl2()
|
||||
|
||||
/* Highest network interface IPL. */
|
||||
#define splnet() spl3()
|
||||
|
||||
/* Highest tty device IPL. */
|
||||
#define spltty() spl4()
|
||||
|
||||
/* Requirement: imp >= (highest network, tty, or disk IPL) */
|
||||
#define splimp() spl4()
|
||||
|
||||
/* Intersil clock hardware interrupts (hard-wired at 5) */
|
||||
#define splclock() spl5()
|
||||
#define splstatclock() splclock()
|
||||
|
||||
/* Block out all interrupts (except NMI of course). */
|
||||
#define splhigh() spl7()
|
||||
#define splsched() spl7()
|
||||
|
||||
/* Get current sr value (debug, etc.) */
|
||||
extern int getsr __P((void));
|
||||
|
||||
#endif /* KERNEL && !_LOCORE */
|
||||
#endif /* PSL_C */
|
3
sys/arch/sun3x/include/ptrace.h
Normal file
3
sys/arch/sun3x/include/ptrace.h
Normal file
@ -0,0 +1,3 @@
|
||||
/* $NetBSD: ptrace.h,v 1.1.1.1 1997/01/14 20:57:06 gwr Exp $ */
|
||||
|
||||
#include <m68k/ptrace.h>
|
3
sys/arch/sun3x/include/reg.h
Normal file
3
sys/arch/sun3x/include/reg.h
Normal file
@ -0,0 +1,3 @@
|
||||
/* $NetBSD: reg.h,v 1.1.1.1 1997/01/14 20:57:06 gwr Exp $ */
|
||||
|
||||
#include <m68k/reg.h>
|
68
sys/arch/sun3x/include/remote-sl.h
Normal file
68
sys/arch/sun3x/include/remote-sl.h
Normal file
@ -0,0 +1,68 @@
|
||||
/* $NetBSD: remote-sl.h,v 1.1.1.1 1997/01/14 20:57:06 gwr Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This software was developed by the Computer Systems Engineering group
|
||||
* at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
|
||||
* contributed to Berkeley.
|
||||
*
|
||||
* All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Lawrence Berkeley Laboratory.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)remote-sl.h 8.1 (Berkeley) 6/11/93
|
||||
*/
|
||||
|
||||
/*
|
||||
* These definitions are factored out into an include file so
|
||||
* the kernel stub has access to them.
|
||||
*/
|
||||
#define FRAME_START 0xc1 /* Frame End */
|
||||
#define FRAME_END 0xc0 /* Frame End */
|
||||
#define FRAME_ESCAPE 0xdb /* Frame Esc */
|
||||
#define TRANS_FRAME_START 0xde /* transposed frame start */
|
||||
#define TRANS_FRAME_END 0xdc /* transposed frame esc */
|
||||
#define TRANS_FRAME_ESCAPE 0xdd /* transposed frame esc */
|
||||
|
||||
/*
|
||||
* Message limits. SL_MAXDATA is the maximum number of bytes that can
|
||||
* be read or written. SL_BUFSIZE is the maximum amount of data that
|
||||
* can be passed across the serial link. The actual MTU is two times
|
||||
* the max message (since each byte might be escaped), plus the two
|
||||
* framing bytes. We add two to the message length to account for the
|
||||
* type byte and checksum.
|
||||
*/
|
||||
#define SL_MAXDATA 62 /* max data that can be read */
|
||||
#define SL_RPCSIZE (1 + SL_MAXDATA) /* errno byte + data */
|
||||
#define SL_MTU ((2 * (SL_RPCSIZE + 2) + 2))
|
156
sys/arch/sun3x/include/saio.h
Normal file
156
sys/arch/sun3x/include/saio.h
Normal file
@ -0,0 +1,156 @@
|
||||
/* $NetBSD: saio.h,v 1.1.1.1 1997/01/14 20:57:06 gwr Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Gordon W. Ross.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This file derived from kernel/mach/sun3.md/machMon.h from the
|
||||
* sprite distribution.
|
||||
*
|
||||
* In particular, this file came out of the Walnut Creek cdrom collection
|
||||
* which contained no warnings about any possible copyright infringement.
|
||||
*/
|
||||
|
||||
/*
|
||||
* machMon.h --
|
||||
*
|
||||
* Structures, constants and defines for access to the sun monitor.
|
||||
* These were translated from the sun monitor header files:
|
||||
* mon/sunromvec.h
|
||||
* stand/saio.h
|
||||
*
|
||||
* Copyright (C) 1985 Regents of the University of California
|
||||
* All rights reserved.
|
||||
*
|
||||
* Header: /sprite/src/boot/sunprom/sun3.md/RCS/machMon.h,v \
|
||||
* 1.1 90/09/17 10:57:28 rab Exp Locker: rab $ SPRITE (Berkeley)
|
||||
*/
|
||||
|
||||
/*
|
||||
* The table entry that describes a device. It exists in the PROM; a
|
||||
* pointer to it is passed in MachMonBootParam. It can be used to locate
|
||||
* PROM subroutines for opening, reading, and writing the device.
|
||||
*
|
||||
* When using this interface, only one device can be open at once.
|
||||
*/
|
||||
typedef struct boottab {
|
||||
char b_dev[2]; /* The name of the device */
|
||||
int (*b_probe)(); /* probe() --> -1 or found controller
|
||||
number */
|
||||
int (*b_boot)(); /* boot(bp) --> -1 or start address */
|
||||
int (*b_open)(); /* open(iobp) --> -1 or 0 */
|
||||
int (*b_close)(); /* close(iobp) --> -1 or 0 */
|
||||
int (*b_strategy)(); /* strategy(iobp,rw) --> -1 or 0 */
|
||||
char *b_desc; /* Printable string describing dev */
|
||||
struct devinfo *b_devinfo; /* Information to configure device */
|
||||
} MachMonBootDevice;
|
||||
|
||||
enum MAPTYPES { /* Page map entry types. */
|
||||
MAP_MAINMEM,
|
||||
MAP_OBIO,
|
||||
MAP_MBMEM,
|
||||
MAP_MBIO,
|
||||
MAP_VME16A16D,
|
||||
MAP_VME16A32D,
|
||||
MAP_VME24A16D,
|
||||
MAP_VME24A32D,
|
||||
MAP_VME32A16D,
|
||||
MAP_VME32A32D
|
||||
};
|
||||
|
||||
/*
|
||||
* This table gives information about the resources needed by a device.
|
||||
*/
|
||||
typedef struct devinfo {
|
||||
unsigned int d_devbytes; /* Bytes occupied by device in IO space. */
|
||||
unsigned int d_dmabytes; /* Bytes needed by device in DMA memory. */
|
||||
unsigned int d_localbytes; /* Bytes needed by device for local info. */
|
||||
unsigned int d_stdcount; /* How many standard addresses. */
|
||||
unsigned long *d_stdaddrs; /* The vector of standard addresses. */
|
||||
enum MAPTYPES d_devtype; /* What map space device is in. */
|
||||
unsigned int d_maxiobytes; /* Size to break big I/O's into. */
|
||||
} MachMonDevInfo;
|
||||
|
||||
|
||||
/*
|
||||
* A "stand alone I/O request", (from SunOS saio.h)
|
||||
* This is passed as the main argument to the PROM I/O routines
|
||||
* in the MachMonBootDevice structure.
|
||||
*/
|
||||
typedef struct saioreq {
|
||||
char si_flgs;
|
||||
struct boottab *si_boottab; /* Points to boottab entry if any */
|
||||
char *si_devdata; /* Device-specific data pointer */
|
||||
int si_ctlr; /* Controller number or address */
|
||||
int si_unit; /* Unit number within controller */
|
||||
long si_boff; /* Partition number within unit */
|
||||
long si_cyloff;
|
||||
long si_offset;
|
||||
long si_bn; /* Block number to R/W */
|
||||
char *si_ma; /* Memory address to R/W */
|
||||
int si_cc; /* Character count to R/W */
|
||||
struct saif *si_sif; /* net if. pointer (set by b_open) */
|
||||
char *si_devaddr; /* Points to mapped in device */
|
||||
char *si_dmaaddr; /* Points to allocated DMA space */
|
||||
} MachMonIORequest;
|
||||
|
||||
|
||||
#define SAIO_F_READ 0x01
|
||||
#define SAIO_F_WRITE 0x02
|
||||
#define SAIO_F_ALLOC 0x04
|
||||
#define SAIO_F_FILE 0x08
|
||||
#define SAIO_F_EOF 0x10 /* EOF on device */
|
||||
#define SAIO_F_AJAR 0x20 /* Descriptor "ajar" (stopped but not closed) */
|
||||
|
||||
|
||||
/*
|
||||
* Ethernet interface descriptor (from SunOS saio.h)
|
||||
* First, set: saiop->si_devaddr, saiop->si_dmaaddr, etc.
|
||||
* Then: saiop->si_boottab->b_open() will set:
|
||||
* saiop->si_sif;
|
||||
* saiop->si_devdata;
|
||||
* The latter is the first arg to the following functions.
|
||||
* Note that the buffer must be in DVMA space...
|
||||
*/
|
||||
struct saif {
|
||||
/* transmit packet, returns zero on success. */
|
||||
int (*sif_xmit)(void *devdata, char *buf, int len);
|
||||
/* wait for packet, zero if none arrived */
|
||||
int (*sif_poll)(void *devdata, char *buf);
|
||||
/* reset interface, set addresses, etc. */
|
||||
int (*sif_reset)(void *devdata, struct saioreq *sip);
|
||||
/* Later (sun4 only) proms have more stuff here. */
|
||||
};
|
3
sys/arch/sun3x/include/setjmp.h
Normal file
3
sys/arch/sun3x/include/setjmp.h
Normal file
@ -0,0 +1,3 @@
|
||||
/* $NetBSD: setjmp.h,v 1.1.1.1 1997/01/14 20:57:06 gwr Exp $ */
|
||||
|
||||
#include <m68k/setjmp.h>
|
Loading…
Reference in New Issue
Block a user