diff options
author | dfr <dfr@FreeBSD.org> | 1998-07-22 08:25:39 +0000 |
---|---|---|
committer | dfr <dfr@FreeBSD.org> | 1998-07-22 08:25:39 +0000 |
commit | b5978db4045075c36509baf5eca410e23d9d1371 (patch) | |
tree | 63a10c988eccd4d6eb1d8c00a67933db74c9332a /sys/alpha | |
parent | 5dfe812895e5c144b6c7cd8c18fbe753225e2fd3 (diff) | |
download | FreeBSD-src-b5978db4045075c36509baf5eca410e23d9d1371.zip FreeBSD-src-b5978db4045075c36509baf5eca410e23d9d1371.tar.gz |
Add macros and chipset support for accessing device i/o memory on the alpha.
Diffstat (limited to 'sys/alpha')
-rw-r--r-- | sys/alpha/include/chipset.h | 19 | ||||
-rw-r--r-- | sys/alpha/include/cpufunc.h | 17 |
2 files changed, 34 insertions, 2 deletions
diff --git a/sys/alpha/include/chipset.h b/sys/alpha/include/chipset.h index 54b56c7..772f3e0 100644 --- a/sys/alpha/include/chipset.h +++ b/sys/alpha/include/chipset.h @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: chipset.h,v 1.1 1998/06/10 10:54:32 dfr Exp $ + * $Id: chipset.h,v 1.2 1998/07/12 16:16:22 dfr Exp $ */ #ifndef _MACHINE_CHIPSET_H_ @@ -36,6 +36,13 @@ typedef void alpha_chipset_outb_t(u_int32_t port, u_int8_t data); typedef void alpha_chipset_outw_t(u_int32_t port, u_int16_t data); typedef void alpha_chipset_outl_t(u_int32_t port, u_int32_t data); +typedef u_int8_t alpha_chipset_readb_t(u_int32_t pa); +typedef u_int16_t alpha_chipset_readw_t(u_int32_t pa); +typedef u_int32_t alpha_chipset_readl_t(u_int32_t pa); +typedef void alpha_chipset_writeb_t(u_int32_t pa, u_int8_t data); +typedef void alpha_chipset_writew_t(u_int32_t pa, u_int16_t data); +typedef void alpha_chipset_writel_t(u_int32_t pa, u_int32_t data); + typedef int alpha_chipset_maxdevs_t(u_int bus); typedef u_int8_t alpha_chipset_cfgreadb_t(u_int, u_int, u_int, u_int); typedef u_int16_t alpha_chipset_cfgreadw_t(u_int, u_int, u_int, u_int); @@ -60,6 +67,16 @@ typedef struct alpha_chipset { alpha_chipset_outl_t* outl; /* + * Memory access + */ + alpha_chipset_readb_t* readb; + alpha_chipset_readw_t* readw; + alpha_chipset_readl_t* readl; + alpha_chipset_writeb_t* writeb; + alpha_chipset_writew_t* writew; + alpha_chipset_writel_t* writel; + + /* * PCI configuration access */ alpha_chipset_maxdevs_t* maxdevs; diff --git a/sys/alpha/include/cpufunc.h b/sys/alpha/include/cpufunc.h index 6125ba3..960b2b4 100644 --- a/sys/alpha/include/cpufunc.h +++ b/sys/alpha/include/cpufunc.h @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: cpufunc.h,v 1.1 1998/06/10 10:54:51 dfr Exp $ */ #ifndef _MACHINE_CPUFUNC_H_ @@ -41,6 +41,21 @@ #define outw(port, data) chipset.outw(port, data) #define outl(port, data) chipset.outl(port, data) +#define readb(pa) chipset.readb(pa) +#define readw(pa) chipset.readw(pa) +#define readl(pa) chipset.readl(pa) +#define writeb(pa,v) chipset.writeb(pa,v) +#define writew(pa,v) chipset.writew(pa,v) +#define writel(pa,v) chipset.writel(pa,v) + +/* + * String version of IO memory access ops: + */ +extern void memcpy_fromio(void *, u_int32_t, size_t); +extern void memcpy_toio(u_int32_t, void *, size_t); +extern void memset_io(u_int32_t, int, size_t); + + #endif /* KERNEL */ #endif /* !_MACHINE_CPUFUNC_H_ */ |