Changeset a8844e0 in mainline for arch/ppc64/loader/ofw.c
- Timestamp:
- 2006-04-09T16:37:14Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e3dd773
- Parents:
- 89343aac
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/ppc64/loader/ofw.c
r89343aac ra8844e0 34 34 #define BUF_SIZE 1024 35 35 36 typedef unsigned intofw_arg_t;37 typedef unsigned intihandle;38 typedef unsigned intphandle;36 typedef unsigned long ofw_arg_t; 37 typedef unsigned long ihandle; 38 typedef unsigned long phandle; 39 39 40 40 /** OpenFirmware command structure … … 43 43 typedef struct { 44 44 const char *service; /**< Command name */ 45 unsigned intnargs; /**< Number of in arguments */46 unsigned intnret; /**< Number of out arguments */45 unsigned long nargs; /**< Number of in arguments */ 46 unsigned long nret; /**< Number of out arguments */ 47 47 ofw_arg_t args[MAX_OFW_ARGS]; /**< List of arguments */ 48 48 } ofw_args_t; … … 61 61 62 62 63 static int ofw_call(const char *service, const int nargs, const intnret, ofw_arg_t *rets, ...)63 static long ofw_call(const char *service, const long nargs, const long nret, ofw_arg_t *rets, ...) 64 64 { 65 65 va_list list; 66 66 ofw_args_t args; 67 inti;67 long i; 68 68 69 69 args.service = service; … … 94 94 95 95 96 static int ofw_get_property(const phandle device, const char *name, const void *buf, const intbuflen)96 static long ofw_get_property(const phandle device, const char *name, const void *buf, const long buflen) 97 97 { 98 98 return ofw_call("getprop", 4, 1, NULL, device, name, buf, buflen); … … 100 100 101 101 102 static unsigned intofw_get_address_cells(const phandle device)103 { 104 unsigned intret;102 static unsigned long ofw_get_address_cells(const phandle device) 103 { 104 unsigned long ret; 105 105 106 106 if (ofw_get_property(device, "#address-cells", &ret, sizeof(ret)) <= 0) … … 112 112 113 113 114 static unsigned intofw_get_size_cells(const phandle device)115 { 116 unsigned intret;114 static unsigned long ofw_get_size_cells(const phandle device) 115 { 116 unsigned long ret; 117 117 118 118 if (ofw_get_property(device, "#size-cells", &ret, sizeof(ret)) <= 0) … … 164 164 165 165 166 void ofw_write(const char *str, const intlen)166 void ofw_write(const char *str, const long len) 167 167 { 168 168 if (ofw_stdout == 0) … … 185 185 186 186 187 int ofw_map(const void *phys, const void *virt, const int size, const intmode)187 long ofw_map(const void *phys, const void *virt, const long size, const long mode) 188 188 { 189 189 return ofw_call("call-method", 6, 1, NULL, "map", ofw_mmu, mode, size, virt, phys); … … 191 191 192 192 193 intofw_memmap(memmap_t *map)194 { 195 unsigned intbuf[BUF_SIZE];196 int ret = ofw_get_property(ofw_memory, "reg", buf, sizeof(unsigned int) * BUF_SIZE);193 long ofw_memmap(memmap_t *map) 194 { 195 unsigned long buf[BUF_SIZE]; 196 long ret = ofw_get_property(ofw_memory, "reg", buf, sizeof(unsigned long) * BUF_SIZE); 197 197 if (ret <= 0) 198 198 return false; 199 199 200 unsigned intac = ofw_get_address_cells(ofw_memory);201 unsigned intsc = ofw_get_size_cells(ofw_memory);202 203 intpos;200 unsigned long ac = ofw_get_address_cells(ofw_memory); 201 unsigned long sc = ofw_get_size_cells(ofw_memory); 202 203 long pos; 204 204 map->total = 0; 205 205 map->count = 0; 206 for (pos = 0; (pos < ret / sizeof(unsigned int)) && (map->count < MEMMAP_MAX_RECORDS); pos += ac + sc) {206 for (pos = 0; (pos < ret / sizeof(unsigned long)) && (map->count < MEMMAP_MAX_RECORDS); pos += ac + sc) { 207 207 void * start = (void *) buf[pos + ac - 1]; 208 unsigned intsize = buf[pos + ac + sc - 1];208 unsigned long size = buf[pos + ac + sc - 1]; 209 209 210 210 if (size > 0) { … … 218 218 219 219 220 intofw_screen(screen_t *screen)220 long ofw_screen(screen_t *screen) 221 221 { 222 222 char device_name[BUF_SIZE];
Note:
See TracChangeset
for help on using the changeset viewer.