Subversion Repositories HelenOS

Rev

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

Rev 953 Rev 956
Line 76... Line 76...
76
    for (i = 0; i < nret; i++)
76
    for (i = 0; i < nret; i++)
77
        args.args[i + nargs] = 0;
77
        args.args[i + nargs] = 0;
78
   
78
   
79
    ofw(&args);
79
    ofw(&args);
80
   
80
   
81
    if (nret > 0)
-
 
82
        return args.args[nargs + nret - 1];
81
    return args.args[nargs];
83
    else
-
 
84
        return 0;
-
 
85
}
82
}
86
 
83
 
87
 
84
 
88
ihandle ofw_open(const char *name)
85
ihandle ofw_open(const char *name)
89
{
86
{
Line 110... Line 107...
110
{
107
{
111
    return ofw_call("getprop", 4, 1, device, name, buf, buflen);
108
    return ofw_call("getprop", 4, 1, device, name, buf, buflen);
112
}
109
}
113
 
110
 
114
 
111
 
115
void *ofw_claim(const void *addr, const int size, const int align)
112
void *ofw_translate(const void *virt)
116
{
113
{
117
    return (void *) ofw_call("claim", 3, 1, addr, size, align);
114
    return (void *) ofw_call("call-method", 7, 1, "translate", ofw_mmu, virt, 0, 0, 0, 0);
118
}
115
}
119
 
116
 
120
 
117
 
121
void *ofw_translate(const void *virt)
118
int ofw_map(const void *phys, const void *virt, const int size, const int mode)
122
{
119
{
123
    return (void *) ofw_call_method(ofw_mmu, "translate", 1, 5, virt);
120
    return ofw_call("call-method", 6, 1, "map", ofw_mmu, mode, size, virt, phys);
124
}
121
}