- Timestamp:
- 2005-10-29T13:37:52Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2cd0485d
- Parents:
- b9b103d3
- Location:
- genarch
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
genarch/include/firmware/ofw/ofw.h
rb9b103d3 r39cb79a 34 34 #define MAX_OFW_ARGS 10 35 35 36 typedef __ u32ofw_arg_t;37 typedef __u32ihandle;38 typedef __u32phandle;36 typedef __native ofw_arg_t; 37 typedef int ihandle; 38 typedef int phandle; 39 39 40 40 /** OpenFirmware command structure … … 43 43 typedef struct { 44 44 const char *service; /**< Command name */ 45 __ u32 nargs;/**< Number of in arguments */46 __ u32 nret;/**< Number of out arguments */45 __native nargs; /**< Number of in arguments */ 46 __native nret; /**< Number of out arguments */ 47 47 ofw_arg_t args[MAX_OFW_ARGS]; /**< List of arguments */ 48 48 } ofw_args_t; … … 54 54 extern void ofw_init(void); 55 55 extern void ofw_done(void); 56 extern __ addressofw_call(const char *service, const int nargs, const int nret, ...);56 extern __native ofw_call(const char *service, const int nargs, const int nret, ...); 57 57 extern void ofw_putchar(const char ch); 58 58 extern phandle ofw_find_device(const char *name); -
genarch/src/firmware/ofw/ofw.c
rb9b103d3 r39cb79a 50 50 void ofw_done(void) 51 51 { 52 ofw_call("exit", 0, 0);52 (void) ofw_call("exit", 0, 0); 53 53 cpu_halt(); 54 54 } 55 55 56 __ addressofw_call(const char *service, const int nargs, const int nret, ...)56 __native ofw_call(const char *service, const int nargs, const int nret, ...) 57 57 { 58 58 va_list list; … … 82 82 return; 83 83 84 ofw_call("write", 3, 1, ofw_stdout, &ch, 1);84 (void) ofw_call("write", 3, 1, ofw_stdout, &ch, 1); 85 85 } 86 86 87 87 phandle ofw_find_device(const char *name) 88 88 { 89 return ofw_call("finddevice", 1, 1, name);89 return (phandle) ofw_call("finddevice", 1, 1, name); 90 90 } 91 91 92 92 int ofw_get_property(const phandle device, const char *name, void *buf, const int buflen) 93 93 { 94 return ofw_call("getprop", 4, 1, device, name, buf, buflen);94 return (int) ofw_call("getprop", 4, 1, device, name, buf, buflen); 95 95 } 96 96
Note:
See TracChangeset
for help on using the changeset viewer.