Rewrite the pc98 bus_space stuff.
The type of bus_space_tag_t is now a pointer to bus_space_tag structure, and the bus_space_tag structure saves pointers to functions for direct access and relocate access. Added bsh_bam member to the bus_space_handle structure, it saves access method either direct access or relocate access which is called by bus_space_* functions. Added the mecia device support. If the bs_da and bs_ra in bus tag are set NEPC_io_space_tag and NEPC_mem_space_tag respectively, new bus_space stuff changes the register of mecia automatically for 16bit access. Obtained from: NetBSD/pc98
This commit is contained in:
parent
b508ad43c6
commit
f2eeb19063
@ -215,3 +215,10 @@ ASSYM(VM86_FRAMESIZE, sizeof(struct vm86frame));
|
||||
ASSYM(MTX_LOCK, offsetof(struct mtx, mtx_lock));
|
||||
ASSYM(MTX_RECURSECNT, offsetof(struct mtx, mtx_recurse));
|
||||
ASSYM(MTX_SAVECRIT, offsetof(struct mtx, mtx_savecrit));
|
||||
|
||||
#ifdef PC98
|
||||
#include <machine/bus.h>
|
||||
|
||||
ASSYM(BUS_SPACE_HANDLE_BASE, offsetof(struct bus_space_handle, bsh_base));
|
||||
ASSYM(BUS_SPACE_HANDLE_IAT, offsetof(struct bus_space_handle, bsh_iat));
|
||||
#endif
|
||||
|
@ -451,10 +451,13 @@ nexus_alloc_resource(device_t bus, device_t child, int type, int *rid,
|
||||
#ifdef PC98
|
||||
/* PC-98: the type of bus_space_handle_t is the structure. */
|
||||
rv->r_bushandle->bsh_base = rv->r_start;
|
||||
rv->r_bushandle->bsh_iat = NULL;
|
||||
rv->r_bushandle->bsh_maxiatsz = BUS_SPACE_IAT_MAXSIZE;
|
||||
rv->r_bushandle->bsh_iatsz = 0;
|
||||
rv->r_bushandle->bsh_res = NULL;
|
||||
rv->r_bushandle->bsh_ressz = 0;
|
||||
|
||||
/* default: direct access */
|
||||
rv->r_bushandle->bsh_bam = rv->r_bustag->bs_da;
|
||||
#else
|
||||
/* IBM-PC: the type of bus_space_handle_t is u_int */
|
||||
rman_set_bushandle(rv, rv->r_start);
|
||||
@ -504,10 +507,13 @@ nexus_activate_resource(device_t bus, device_t child, int type, int rid,
|
||||
#ifdef PC98
|
||||
/* PC-98: the type of bus_space_handle_t is the structure. */
|
||||
r->r_bushandle->bsh_base = (bus_addr_t) vaddr;
|
||||
r->r_bushandle->bsh_iat = NULL;
|
||||
r->r_bushandle->bsh_maxiatsz = BUS_SPACE_IAT_MAXSIZE;
|
||||
r->r_bushandle->bsh_iatsz = 0;
|
||||
r->r_bushandle->bsh_res = NULL;
|
||||
r->r_bushandle->bsh_ressz = 0;
|
||||
|
||||
/* default: direct access */
|
||||
r->r_bushandle->bsh_bam = r->r_bustag->bs_da;
|
||||
#else
|
||||
/* IBM-PC: the type of bus_space_handle_t is u_int */
|
||||
rman_set_bushandle(r, (bus_space_handle_t) vaddr);
|
||||
|
@ -451,10 +451,13 @@ nexus_alloc_resource(device_t bus, device_t child, int type, int *rid,
|
||||
#ifdef PC98
|
||||
/* PC-98: the type of bus_space_handle_t is the structure. */
|
||||
rv->r_bushandle->bsh_base = rv->r_start;
|
||||
rv->r_bushandle->bsh_iat = NULL;
|
||||
rv->r_bushandle->bsh_maxiatsz = BUS_SPACE_IAT_MAXSIZE;
|
||||
rv->r_bushandle->bsh_iatsz = 0;
|
||||
rv->r_bushandle->bsh_res = NULL;
|
||||
rv->r_bushandle->bsh_ressz = 0;
|
||||
|
||||
/* default: direct access */
|
||||
rv->r_bushandle->bsh_bam = rv->r_bustag->bs_da;
|
||||
#else
|
||||
/* IBM-PC: the type of bus_space_handle_t is u_int */
|
||||
rman_set_bushandle(rv, rv->r_start);
|
||||
@ -504,10 +507,13 @@ nexus_activate_resource(device_t bus, device_t child, int type, int rid,
|
||||
#ifdef PC98
|
||||
/* PC-98: the type of bus_space_handle_t is the structure. */
|
||||
r->r_bushandle->bsh_base = (bus_addr_t) vaddr;
|
||||
r->r_bushandle->bsh_iat = NULL;
|
||||
r->r_bushandle->bsh_maxiatsz = BUS_SPACE_IAT_MAXSIZE;
|
||||
r->r_bushandle->bsh_iatsz = 0;
|
||||
r->r_bushandle->bsh_res = NULL;
|
||||
r->r_bushandle->bsh_ressz = 0;
|
||||
|
||||
/* default: direct access */
|
||||
r->r_bushandle->bsh_bam = r->r_bustag->bs_da;
|
||||
#else
|
||||
/* IBM-PC: the type of bus_space_handle_t is u_int */
|
||||
rman_set_bushandle(r, (bus_space_handle_t) vaddr);
|
||||
|
@ -197,19 +197,24 @@ isa_alloc_resourcev(device_t child, int type, int *rid,
|
||||
int
|
||||
isa_load_resourcev(struct resource *re, bus_addr_t *res, bus_size_t count)
|
||||
{
|
||||
bus_addr_t *addr;
|
||||
bus_addr_t start;
|
||||
int i;
|
||||
|
||||
addr = malloc(sizeof (bus_addr_t) * count, M_DEVBUF, M_NOWAIT);
|
||||
if (addr == NULL)
|
||||
return 1;
|
||||
if (count > re->r_bushandle->bsh_maxiatsz) {
|
||||
printf("isa_load_resourcev: map size too large\n");
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
addr[i] = rman_get_start(re) + res[i];
|
||||
start = rman_get_start(re);
|
||||
for (i = 0; i < re->r_bushandle->bsh_maxiatsz; i++) {
|
||||
if (i < count)
|
||||
re->r_bushandle->bsh_iat[i] = start + res[i];
|
||||
else
|
||||
re->r_bushandle->bsh_iat[i] = start;
|
||||
}
|
||||
|
||||
rman_set_bustag(re, I386_BUS_SPACE_IO_IND);
|
||||
re->r_bushandle->bsh_iat = addr;
|
||||
re->r_bushandle->bsh_iatsz = count;
|
||||
re->r_bushandle->bsh_bam = re->r_bustag->bs_ra; /* relocate access */
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -233,8 +238,6 @@ isa_release_resource(device_t bus, device_t child, int type, int rid,
|
||||
r->r_bushandle->bsh_res[i]);
|
||||
if (r->r_bushandle->bsh_res != NULL)
|
||||
free(r->r_bushandle->bsh_res, M_DEVBUF);
|
||||
if (r->r_bushandle->bsh_iat != NULL)
|
||||
free(r->r_bushandle->bsh_iat, M_DEVBUF);
|
||||
#endif
|
||||
return resource_list_release(rl, bus, child, type, rid, r);
|
||||
}
|
||||
|
@ -380,6 +380,8 @@ netsmb/smb_trantcp.c optional netsmb
|
||||
netsmb/smb_usr.c optional netsmb
|
||||
pc98/apm/apm.c optional apm
|
||||
pc98/apm/apm_bioscall.s optional apm
|
||||
pc98/i386/busio.s standard
|
||||
pc98/i386/busiosubr.c standard
|
||||
pc98/i386/machdep.c standard
|
||||
#pc98/i386/userconfig.c optional userconfig
|
||||
pc98/pc98/atapi.c optional wdc
|
||||
|
@ -208,6 +208,7 @@ LINE30 opt_syscons.h
|
||||
DEV_NPX opt_npx.h
|
||||
DEV_APM opt_apm.h
|
||||
DEV_SPLASH opt_splash.h
|
||||
DEV_MECIA opt_mecia.h
|
||||
|
||||
# SMB/CIFS requester
|
||||
NETSMB opt_netsmb.h
|
||||
|
@ -215,3 +215,10 @@ ASSYM(VM86_FRAMESIZE, sizeof(struct vm86frame));
|
||||
ASSYM(MTX_LOCK, offsetof(struct mtx, mtx_lock));
|
||||
ASSYM(MTX_RECURSECNT, offsetof(struct mtx, mtx_recurse));
|
||||
ASSYM(MTX_SAVECRIT, offsetof(struct mtx, mtx_savecrit));
|
||||
|
||||
#ifdef PC98
|
||||
#include <machine/bus.h>
|
||||
|
||||
ASSYM(BUS_SPACE_HANDLE_BASE, offsetof(struct bus_space_handle, bsh_base));
|
||||
ASSYM(BUS_SPACE_HANDLE_IAT, offsetof(struct bus_space_handle, bsh_iat));
|
||||
#endif
|
||||
|
@ -451,10 +451,13 @@ nexus_alloc_resource(device_t bus, device_t child, int type, int *rid,
|
||||
#ifdef PC98
|
||||
/* PC-98: the type of bus_space_handle_t is the structure. */
|
||||
rv->r_bushandle->bsh_base = rv->r_start;
|
||||
rv->r_bushandle->bsh_iat = NULL;
|
||||
rv->r_bushandle->bsh_maxiatsz = BUS_SPACE_IAT_MAXSIZE;
|
||||
rv->r_bushandle->bsh_iatsz = 0;
|
||||
rv->r_bushandle->bsh_res = NULL;
|
||||
rv->r_bushandle->bsh_ressz = 0;
|
||||
|
||||
/* default: direct access */
|
||||
rv->r_bushandle->bsh_bam = rv->r_bustag->bs_da;
|
||||
#else
|
||||
/* IBM-PC: the type of bus_space_handle_t is u_int */
|
||||
rman_set_bushandle(rv, rv->r_start);
|
||||
@ -504,10 +507,13 @@ nexus_activate_resource(device_t bus, device_t child, int type, int rid,
|
||||
#ifdef PC98
|
||||
/* PC-98: the type of bus_space_handle_t is the structure. */
|
||||
r->r_bushandle->bsh_base = (bus_addr_t) vaddr;
|
||||
r->r_bushandle->bsh_iat = NULL;
|
||||
r->r_bushandle->bsh_maxiatsz = BUS_SPACE_IAT_MAXSIZE;
|
||||
r->r_bushandle->bsh_iatsz = 0;
|
||||
r->r_bushandle->bsh_res = NULL;
|
||||
r->r_bushandle->bsh_ressz = 0;
|
||||
|
||||
/* default: direct access */
|
||||
r->r_bushandle->bsh_bam = r->r_bustag->bs_da;
|
||||
#else
|
||||
/* IBM-PC: the type of bus_space_handle_t is u_int */
|
||||
rman_set_bushandle(r, (bus_space_handle_t) vaddr);
|
||||
|
@ -451,10 +451,13 @@ nexus_alloc_resource(device_t bus, device_t child, int type, int *rid,
|
||||
#ifdef PC98
|
||||
/* PC-98: the type of bus_space_handle_t is the structure. */
|
||||
rv->r_bushandle->bsh_base = rv->r_start;
|
||||
rv->r_bushandle->bsh_iat = NULL;
|
||||
rv->r_bushandle->bsh_maxiatsz = BUS_SPACE_IAT_MAXSIZE;
|
||||
rv->r_bushandle->bsh_iatsz = 0;
|
||||
rv->r_bushandle->bsh_res = NULL;
|
||||
rv->r_bushandle->bsh_ressz = 0;
|
||||
|
||||
/* default: direct access */
|
||||
rv->r_bushandle->bsh_bam = rv->r_bustag->bs_da;
|
||||
#else
|
||||
/* IBM-PC: the type of bus_space_handle_t is u_int */
|
||||
rman_set_bushandle(rv, rv->r_start);
|
||||
@ -504,10 +507,13 @@ nexus_activate_resource(device_t bus, device_t child, int type, int rid,
|
||||
#ifdef PC98
|
||||
/* PC-98: the type of bus_space_handle_t is the structure. */
|
||||
r->r_bushandle->bsh_base = (bus_addr_t) vaddr;
|
||||
r->r_bushandle->bsh_iat = NULL;
|
||||
r->r_bushandle->bsh_maxiatsz = BUS_SPACE_IAT_MAXSIZE;
|
||||
r->r_bushandle->bsh_iatsz = 0;
|
||||
r->r_bushandle->bsh_res = NULL;
|
||||
r->r_bushandle->bsh_ressz = 0;
|
||||
|
||||
/* default: direct access */
|
||||
r->r_bushandle->bsh_bam = r->r_bustag->bs_da;
|
||||
#else
|
||||
/* IBM-PC: the type of bus_space_handle_t is u_int */
|
||||
rman_set_bushandle(r, (bus_space_handle_t) vaddr);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,31 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1997 Justin Gibbs.
|
||||
* 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,
|
||||
* without modification, immediately at the beginning of the file.
|
||||
* 2. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#ifndef _I386_BUS_PIO_IND_H_
|
||||
#define _I386_BUS_PIO_IND_H_
|
||||
#endif /* _I386_BUS_PIO_IND_H_ */
|
@ -197,19 +197,24 @@ isa_alloc_resourcev(device_t child, int type, int *rid,
|
||||
int
|
||||
isa_load_resourcev(struct resource *re, bus_addr_t *res, bus_size_t count)
|
||||
{
|
||||
bus_addr_t *addr;
|
||||
bus_addr_t start;
|
||||
int i;
|
||||
|
||||
addr = malloc(sizeof (bus_addr_t) * count, M_DEVBUF, M_NOWAIT);
|
||||
if (addr == NULL)
|
||||
return 1;
|
||||
if (count > re->r_bushandle->bsh_maxiatsz) {
|
||||
printf("isa_load_resourcev: map size too large\n");
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
addr[i] = rman_get_start(re) + res[i];
|
||||
start = rman_get_start(re);
|
||||
for (i = 0; i < re->r_bushandle->bsh_maxiatsz; i++) {
|
||||
if (i < count)
|
||||
re->r_bushandle->bsh_iat[i] = start + res[i];
|
||||
else
|
||||
re->r_bushandle->bsh_iat[i] = start;
|
||||
}
|
||||
|
||||
rman_set_bustag(re, I386_BUS_SPACE_IO_IND);
|
||||
re->r_bushandle->bsh_iat = addr;
|
||||
re->r_bushandle->bsh_iatsz = count;
|
||||
re->r_bushandle->bsh_bam = re->r_bustag->bs_ra; /* relocate access */
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -233,8 +238,6 @@ isa_release_resource(device_t bus, device_t child, int type, int rid,
|
||||
r->r_bushandle->bsh_res[i]);
|
||||
if (r->r_bushandle->bsh_res != NULL)
|
||||
free(r->r_bushandle->bsh_res, M_DEVBUF);
|
||||
if (r->r_bushandle->bsh_iat != NULL)
|
||||
free(r->r_bushandle->bsh_iat, M_DEVBUF);
|
||||
#endif
|
||||
return resource_list_release(rl, bus, child, type, rid, r);
|
||||
}
|
||||
|
1671
sys/pc98/i386/busio.s
Normal file
1671
sys/pc98/i386/busio.s
Normal file
File diff suppressed because it is too large
Load Diff
144
sys/pc98/i386/busiosubr.c
Normal file
144
sys/pc98/i386/busiosubr.c
Normal file
@ -0,0 +1,144 @@
|
||||
/* $FreeBSD$ */
|
||||
/* $NecBSD: busiosubr.c,v 1.30.4.4 1999/08/28 02:25:35 honda Exp $ */
|
||||
/* $NetBSD$ */
|
||||
|
||||
/*
|
||||
* [NetBSD for NEC PC-98 series]
|
||||
* Copyright (c) 1996, 1997, 1998
|
||||
* NetBSD/pc98 porting staff. All rights reserved.
|
||||
*
|
||||
* [Ported for FreeBSD]
|
||||
* Copyright (c) 2001
|
||||
* TAKAHASHI Yoshihiro. 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. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 1997, 1998
|
||||
* Naofumi HONDA. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <machine/bus.h>
|
||||
|
||||
_BUS_SPACE_CALL_FUNCS_PROTO(SBUS_DA_io,u_int8_t,1)
|
||||
_BUS_SPACE_CALL_FUNCS_PROTO(SBUS_DA_io,u_int16_t,2)
|
||||
_BUS_SPACE_CALL_FUNCS_PROTO(SBUS_DA_io,u_int32_t,4)
|
||||
_BUS_SPACE_CALL_FUNCS_PROTO(SBUS_DA_mem,u_int8_t,1)
|
||||
_BUS_SPACE_CALL_FUNCS_PROTO(SBUS_DA_mem,u_int16_t,2)
|
||||
_BUS_SPACE_CALL_FUNCS_PROTO(SBUS_DA_mem,u_int32_t,4)
|
||||
|
||||
_BUS_SPACE_CALL_FUNCS_PROTO(SBUS_RA_io,u_int8_t,1)
|
||||
_BUS_SPACE_CALL_FUNCS_PROTO(SBUS_RA_io,u_int16_t,2)
|
||||
_BUS_SPACE_CALL_FUNCS_PROTO(SBUS_RA_io,u_int32_t,4)
|
||||
_BUS_SPACE_CALL_FUNCS_PROTO(SBUS_RA_mem,u_int8_t,1)
|
||||
_BUS_SPACE_CALL_FUNCS_PROTO(SBUS_RA_mem,u_int16_t,2)
|
||||
_BUS_SPACE_CALL_FUNCS_PROTO(SBUS_RA_mem,u_int32_t,4)
|
||||
|
||||
struct bus_space_tag SBUS_io_space_tag = {
|
||||
BUS_SPACE_IO,
|
||||
|
||||
/* direct bus access methods */
|
||||
{
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(SBUS_DA_io,u_int8_t,1),
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(SBUS_DA_io,u_int16_t,2),
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(SBUS_DA_io,u_int32_t,4),
|
||||
},
|
||||
|
||||
/* relocate bus access methods */
|
||||
{
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(SBUS_RA_io,u_int8_t,1),
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(SBUS_RA_io,u_int16_t,2),
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(SBUS_RA_io,u_int32_t,4),
|
||||
}
|
||||
};
|
||||
|
||||
struct bus_space_tag SBUS_mem_space_tag = {
|
||||
BUS_SPACE_MEM,
|
||||
|
||||
/* direct bus access methods */
|
||||
{
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(SBUS_DA_mem,u_int8_t,1),
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(SBUS_DA_mem,u_int16_t,2),
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(SBUS_DA_mem,u_int32_t,4),
|
||||
},
|
||||
|
||||
/* relocate bus access methods */
|
||||
{
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(SBUS_RA_mem,u_int8_t,1),
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(SBUS_RA_mem,u_int16_t,2),
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(SBUS_RA_mem,u_int32_t,4),
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#include "opt_mecia.h"
|
||||
#ifdef DEV_MECIA
|
||||
|
||||
_BUS_SPACE_CALL_FUNCS_PROTO(NEPC_DA_io,u_int16_t,2)
|
||||
_BUS_SPACE_CALL_FUNCS_PROTO(NEPC_DA_io,u_int32_t,4)
|
||||
|
||||
_BUS_SPACE_CALL_FUNCS_PROTO(NEPC_RA_io,u_int16_t,2)
|
||||
_BUS_SPACE_CALL_FUNCS_PROTO(NEPC_RA_io,u_int32_t,4)
|
||||
|
||||
struct bus_space_tag NEPC_io_space_tag = {
|
||||
BUS_SPACE_IO,
|
||||
|
||||
/* direct bus access methods */
|
||||
{
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(SBUS_DA_io,u_int8_t,1),
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(NEPC_DA_io,u_int16_t,2),
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(NEPC_DA_io,u_int32_t,4),
|
||||
},
|
||||
|
||||
/* relocate bus access methods */
|
||||
{
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(SBUS_RA_io,u_int8_t,1),
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(NEPC_RA_io,u_int16_t,2),
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(NEPC_RA_io,u_int32_t,4),
|
||||
}
|
||||
};
|
||||
|
||||
struct bus_space_tag NEPC_mem_space_tag = {
|
||||
BUS_SPACE_MEM,
|
||||
|
||||
/* direct bus access methods */
|
||||
{
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(SBUS_DA_mem,u_int8_t,1),
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(SBUS_DA_mem,u_int16_t,2),
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(SBUS_DA_mem,u_int32_t,4),
|
||||
},
|
||||
|
||||
/* relocate bus access methods */
|
||||
{
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(SBUS_RA_mem,u_int8_t,1),
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(SBUS_RA_mem,u_int16_t,2),
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(SBUS_RA_mem,u_int32_t,4),
|
||||
}
|
||||
};
|
||||
|
||||
#endif /* DEV_MECIA */
|
1671
sys/pc98/pc98/busio.s
Normal file
1671
sys/pc98/pc98/busio.s
Normal file
File diff suppressed because it is too large
Load Diff
144
sys/pc98/pc98/busiosubr.c
Normal file
144
sys/pc98/pc98/busiosubr.c
Normal file
@ -0,0 +1,144 @@
|
||||
/* $FreeBSD$ */
|
||||
/* $NecBSD: busiosubr.c,v 1.30.4.4 1999/08/28 02:25:35 honda Exp $ */
|
||||
/* $NetBSD$ */
|
||||
|
||||
/*
|
||||
* [NetBSD for NEC PC-98 series]
|
||||
* Copyright (c) 1996, 1997, 1998
|
||||
* NetBSD/pc98 porting staff. All rights reserved.
|
||||
*
|
||||
* [Ported for FreeBSD]
|
||||
* Copyright (c) 2001
|
||||
* TAKAHASHI Yoshihiro. 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. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 1997, 1998
|
||||
* Naofumi HONDA. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <machine/bus.h>
|
||||
|
||||
_BUS_SPACE_CALL_FUNCS_PROTO(SBUS_DA_io,u_int8_t,1)
|
||||
_BUS_SPACE_CALL_FUNCS_PROTO(SBUS_DA_io,u_int16_t,2)
|
||||
_BUS_SPACE_CALL_FUNCS_PROTO(SBUS_DA_io,u_int32_t,4)
|
||||
_BUS_SPACE_CALL_FUNCS_PROTO(SBUS_DA_mem,u_int8_t,1)
|
||||
_BUS_SPACE_CALL_FUNCS_PROTO(SBUS_DA_mem,u_int16_t,2)
|
||||
_BUS_SPACE_CALL_FUNCS_PROTO(SBUS_DA_mem,u_int32_t,4)
|
||||
|
||||
_BUS_SPACE_CALL_FUNCS_PROTO(SBUS_RA_io,u_int8_t,1)
|
||||
_BUS_SPACE_CALL_FUNCS_PROTO(SBUS_RA_io,u_int16_t,2)
|
||||
_BUS_SPACE_CALL_FUNCS_PROTO(SBUS_RA_io,u_int32_t,4)
|
||||
_BUS_SPACE_CALL_FUNCS_PROTO(SBUS_RA_mem,u_int8_t,1)
|
||||
_BUS_SPACE_CALL_FUNCS_PROTO(SBUS_RA_mem,u_int16_t,2)
|
||||
_BUS_SPACE_CALL_FUNCS_PROTO(SBUS_RA_mem,u_int32_t,4)
|
||||
|
||||
struct bus_space_tag SBUS_io_space_tag = {
|
||||
BUS_SPACE_IO,
|
||||
|
||||
/* direct bus access methods */
|
||||
{
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(SBUS_DA_io,u_int8_t,1),
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(SBUS_DA_io,u_int16_t,2),
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(SBUS_DA_io,u_int32_t,4),
|
||||
},
|
||||
|
||||
/* relocate bus access methods */
|
||||
{
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(SBUS_RA_io,u_int8_t,1),
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(SBUS_RA_io,u_int16_t,2),
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(SBUS_RA_io,u_int32_t,4),
|
||||
}
|
||||
};
|
||||
|
||||
struct bus_space_tag SBUS_mem_space_tag = {
|
||||
BUS_SPACE_MEM,
|
||||
|
||||
/* direct bus access methods */
|
||||
{
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(SBUS_DA_mem,u_int8_t,1),
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(SBUS_DA_mem,u_int16_t,2),
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(SBUS_DA_mem,u_int32_t,4),
|
||||
},
|
||||
|
||||
/* relocate bus access methods */
|
||||
{
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(SBUS_RA_mem,u_int8_t,1),
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(SBUS_RA_mem,u_int16_t,2),
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(SBUS_RA_mem,u_int32_t,4),
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#include "opt_mecia.h"
|
||||
#ifdef DEV_MECIA
|
||||
|
||||
_BUS_SPACE_CALL_FUNCS_PROTO(NEPC_DA_io,u_int16_t,2)
|
||||
_BUS_SPACE_CALL_FUNCS_PROTO(NEPC_DA_io,u_int32_t,4)
|
||||
|
||||
_BUS_SPACE_CALL_FUNCS_PROTO(NEPC_RA_io,u_int16_t,2)
|
||||
_BUS_SPACE_CALL_FUNCS_PROTO(NEPC_RA_io,u_int32_t,4)
|
||||
|
||||
struct bus_space_tag NEPC_io_space_tag = {
|
||||
BUS_SPACE_IO,
|
||||
|
||||
/* direct bus access methods */
|
||||
{
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(SBUS_DA_io,u_int8_t,1),
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(NEPC_DA_io,u_int16_t,2),
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(NEPC_DA_io,u_int32_t,4),
|
||||
},
|
||||
|
||||
/* relocate bus access methods */
|
||||
{
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(SBUS_RA_io,u_int8_t,1),
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(NEPC_RA_io,u_int16_t,2),
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(NEPC_RA_io,u_int32_t,4),
|
||||
}
|
||||
};
|
||||
|
||||
struct bus_space_tag NEPC_mem_space_tag = {
|
||||
BUS_SPACE_MEM,
|
||||
|
||||
/* direct bus access methods */
|
||||
{
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(SBUS_DA_mem,u_int8_t,1),
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(SBUS_DA_mem,u_int16_t,2),
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(SBUS_DA_mem,u_int32_t,4),
|
||||
},
|
||||
|
||||
/* relocate bus access methods */
|
||||
{
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(SBUS_RA_mem,u_int8_t,1),
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(SBUS_RA_mem,u_int16_t,2),
|
||||
_BUS_SPACE_CALL_FUNCS_TAB(SBUS_RA_mem,u_int32_t,4),
|
||||
}
|
||||
};
|
||||
|
||||
#endif /* DEV_MECIA */
|
Loading…
x
Reference in New Issue
Block a user