source: mainline/uspace/srv/hid/fb/main.c@ 8ff0bd2

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 8ff0bd2 was 336d2f52, checked in by Jakub Jermar <jakub@…>, 14 years ago

Remove support for Sun hardware for which we have no test plan.

This includes the removal of the following functionality only available
via the Simics simulator, for which we have been unable to secure a
license:

  • FHC bus and interrupt controller
  • Zilog 8530 serial controller attached to Sun keyboard
  • Serengeti and SGCN support
  • Property mode set to 100644
File size: 3.1 KB
Line 
1/*
2 * Copyright (c) 2006 Ondrej Palkovsky
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * - Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * - Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * - The name of the author may not be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#include <ipc/services.h>
30#include <ns.h>
31#include <sysinfo.h>
32#include <async.h>
33#include <as.h>
34#include <align.h>
35#include <errno.h>
36#include <stdio.h>
37
38#include "fb.h"
39#include "ega.h"
40#include "msim.h"
41#include "ski.h"
42#include "niagara.h"
43#include "main.h"
44
45#define NAME "fb"
46
47void receive_comm_area(ipc_callid_t callid, ipc_call_t *call, void **area)
48{
49 void *dest;
50
51 dest = as_get_mappable_page(IPC_GET_ARG2(*call));
52 if (async_answer_1(callid, EOK, (sysarg_t) dest) == 0) {
53 if (*area)
54 as_area_destroy(*area);
55 *area = dest;
56 }
57}
58
59int main(int argc, char *argv[])
60{
61 printf("%s: HelenOS Framebuffer service\n", NAME);
62
63 bool initialized = false;
64 sysarg_t fb_present;
65 sysarg_t fb_kind;
66
67 if (sysinfo_get_value("fb", &fb_present) != EOK)
68 fb_present = false;
69
70 if (sysinfo_get_value("fb.kind", &fb_kind) != EOK) {
71 printf("%s: Unable to detect framebuffer configuration\n", NAME);
72 return -1;
73 }
74
75#ifdef FB_ENABLED
76 if ((!initialized) && (fb_kind == 1)) {
77 if (fb_init() == 0)
78 initialized = true;
79 }
80#endif
81#ifdef EGA_ENABLED
82 if ((!initialized) && (fb_kind == 2)) {
83 if (ega_init() == 0)
84 initialized = true;
85 }
86#endif
87#ifdef MSIM_ENABLED
88 if ((!initialized) && (fb_kind == 3)) {
89 if (msim_init() == 0)
90 initialized = true;
91 }
92#endif
93#ifdef NIAGARA_ENABLED
94 if ((!initialized) && (fb_kind == 5)) {
95 if (niagara_init() == 0)
96 initialized = true;
97 }
98#endif
99#ifdef SKI_ENABLED
100 if ((!initialized) && (fb_kind == 6)) {
101 if (ski_init() == 0)
102 initialized = true;
103 }
104#endif
105
106 if (!initialized)
107 return -1;
108
109 if (service_register(SERVICE_VIDEO) != EOK)
110 return -1;
111
112 printf("%s: Accepting connections\n", NAME);
113 async_manager();
114
115 /* Never reached */
116 return 0;
117}
Note: See TracBrowser for help on using the repository browser.