Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/ic Add functions needed for access to CRTC registers.
details: https://anonhg.NetBSD.org/src/rev/00af1bab41c9
branches: trunk
changeset: 519880:00af1bab41c9
user: junyoung <junyoung%NetBSD.org@localhost>
date: Sat Dec 29 17:40:35 2001 +0000
description:
Add functions needed for access to CRTC registers.
diffstat:
sys/dev/ic/vgavar.h | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
diffs (39 lines):
diff -r 0eed24c6c303 -r 00af1bab41c9 sys/dev/ic/vgavar.h
--- a/sys/dev/ic/vgavar.h Sat Dec 29 17:06:50 2001 +0000
+++ b/sys/dev/ic/vgavar.h Sat Dec 29 17:40:35 2001 +0000
@@ -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 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 @@
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) \
Home |
Main Index |
Thread Index |
Old Index