Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 423 → Rev 424

//SPARTAN/trunk/genarch/include/firmware/ofw/ofw.h
33,9 → 33,9
 
#define MAX_OFW_ARGS 10
 
typedef __u32 ofw_arg_t;
typedef __u32 ihandle;
typedef __u32 phandle;
typedef __native ofw_arg_t;
typedef int ihandle;
typedef int phandle;
 
/** OpenFirmware command structure
*
42,8 → 42,8
*/
typedef struct {
const char *service; /**< Command name */
__u32 nargs; /**< Number of in arguments */
__u32 nret; /**< Number of out arguments */
__native nargs; /**< Number of in arguments */
__native nret; /**< Number of out arguments */
ofw_arg_t args[MAX_OFW_ARGS]; /**< List of arguments */
} ofw_args_t;
 
53,7 → 53,7
 
extern void ofw_init(void);
extern void ofw_done(void);
extern __address ofw_call(const char *service, const int nargs, const int nret, ...);
extern __native ofw_call(const char *service, const int nargs, const int nret, ...);
extern void ofw_putchar(const char ch);
extern phandle ofw_find_device(const char *name);
extern int ofw_get_property(const phandle device, const char *name, void *buf, const int buflen);
//SPARTAN/trunk/genarch/src/firmware/ofw/ofw.c
49,11 → 49,11
 
void ofw_done(void)
{
ofw_call("exit", 0, 0);
(void) ofw_call("exit", 0, 0);
cpu_halt();
}
 
__address ofw_call(const char *service, const int nargs, const int nret, ...)
__native ofw_call(const char *service, const int nargs, const int nret, ...)
{
va_list list;
ofw_args_t args;
81,17 → 81,17
if (ofw_stdout == 0)
return;
ofw_call("write", 3, 1, ofw_stdout, &ch, 1);
(void) ofw_call("write", 3, 1, ofw_stdout, &ch, 1);
}
 
phandle ofw_find_device(const char *name)
{
return ofw_call("finddevice", 1, 1, name);
return (phandle) ofw_call("finddevice", 1, 1, name);
}
 
int ofw_get_property(const phandle device, const char *name, void *buf, const int buflen)
{
return ofw_call("getprop", 4, 1, device, name, buf, buflen);
return (int) ofw_call("getprop", 4, 1, device, name, buf, buflen);
}
 
void *ofw_claim(const void *addr, const int size, const int align)