summaryrefslogtreecommitdiff
path: root/sys/dev/ic/stivar.h
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2005-02-27 22:10:59 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2005-02-27 22:10:59 +0000
commitfdf96c61d4c3a370ccfd6070ea95f94a74939913 (patch)
tree4dfce55b9fcc21c99e9e5c3df78a0be67cb61d60 /sys/dev/ic/stivar.h
parent4c4273242ff4be0268af0dbbc44d6920ee9b9b9b (diff)
Split sti softc in two structures, one device-related for regular device
attachment and interface, one screen-attached for the real work. The attachment code is now required to decide whether sti_end_attach() is run immediately, or as a startuphook. This allows hp300 to initialize sti early, and use it as a console; hppa is functionally unchanged, as it uses the PROM console until the root device is mounted.
Diffstat (limited to 'sys/dev/ic/stivar.h')
-rw-r--r--sys/dev/ic/stivar.h72
1 files changed, 45 insertions, 27 deletions
diff --git a/sys/dev/ic/stivar.h b/sys/dev/ic/stivar.h
index ddf9ec2223b..335aab4519e 100644
--- a/sys/dev/ic/stivar.h
+++ b/sys/dev/ic/stivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: stivar.h,v 1.16 2005/01/23 16:53:21 miod Exp $ */
+/* $OpenBSD: stivar.h,v 1.17 2005/02/27 22:10:58 miod Exp $ */
/*
* Copyright (c) 2000-2003 Michael Shalayeff
@@ -29,36 +29,30 @@
#ifndef _IC_STIVAR_H_
#define _IC_STIVAR_H_
-struct sti_softc {
- struct device sc_dev;
- void *sc_ih;
+struct sti_screen {
+ int scr_devtype;
- u_int sc_wsmode;
- u_int sc_flags;
-#define STI_TEXTMODE 0x0001
-#define STI_CLEARSCR 0x0002
-#define STI_CONSOLE 0x0004
- int sc_devtype;
- int sc_nscreens;
- int sc_bpp;
-
- bus_space_tag_t iot, memt;
+ bus_space_tag_t iot, memt;
bus_space_handle_t romh;
- bus_addr_t base, fbaddr;
- bus_size_t fblen;
+ bus_addr_t base, fbaddr;
+ bus_size_t fblen;
+
+ int scr_bpp;
- struct sti_dd sc_dd; /* in word format */
- struct sti_font sc_curfont;
- struct sti_cfg sc_cfg;
- struct sti_ecfg sc_ecfg;
+ struct sti_dd scr_dd; /* in word format */
+ struct sti_font scr_curfont;
+ struct sti_cfg scr_cfg;
+ struct sti_ecfg scr_ecfg;
- void *sc_romfont; /* ROM font copy, either in memory... */
- u_int sc_fontmaxcol; /* ...or in off-screen frame buffer */
- u_int sc_fontbase;
+ void *scr_romfont; /* ROM font copy, either in memory... */
+ u_int scr_fontmaxcol; /* ...or in off-screen frame buffer */
+ u_int scr_fontbase;
- u_int8_t sc_rcmap[STI_NCMAP], sc_gcmap[STI_NCMAP], sc_bcmap[STI_NCMAP];
- vaddr_t sc_code;
+ u_int8_t scr_rcmap[STI_NCMAP],
+ scr_gcmap[STI_NCMAP],
+ scr_bcmap[STI_NCMAP];
+ vaddr_t scr_code;
sti_init_t init;
sti_mgmt_t mgmt;
sti_unpmv_t unpmv;
@@ -72,9 +66,33 @@ struct sti_softc {
sti_utiming_t utiming;
sti_pmgr_t pmgr;
sti_util_t util;
+
+ u_int16_t fbheight, fbwidth, oheight, owidth;
+ u_int8_t name[STI_DEVNAME_LEN];
+};
+
+struct sti_softc {
+ struct device sc_dev;
+ void *sc_ih;
+
+ u_int sc_flags;
+#define STI_TEXTMODE 0x0001
+#define STI_CLEARSCR 0x0002
+#define STI_CONSOLE 0x0004
+#define STI_ATTACHED 0x0008
+ int sc_nscreens;
+
+ bus_space_tag_t iot, memt;
+ bus_space_handle_t romh;
+ bus_addr_t base;
+
+ struct sti_screen *sc_scr;
+ u_int sc_wsmode;
};
-void sti_attach_common(struct sti_softc *sc, u_int codebase);
-int sti_intr(void *v);
+void sti_attach_common(struct sti_softc *sc, u_int codebase);
+int sti_cnattach(struct sti_screen *, bus_space_tag_t, bus_addr_t, u_int);
+void sti_describe(struct sti_softc *);
+void sti_end_attach(void *);
#endif /* _IC_STIVAR_H_ */