Annotation of Gnu-Mach/chips/screen_switch.c, revision 1.1

1.1     ! root        1: /* 
        !             2:  * Mach Operating System
        !             3:  * Copyright (c) 1991,1990,1989 Carnegie Mellon University
        !             4:  * All Rights Reserved.
        !             5:  * 
        !             6:  * Permission to use, copy, modify and distribute this software and its
        !             7:  * documentation is hereby granted, provided that both the copyright
        !             8:  * notice and this permission notice appear in all copies of the
        !             9:  * software, derivative works or modified versions, and any portions
        !            10:  * thereof, and that both notices appear in supporting documentation.
        !            11:  * 
        !            12:  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
        !            13:  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
        !            14:  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
        !            15:  * 
        !            16:  * Carnegie Mellon requests users of this software to return to
        !            17:  * 
        !            18:  *  Software Distribution Coordinator  or  [email protected]
        !            19:  *  School of Computer Science
        !            20:  *  Carnegie Mellon University
        !            21:  *  Pittsburgh PA 15213-3890
        !            22:  * 
        !            23:  * any improvements or extensions that they make and grant Carnegie Mellon
        !            24:  * the rights to redistribute these changes.
        !            25:  */
        !            26: /*
        !            27:  *     File: screen_switch.c
        !            28:  *     Author: Alessandro Forin, Carnegie Mellon University
        !            29:  *     Date:   9/90
        !            30:  *
        !            31:  *     Autoconfiguration code for the Generic Screen Driver.
        !            32:  */
        !            33: 
        !            34: #include <platforms.h>
        !            35: 
        !            36: #if    defined(DECSTATION) || defined(FLAMINGO)
        !            37: #include <fb.h>
        !            38: #include <gx.h>
        !            39: #include <cfb.h>
        !            40: #include <mfb.h>
        !            41: #include <xcfb.h>
        !            42: #include <sfb.h>
        !            43: #endif
        !            44: 
        !            45: #ifdef VAXSTATION
        !            46: #define NGX 0
        !            47: #define NCFB 0
        !            48: #define NXCFB 0
        !            49: #endif
        !            50: 
        !            51: #include <chips/screen_switch.h>
        !            52: 
        !            53: /* When nothing needed */
        !            54: int screen_noop()
        !            55: {}
        !            56: 
        !            57: /*
        !            58:  * Vector of graphic interface drivers to probe.
        !            59:  * Zero terminate this list.
        !            60:  */
        !            61: 
        !            62: 
        !            63: #if    NGX > 0
        !            64: extern int gq_probe(), gq_cold_init();
        !            65: extern unsigned int gq_mem_need();
        !            66: 
        !            67: extern int ga_probe(), ga_cold_init();
        !            68: extern unsigned int ga_mem_need();
        !            69: #endif /* NGX > 0 */
        !            70: 
        !            71: #if    NCFB > 0
        !            72: extern int cfb_probe(), cfb_cold_init();
        !            73: extern unsigned int pm_mem_need();
        !            74: #endif /* NCFB > 0 */
        !            75: 
        !            76: #if    NMFB > 0
        !            77: extern int fb_probe(), fb_cold_init();
        !            78: extern unsigned int pm_mem_need();
        !            79: #endif /* NMFB > 0 */
        !            80: 
        !            81: #if    NXCFB > 0
        !            82: extern int xcfb_probe(), xcfb_cold_init();
        !            83: extern unsigned int pm_mem_need();
        !            84: #endif /* NXCFB > 0 */
        !            85: 
        !            86: #if    NSFB > 0
        !            87: extern int sfb_probe(), sfb_cold_init();
        !            88: extern unsigned int pm_mem_need();
        !            89: #endif /* NSFB > 0 */
        !            90: 
        !            91: #if    NFB > 0
        !            92: extern int pm_probe(), pm_cold_init();
        !            93: extern unsigned int pm_mem_need();
        !            94: #endif /* NFB > 0 */
        !            95: 
        !            96: struct screen_probe_vector screen_probe_vector[] = {
        !            97: 
        !            98: #if    NGX > 0
        !            99:        gq_probe, gq_mem_need, gq_cold_init, /* 3max 3D color option */
        !           100:        ga_probe, ga_mem_need, ga_cold_init, /* 3max 2D color option */
        !           101: #endif /* NGX > 0 */
        !           102: 
        !           103: #if    NSFB > 0
        !           104:        sfb_probe, pm_mem_need, sfb_cold_init, /* Smart frame buffer */
        !           105: #endif /* NSFB > 0 */
        !           106: 
        !           107: #if    NMFB > 0
        !           108:        fb_probe, pm_mem_need, fb_cold_init, /* 3max/3min 1D(?) mono option */
        !           109: #endif /* NMFB > 0 */
        !           110: 
        !           111: #if    NCFB > 0
        !           112:        cfb_probe, pm_mem_need, cfb_cold_init, /* 3max 1D(?) color option */
        !           113: #endif /* NCFB > 0 */
        !           114: 
        !           115: #if    NXCFB > 0
        !           116:        xcfb_probe, pm_mem_need, xcfb_cold_init,/* MAXine frame buffer */
        !           117: #endif /* NXCFB > 0 */
        !           118: 
        !           119: #if    NFB > 0
        !           120:        pm_probe, pm_mem_need, pm_cold_init, /* "pm" mono/color (pmax) */
        !           121: #endif
        !           122:        0,
        !           123: };
        !           124: 
        !           125: char   *screen_data;   /* opaque */
        !           126: 
        !           127: int screen_find()
        !           128: {
        !           129:        struct screen_probe_vector *p = screen_probe_vector;
        !           130:        for (;p->probe; p++)
        !           131:                if ((*p->probe)()) {
        !           132:                        (*p->setup)(0/*XXX*/, screen_data);
        !           133:                        return 1;
        !           134:                }
        !           135:        return 0;
        !           136: }
        !           137: 
        !           138: unsigned int
        !           139: screen_memory_alloc(avail)
        !           140:        char *avail;
        !           141: {
        !           142:        struct screen_probe_vector *p = screen_probe_vector;
        !           143:        int             size;
        !           144:        for (; p->probe; p++)
        !           145:                if ((*p->probe) ()) {
        !           146:                        screen_data = avail;
        !           147:                        size = (*p->alloc) ();
        !           148:                        bzero(screen_data, size);
        !           149:                        return size;
        !           150:                }
        !           151:        return 0;
        !           152: 
        !           153: }
        !           154: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.