summaryrefslogtreecommitdiffstats
path: root/src/usr/example/example.C
blob: 287721e5a7e38f6a87352cdeda26c464ab64f5b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include <kernel/console.H>
#include <sys/sync.h>
#include <sys/vfs.h>
#include <sys/task.h>
#include <trace/interface.H>
#include <example/example.H>
#include <example/examplerc.H>
#include <errl/errlentry.H>

#if 0
//static mutex_t value = MUTEX_INITIALIZER;
trace_desc_t *g_trac_test = NULL;
TRAC_INIT(&g_trac_test, "EXAMPLE", 4096);
#endif

extern "C"
void _start(void *ptr)
{
    /**
     * @todo    fix printk to accept (NULL)
     */
    printk( "Executing Example module, arg=%s\n", ( (ptr==NULL) ? "(NULL)" : (char*)ptr ) );

    task_end();
}

uint64_t example1_function()
{
    uint64_t    l_rc = 0;

    //TRACFCOMP(g_trac_test, "Someone Called example1_function!");

    return l_rc;
}

// This example shows how to create an error log with passed-in
// defined parameters
void example2_create_errorlog_function()
{
    /*@
     * @errortype
     * @moduleid     MY_MODULE_ID_1
     * @reasoncode   MY_REASON_CODE_1
     * @userdata1    Meaning of userdata1 value
     * @userdata2    Meaning of userdata2 value
     * @devdesc      Example of creating an error log
     */
    errlHndl_t l_err = new ERRORLOG::ErrlEntry(
                        ERRORLOG::ERRL_SEV_INFORMATIONAL,
                        MY_MODULE_ID_1,
                        MY_REASON_CODE_1,
                        0x8000000000000001,
                        0x9000000000000003);
    delete l_err;
    l_err = NULL;
    return;
}
OpenPOWER on IntegriCloud