~pmdj/ubuntu/trusty/qemu/2.9+applesmc+fadtv3

« back to all changes in this revision

Viewing changes to roms/SLOF/clients/net-snk/app/main.c

  • Committer: Phil Dennis-Jordan
  • Date: 2017-07-21 08:03:43 UTC
  • mfrom: (1.1.1)
  • Revision ID: phil@philjordan.eu-20170721080343-2yr2vdj7713czahv
New upstream release 2.9.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/******************************************************************************
 
2
 * Copyright (c) 2004, 2011 IBM Corporation
 
3
 * All rights reserved.
 
4
 * This program and the accompanying materials
 
5
 * are made available under the terms of the BSD License
 
6
 * which accompanies this distribution, and is available at
 
7
 * http://www.opensource.org/licenses/bsd-license.php
 
8
 *
 
9
 * Contributors:
 
10
 *     IBM Corporation - initial implementation
 
11
 *****************************************************************************/
 
12
 
 
13
#include <string.h>
 
14
#include <stdio.h>
 
15
#include <of.h>
 
16
#include <libbootmsg.h>
 
17
 
 
18
#ifdef SNK_BIOSEMU_APPS
 
19
#include "biosemu/biosemu.h"
 
20
#include "biosemu/vbe.h"
 
21
#endif
 
22
 
 
23
extern void _callback_entry(void);
 
24
int callback(int argc, char *argv[]);
 
25
 
 
26
 
 
27
int
 
28
main(int argc, char *argv[])
 
29
{
 
30
        int i;
 
31
        of_set_callback((void *) &_callback_entry);
 
32
 
 
33
#ifdef SNK_BIOSEMU_APPS
 
34
        // BIOS Emulator applications
 
35
        if (strcmp(argv[0], "biosemu") == 0)
 
36
                return biosemu(argc, argv);
 
37
        if (strcmp(argv[0], "get_vbe_info") == 0)
 
38
                return vbe_get_info(argc, argv);
 
39
#endif
 
40
 
 
41
        printf("Unknown client application called\n");
 
42
        for (i = 0; i < argc; i++)
 
43
                printf("argv[%d] %s\n", i, argv[i]);
 
44
 
 
45
        return -1;
 
46
}
 
47
 
 
48
int
 
49
callback(int argc, char *argv[])
 
50
{
 
51
        int i;
 
52
 
 
53
        printf("\n");
 
54
 
 
55
        /*
 
56
         * Register your application's callback handler here, similar to
 
57
         * the way you would register an application.
 
58
         * Please note that callback functions can be called safely only after
 
59
         * your application has called of_yield(). If you return or exit() from
 
60
         * your client application, the callback can no longer be used.
 
61
         */
 
62
#if 0
 
63
        if (strcmp(argv[0], "example") == 0)
 
64
                return example(argc, argv);
 
65
#endif
 
66
 
 
67
        printf("No such callback function\n");
 
68
        for (i = 0; i < argc; i++)
 
69
                printf("argv[%d] %s\n", i, argv[i]);
 
70
 
 
71
        return (-1);
 
72
}