[FREELDR/AMD64]
[reactos.git] / reactos / boot / freeldr / freeldr / arch / powerpc / ofw_method.c
1 #include <freeldr.h>
2 #include "of.h"
3
4 typedef struct _ofw_method_call {
5 const char *call_method;
6 int nargs;
7 int nrets;
8 const char *method_name;
9 int handle;
10 int args_rets[8];
11 } ofw_method_call;
12
13 extern int (*ofw_call_addr)(void *argstruct);
14
15 int ofw_callmethod_ret(const char *method, int handle, int nargs, int *args, int ret)
16 {
17 ofw_method_call callframe = { 0 };
18 callframe.call_method = "call-method";
19 callframe.nargs = nargs + 2;
20 callframe.nrets = ret+1;
21 callframe.method_name = method;
22 callframe.handle = handle;
23 memcpy(callframe.args_rets, args, sizeof(int)*nargs);
24 ofw_call_addr(&callframe);
25 return callframe.args_rets[nargs+ret];
26 }