summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2004-06-23 19:50:13 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-06-23 19:50:13 -0700
commitfe3a3a65fe579af9f94bcd2f9bd5416177293ce0 (patch)
tree06a8971fb26ddaabcf073fc9acfcd84ddbda73fc /include
parent91bc6523e3878fadc6825d7a6d68e33018a924aa (diff)
[PATCH] ppc64: clean up prom.c and related files
Somebody back in the mists of time decided that call_prom and rtas_call should return longs even though both of those bits of firmware run in 32-bit mode and produce a 32-bit result. To make life more interesting, the 32-bit result gets zero-extended to 64 bits, which makes checking for a -1 return value more complicated than it should be. This patch changes call_prom and rtas_call to return an int, and makes the corresponding changes to use ints for the variables used to hold those return values. While I was doing this I finally got annoyed enough with the strings of prom_print() and prom_print_hex() calls that we do to write a simple prom_printf. I deliberately didn't use snprintf because the execution environment is weird at this point - we aren't running at the address we are linked at just yet - and I didn't want to inflict that on any code outside this file. I also did a prom_debug() macro, which eliminated a few ifdefs. There are also a bunch of other minor cleanups. This patch makes very few algorithmic changes but does get rid of a lot of casts. :) I have been running with this patch for a couple of weeks, and Anton has tested it too. Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r--include/asm-ppc64/prom.h2
-rw-r--r--include/asm-ppc64/rtas.h4
2 files changed, 3 insertions, 3 deletions
diff --git a/include/asm-ppc64/prom.h b/include/asm-ppc64/prom.h
index c39e115975c0..fdc158a0c658 100644
--- a/include/asm-ppc64/prom.h
+++ b/include/asm-ppc64/prom.h
@@ -25,7 +25,7 @@
#define LONG_MSW(X) (((unsigned long)X) >> 32)
typedef u32 phandle;
-typedef void *ihandle;
+typedef u32 ihandle;
typedef u32 phandle32;
typedef u32 ihandle32;
diff --git a/include/asm-ppc64/rtas.h b/include/asm-ppc64/rtas.h
index e51ebb166d12..4ce9bddc62a2 100644
--- a/include/asm-ppc64/rtas.h
+++ b/include/asm-ppc64/rtas.h
@@ -37,7 +37,7 @@
* Where n_in is the number of input parameters and
* n_out is the number of output parameters
*
- * If the "string" is invalid on this system, RTAS_UNKOWN_SERVICE
+ * If the "string" is invalid on this system, RTAS_UNKNOWN_SERVICE
* will be returned as a token. rtas_call() does look for this
* token and error out gracefully so rtas_call(rtas_token("str"), ...)
* may be safely used for one-shot calls to RTAS.
@@ -168,7 +168,7 @@ extern struct rtas_t rtas;
extern void enter_rtas(unsigned long);
extern int rtas_token(const char *service);
-extern long rtas_call(int token, int, int, unsigned long *, ...);
+extern int rtas_call(int token, int, int, int *, ...);
extern void call_rtas_display_status(char);
extern void rtas_restart(char *cmd);
extern void rtas_power_off(void);