aboutsummaryrefslogtreecommitdiff
path: root/clients
diff options
context:
space:
mode:
authorThomas Huth <thuth@linux.vnet.ibm.com>2011-08-04 10:08:57 +0200
committerThomas Huth <thuth@linux.vnet.ibm.com>2011-10-12 12:50:05 +0200
commit7262e19eca37218e805de125cc36cb08607fc6d7 (patch)
tree92f3991abe081504156364bc37b3b4c291b100f1 /clients
parent4e4101fed2b519f8938c89f219050eca3132ebe9 (diff)
downloadSLOF-7262e19eca37218e805de125cc36cb08607fc6d7.zip
SLOF-7262e19eca37218e805de125cc36cb08607fc6d7.tar.gz
SLOF-7262e19eca37218e805de125cc36cb08607fc6d7.tar.bz2
Fixed a crash with early debug printf statements
printf does not work during rtas_init of snk yet, so the code has to use the snk_kernel_interface instead. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Diffstat (limited to 'clients')
-rw-r--r--clients/net-snk/oflib/rtas.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/clients/net-snk/oflib/rtas.c b/clients/net-snk/oflib/rtas.c
index 63d6e2f..5d0560a 100644
--- a/clients/net-snk/oflib/rtas.c
+++ b/clients/net-snk/oflib/rtas.c
@@ -15,8 +15,11 @@
#include <rtas.h>
#include <of.h>
#include <types.h>
+#include <netdriver_int.h>
#include "kernel.h"
+extern snk_kernel_t snk_kernel_interface;
+
typedef int rtas_arg_t;
typedef struct {
@@ -97,9 +100,10 @@ instantiate_rtas(void)
{
long long *rtas_mem_space;
ihandle_t ihandle;
+
_rtas.dev = of_finddevice("/rtas");
if ((long) _rtas.dev < 0) {
- printf("Could not open /rtas\n");
+ snk_kernel_interface.print("\nCould not open /rtas\n");
return -1;
}
@@ -107,7 +111,7 @@ instantiate_rtas(void)
sizeof(_rtas.rtas_size));
if (_rtas.rtas_size <= 0) {
- printf("Size of rtas (%x) too small to make sense\n",
+ snk_kernel_interface.print("\nSize of rtas (%x) too small to make sense\n",
_rtas.rtas_size);
return -1;
}
@@ -115,14 +119,14 @@ instantiate_rtas(void)
rtas_mem_space = (long long *) malloc_aligned(_rtas.rtas_size, 0x100);
if (!rtas_mem_space) {
- printf("Failed to allocated memory for RTAS\n");
+ snk_kernel_interface.print("\nFailed to allocated memory for RTAS\n");
return -1;
}
ihandle = of_open("/rtas");
if ((long) ihandle < 0) {
- printf("Could not open /rtas\n");
+ snk_kernel_interface.print("Could not open /rtas\n");
return -1;
}
@@ -132,11 +136,11 @@ instantiate_rtas(void)
> 0) {
_rtas.rtas_start = rtas_mem_space;
} else {
- printf("instantiate-rtas failed\n");
+ snk_kernel_interface.print("instantiate-rtas failed\n");
return -1;
}
#if 0
- printf("\ninstantiate-rtas at %x size %x entry %x\n",
+ snk_kernel_interface.print("\ninstantiate-rtas at %x size %x entry %x\n",
_rtas.rtas_start, _rtas.rtas_size, _rtas.rtas_entry);
#endif
return 0;