2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
26 * Mach Operating System
27 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
28 * All Rights Reserved.
30 * Permission to use, copy, modify and distribute this software and its
31 * documentation is hereby granted, provided that both the copyright
32 * notice and this permission notice appear in all copies of the
33 * software, derivative works or modified versions, and any portions
34 * thereof, and that both notices appear in supporting documentation.
36 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
37 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
38 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
40 * Carnegie Mellon requests users of this software to return to
42 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
43 * School of Computer Science
44 * Carnegie Mellon University
45 * Pittsburgh PA 15213-3890
47 * any improvements or extensions that they make and grant Carnegie Mellon
48 * the rights to redistribute these changes.
53 * File: screen_switch.h
54 * Author: Alessandro Forin, Carnegie Mellon University
57 * Definitions of things that must be tailored to
58 * specific hardware boards for the Generic Screen Driver.
61 #ifndef SCREEN_SWITCH_H
62 #define SCREEN_SWITCH_H 1
64 #include <mach/boolean.h>
67 * List of probe routines, scanned at cold-boot time
68 * to see which, if any, graphic display is available.
69 * This is done before autoconf, so that printing on
70 * the console works early on. The alloc routine is
71 * called only on the first device that answers.
72 * Ditto for the setup routine, called later on.
74 struct screen_probe_vector
{
76 unsigned int (*alloc
)(void);
77 int (*setup
)(int, user_info_t
);
81 * Low-level operations on the graphic device, used
82 * by the otherwise device-independent interface code
85 /* Forward declaration of screen_softc_t */
86 typedef struct screen_softc
*screen_softc_t
;
88 struct screen_switch
{
89 int (*graphic_open
)(void); /* when X11 opens */
90 int (*graphic_close
)(screen_softc_t
); /* .. or closes */
91 int (*set_status
)(screen_softc_t
,
94 natural_t
); /* dev-specific ops */
95 int (*get_status
)(screen_softc_t
,
98 natural_t
*); /* dev-specific ops */
99 int (*char_paint
)(screen_softc_t
,
103 int (*pos_cursor
)(void*,
105 int); /* cursor positioning*/
106 int (*insert_line
)(screen_softc_t
,
107 short); /* ..and scroll down */
108 int (*remove_line
)(screen_softc_t
,
109 short); /* ..and scroll up */
110 int (*clear_bitmap
)(screen_softc_t
); /* blank screen */
111 int (*video_on
)(void*,
112 user_info_t
*); /* screen saver */
113 int (*video_off
)(void*,
115 int (*intr_enable
)(void*,
117 int (*map_page
)(screen_softc_t
,
119 int); /* user-space mapping*/
123 * Each graphic device needs page-aligned memory
124 * to be mapped in user space later (for events
125 * and such). Size and content of this memory
126 * is unfortunately device-dependent, even if
127 * it did not need to (puns).
129 extern char *screen_data
;
131 extern struct screen_probe_vector screen_probe_vector
[];
133 extern int screen_noop(void), screen_find(void);
135 #endif /* SCREEN_SWITCH_H */