From b093ef0584646da1a5f4beef79caa3f54a6e5efb Mon Sep 17 00:00:00 2001 From: Art Yerkes Date: Sun, 6 Jan 2008 15:03:31 +0000 Subject: [PATCH] Straggler. svn path=/trunk/; revision=31626 --- .../freeldr/freeldr/arch/powerpc/ofw_method.c | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 reactos/boot/freeldr/freeldr/arch/powerpc/ofw_method.c diff --git a/reactos/boot/freeldr/freeldr/arch/powerpc/ofw_method.c b/reactos/boot/freeldr/freeldr/arch/powerpc/ofw_method.c new file mode 100644 index 00000000000..0a160b54840 --- /dev/null +++ b/reactos/boot/freeldr/freeldr/arch/powerpc/ofw_method.c @@ -0,0 +1,26 @@ +#include +#include "of.h" + +typedef struct _ofw_method_call { + const char *call_method; + int nargs; + int nrets; + const char *method_name; + int handle; + int args_rets[8]; +} ofw_method_call; + +extern int (*ofw_call_addr)(void *argstruct); + +int ofw_callmethod_ret(const char *method, int handle, int nargs, int *args, int ret) +{ + ofw_method_call callframe = { 0 }; + callframe.call_method = "call-method"; + callframe.nargs = nargs + 2; + callframe.nrets = ret+1; + callframe.method_name = method; + callframe.handle = handle; + memcpy(callframe.args_rets, args, sizeof(int)*nargs); + ofw_call_addr(&callframe); + return callframe.args_rets[nargs+ret]; +}