Subversion Repositories HelenOS-historic

Rev

Rev 421 | Rev 426 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 421 Rev 424
Line 47... Line 47...
47
        ofw_stdout = 0;
47
        ofw_stdout = 0;
48
}
48
}
49
 
49
 
50
void ofw_done(void)
50
void ofw_done(void)
51
{
51
{
52
    ofw_call("exit", 0, 0);
52
    (void) ofw_call("exit", 0, 0);
53
    cpu_halt();
53
    cpu_halt();
54
}
54
}
55
 
55
 
56
__address ofw_call(const char *service, const int nargs, const int nret, ...)
56
__native ofw_call(const char *service, const int nargs, const int nret, ...)
57
{
57
{
58
    va_list list;
58
    va_list list;
59
    ofw_args_t args;
59
    ofw_args_t args;
60
    int i;
60
    int i;
61
   
61
   
Line 79... Line 79...
79
void ofw_putchar(const char ch)
79
void ofw_putchar(const char ch)
80
{
80
{
81
    if (ofw_stdout == 0)
81
    if (ofw_stdout == 0)
82
        return;
82
        return;
83
   
83
   
84
    ofw_call("write", 3, 1, ofw_stdout, &ch, 1);
84
    (void) ofw_call("write", 3, 1, ofw_stdout, &ch, 1);
85
}
85
}
86
 
86
 
87
phandle ofw_find_device(const char *name)
87
phandle ofw_find_device(const char *name)
88
{
88
{
89
    return ofw_call("finddevice", 1, 1, name);
89
    return (phandle) ofw_call("finddevice", 1, 1, name);
90
}
90
}
91
 
91
 
92
int ofw_get_property(const phandle device, const char *name, void *buf, const int buflen)
92
int ofw_get_property(const phandle device, const char *name, void *buf, const int buflen)
93
{
93
{
94
    return ofw_call("getprop", 4, 1, device, name, buf, buflen);
94
    return (int) ofw_call("getprop", 4, 1, device, name, buf, buflen);
95
}
95
}
96
 
96
 
97
void *ofw_claim(const void *addr, const int size, const int align)
97
void *ofw_claim(const void *addr, const int size, const int align)
98
{
98
{
99
    return (void *) ofw_call("claim", 3, 1, addr, size, align);
99
    return (void *) ofw_call("claim", 3, 1, addr, size, align);