summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorjunyoung <junyoung@NetBSD.org>2001-12-29 17:40:35 +0000
committerjunyoung <junyoung@NetBSD.org>2001-12-29 17:40:35 +0000
commitdde1e51a31bb62f31be72cdec847d3d9e26e297c (patch)
treef78883e74dc3e6c54b2280a0cdaa3cd85bb2a270 /sys/dev
parentea3be41a59fad6f3b22d8506a8407a7d705eefa7 (diff)
Add functions needed for access to CRTC registers.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/vgavar.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/sys/dev/ic/vgavar.h b/sys/dev/ic/vgavar.h
index f4852364b72..ddb1bbaff0d 100644
--- a/sys/dev/ic/vgavar.h
+++ b/sys/dev/ic/vgavar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: vgavar.h,v 1.9 2001/12/29 17:06:50 junyoung Exp $ */
+/* $NetBSD: vgavar.h,v 1.10 2001/12/29 17:40:35 junyoung Exp $ */
/*
* Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -82,6 +82,8 @@ static inline u_int8_t _vga_ts_read(struct vga_handle *, int);
static inline void _vga_ts_write(struct vga_handle *, int, u_int8_t);
static inline u_int8_t _vga_gdc_read(struct vga_handle *, int);
static inline void _vga_gdc_write(struct vga_handle *, int, u_int8_t);
+static inline u_int8_t _vga_crtc_read(struct vga_handle *, int);
+static inline void _vga_crtc_write(struct vga_handle *, int, u_int8_t);
static inline u_int8_t
_vga_attr_read(struct vga_handle *vh, int reg)
@@ -147,6 +149,20 @@ _vga_gdc_write(struct vga_handle *vh, int reg, u_int8_t val)
bus_space_write_1(vh->vh_iot, vh->vh_ioh_vga, VGA_GDC_DATA, val);
}
+static inline u_int8_t
+_vga_crtc_read(struct vga_handle *vh, int reg)
+{
+ bus_space_write_1(vh->vh_iot, vh->vh_ioh_vga, VGA_CRTC_INDEX, reg);
+ return (bus_space_read_1(vh->vh_iot, vh->vh_ioh_vga, VGA_CRTC_DATA));
+}
+
+static inline void
+_vga_crtc_write(struct vga_handle *vh, int reg, u_int8_t val)
+{
+ bus_space_write_1(vh->vh_iot, vh->vh_ioh_vga, VGA_CRTC_INDEX, reg);
+ bus_space_write_1(vh->vh_iot, vh->vh_ioh_vga, VGA_CRTC_DATA, val);
+}
+
#define vga_attr_read(vh, reg) \
_vga_attr_read(vh, offsetof(struct reg_vgaattr, reg))
#define vga_attr_write(vh, reg, val) \