Implement Client Interface method "test-method" defined in

"PowerPC Microprocessor CHRP binding", Chapter 10.5.2.

Signed-off-by: Laurent Vivier <Laurent@vivier.eu>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@609 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
Laurent Vivier
2009-11-12 01:11:04 +00:00
parent 17c415b87f
commit 515a3c6eb3
2 changed files with 18 additions and 1 deletions

View File

@@ -303,6 +303,18 @@ external
outer-interpreter
;
[IFDEF] CONFIG_PPC
\ PowerPC Microprocessor CHRP binding
\ 10.5.2. Client Interface
( phandle cstring-method -- missing )
: test-method
dup cstrlen rot
find-method 0= if -1 else drop 0 then
;
[THEN]
finish-device
device-end

View File

@@ -19,7 +19,7 @@
#include "openbios/of.h"
/* Uncomment to enable debug printout of client interface calls */
//#define DEBUG_CIF
#define DEBUG_CIF
//#define DUMP_IO
/* OF client interface. r3 points to the argument array. On return,
@@ -143,6 +143,9 @@ static void dump_service(prom_args_t *pb)
printk("enter()\n");
} else if (strcmp(pb->service, "exit") == 0) {
printk("exit()\n");
} else if (strcmp(pb->service, "test-method") == 0) {
printk("test-method(0x%08lx, \"%s\") = ",
pb->args[0], (char*)pb->args[1]);
} else {
printk("of_client_interface: %s ", pb->service );
for( i = 0; i < pb->nargs; i++ )
@@ -212,6 +215,8 @@ static void dump_return(prom_args_t *pb)
/* do nothing */
} else if (strcmp(pb->service, "exit") == 0) {
/* do nothing */
} else if (strcmp(pb->service, "test-method") == 0) {
printk("0x%08lx\n", pb->args[pb->nargs]);
} else {
printk("of_client_interface return:");
for (i = 0; i < pb->nret; i++) {