Changeset 04803bf in mainline for uspace/srv/hid/fb/main.c


Ignore:
Timestamp:
2011-03-21T22:00:17Z (15 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
143932e3
Parents:
b50b5af2 (diff), 7308e84 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes (needs fixes).

File:
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/fb/main.c

    rb50b5af2 r04803bf  
    2727 */
    2828
    29 #include <ipc/ipc.h>
    3029#include <ipc/services.h>
     30#include <ipc/ns.h>
    3131#include <sysinfo.h>
    3232#include <async.h>
     
    4141#include "ski.h"
    4242#include "sgcn.h"
     43#include "niagara.h"
    4344#include "main.h"
    4445
     
    5051       
    5152        dest = as_get_mappable_page(IPC_GET_ARG2(*call));
    52         if (ipc_answer_1(callid, EOK, (sysarg_t) dest) == 0) {
     53        if (async_answer_1(callid, EOK, (sysarg_t) dest) == 0) {
    5354                if (*area)
    5455                        as_area_destroy(*area);
     
    5960int main(int argc, char *argv[])
    6061{
    61         printf(NAME ": HelenOS Framebuffer service\n");
     62        printf("%s: HelenOS Framebuffer service\n", NAME);
    6263       
    63         ipcarg_t phonead;
    6464        bool initialized = false;
     65        sysarg_t fb_present;
     66        sysarg_t fb_kind;
     67       
     68        if (sysinfo_get_value("fb", &fb_present) != EOK)
     69                fb_present = false;
     70       
     71        if (sysinfo_get_value("fb.kind", &fb_kind) != EOK) {
     72                printf("%s: Unable to detect framebuffer configuration\n", NAME);
     73                return -1;
     74        }
    6575       
    6676#ifdef FB_ENABLED
    67         if (sysinfo_value("fb.kind") == 1) {
     77        if ((!initialized) && (fb_kind == 1)) {
    6878                if (fb_init() == 0)
    6979                        initialized = true;
     
    7181#endif
    7282#ifdef EGA_ENABLED
    73         if ((!initialized) && (sysinfo_value("fb.kind") == 2)) {
     83        if ((!initialized) && (fb_kind == 2)) {
    7484                if (ega_init() == 0)
    7585                        initialized = true;
     
    7787#endif
    7888#ifdef MSIM_ENABLED
    79         if ((!initialized) && (sysinfo_value("fb.kind") == 3)) {
     89        if ((!initialized) && (fb_kind == 3)) {
    8090                if (msim_init() == 0)
    8191                        initialized = true;
     
    8393#endif
    8494#ifdef SGCN_ENABLED
    85         if ((!initialized) && (sysinfo_value("fb.kind") == 4)) {
     95        if ((!initialized) && (fb_kind == 4)) {
    8696                if (sgcn_init() == 0)
    8797                        initialized = true;
    8898        }
    8999#endif
     100#ifdef NIAGARA_ENABLED
     101        if ((!initialized) && (fb_kind == 5)) {
     102                if (niagara_init() == 0)
     103                        initialized = true;
     104        }
     105#endif
    90106#ifdef SKI_ENABLED
    91         if ((!initialized) && (sysinfo_value("fb") != true)) {
     107        if ((!initialized) && (fb_kind == 6)) {
    92108                if (ski_init() == 0)
    93109                        initialized = true;
     
    98114                return -1;
    99115       
    100         if (ipc_connect_to_me(PHONE_NS, SERVICE_VIDEO, 0, 0, &phonead) != 0)
     116        if (service_register(SERVICE_VIDEO) != EOK)
    101117                return -1;
    102118       
    103         printf(NAME ": Accepting connections\n");
     119        printf("%s: Accepting connections\n", NAME);
    104120        async_manager();
    105121       
Note: See TracChangeset for help on using the changeset viewer.