Subversion Repositories HelenOS

Rev

Rev 3689 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3689 Rev 3869
Line 58... Line 58...
58
        : "%r3","%r9"
58
        : "%r3","%r9"
59
    );
59
    );
60
*/
60
*/
61
}
61
}
62
 
62
 
63
typedef void (*fptr_t)(void);
63
typedef int (*fptr_t)(void);
64
 
64
 
65
int main(int argc, char *argv[])
65
int main(int argc, char *argv[])
66
{
66
{
67
    void *a;
67
    void *a;
68
    void *s;
68
    void *s;
69
    fptr_t fun;
69
    fptr_t fun;
-
 
70
    int i;
70
 
71
 
71
    char *lib_name;
72
    char *lib_name;
72
    char *sym_name;
73
    char *sym_name;
73
 
74
 
74
//  kputint(-1);
75
//  kputint(-1);
Line 85... Line 86...
85
        printf("failed to dlopen() library '%s'\n", lib_name);
86
        printf("failed to dlopen() library '%s'\n", lib_name);
86
    }
87
    }
87
 
88
 
88
    printf("Run dynamically-resolved function '%s'...\n", sym_name);
89
    printf("Run dynamically-resolved function '%s'...\n", sym_name);
89
    fun = (fptr_t) s;
90
    fun = (fptr_t) s;
90
    (*fun)();
91
    i = (*fun)();
91
    printf("OK\n");
92
    printf("Done. (returned 0x%x)\n", i);
92
   
93
   
93
    return 0;
94
    return 0;
94
}
95
}
95
 
96
 
96
/** @}
97
/** @}