1 /* $NetBSD: zxvar.h,v 1.2 2008/04/28 20:23:57 martin Exp $ */ 2 3 /* 4 * Copyright (c) 2002 The NetBSD Foundation, Inc. 5 * All rights reserved. 6 * 7 * This code is derived from software contributed to The NetBSD Foundation 8 * by Andrew Doran. 9 * 10 * Redistribution and use in source and binary forms, with or without 11 * modification, are permitted provided that the following conditions 12 * are met: 13 * 1. Redistributions of source code must retain the above copyright 14 * notice, this list of conditions and the following disclaimer. 15 * 2. Redistributions in binary form must reproduce the above copyright 16 * notice, this list of conditions and the following disclaimer in the 17 * documentation and/or other materials provided with the distribution. 18 * 19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 * POSSIBILITY OF SUCH DAMAGE. 30 */ 31 32 /* 33 * Copyright (C) 1999, 2000 Jakub Jelinek (jakub@redhat.com) 34 * 35 * Permission is hereby granted, free of charge, to any person obtaining a copy 36 * of this software and associated documentation files (the "Software"), to deal 37 * in the Software without restriction, including without limitation the rights 38 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 39 * copies of the Software, and to permit persons to whom the Software is 40 * furnished to do so, subject to the following conditions: 41 * 42 * The above copyright notice and this permission notice shall be included in 43 * all copies or substantial portions of the Software. 44 * 45 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 46 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 47 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 48 * JAKUB JELINEK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 49 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 50 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 51 * 52 */ 53 54 #ifndef _DEV_SBUS_ZXVAR_H_ 55 #define _DEV_SBUS_ZXVAR_H_ 56 57 /* 58 * Sun (and Linux) compatible offsets for mmap(). 59 */ 60 #define ZX_FB0_VOFF 0x00000000 61 #define ZX_LC0_VOFF 0x00800000 62 #define ZX_LD0_VOFF 0x00801000 63 #define ZX_LX0_CURSOR_VOFF 0x00802000 64 #define ZX_FB1_VOFF 0x00803000 65 #define ZX_LC1_VOFF 0x01003000 66 #define ZX_LD1_VOFF 0x01004000 67 #define ZX_LX0_VERT_VOFF 0x01005000 68 #define ZX_LX_KRN_VOFF 0x01006000 69 #define ZX_LC0_KRN_VOFF 0x01007000 70 #define ZX_LC1_KRN_VOFF 0x01008000 71 #define ZX_LD_GBL_VOFF 0x01009000 72 73 #define ZX_WID_SHARED_8 0 74 #define ZX_WID_SHARED_24 1 75 #define ZX_WID_DBL_8 2 76 #define ZX_WID_DBL_24 3 77 78 /* 79 * Per-instance data. 80 */ 81 struct zx_softc { 82 struct device sc_dv; 83 struct sbusdev sc_sd; 84 struct fbdevice sc_fb; 85 bus_space_tag_t sc_bt; 86 87 int sc_flags; 88 int sc_fontw; 89 int sc_fonth; 90 u_int8_t *sc_cmap; 91 u_int32_t *sc_pixels; 92 bus_addr_t sc_paddr; 93 int sc_shiftx; 94 int sc_shifty; 95 96 struct fbcurpos sc_curpos; 97 struct fbcurpos sc_curhot; 98 struct fbcurpos sc_cursize; 99 u_int8_t sc_curcmap[8]; 100 u_int32_t sc_curbits[2][32]; 101 102 volatile struct zx_command *sc_zc; 103 volatile struct zx_cross *sc_zx; 104 volatile struct zx_draw *sc_zd_ss0; 105 volatile struct zx_draw_ss1 *sc_zd_ss1; 106 volatile struct zx_cursor *sc_zcu; 107 }; 108 #define ZX_BLANKED 0x01 109 #define ZX_CURSOR 0x02 110 111 #endif /* !_DEV_SBUS_ZXVAR_H_ */ 112