Changeset 7dcde32 in mainline for arch/ppc32/loader/ofw.c
- Timestamp:
- 2006-03-24T18:29:04Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c6143b4
- Parents:
- f941347
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/ppc32/loader/ofw.c
rf941347 r7dcde32 32 32 33 33 #define MAX_OFW_ARGS 10 34 #define STRING_SIZE 1024 34 35 35 36 typedef unsigned int ofw_arg_t; … … 53 54 54 55 phandle ofw_chosen; 56 phandle ofw_aliases; 55 57 ihandle ofw_mmu; 56 58 ihandle ofw_stdout; … … 107 109 ofw_stdout = 0; 108 110 111 ofw_aliases = ofw_find_device("/aliases"); 112 if (ofw_aliases == -1) { 113 puts("\nUnable to find /aliases device\n"); 114 halt(); 115 } 116 109 117 ofw_mmu = ofw_open("/mmu"); 110 118 if (ofw_mmu == -1) { 111 puts(" Unable to open /mmu node\n");119 puts("\nUnable to open /mmu node\n"); 112 120 halt(); 113 121 } … … 158 166 } 159 167 } 168 169 170 int ofw_screen(screen_t *screen) 171 { 172 char device_name[STRING_SIZE]; 173 174 if (ofw_get_property(ofw_aliases, "screen", device_name, STRING_SIZE) <= 0) 175 return false; 176 177 phandle device = ofw_find_device(device_name); 178 if (device == -1) 179 return false; 180 181 if (ofw_get_property(device, "address", &screen->addr, sizeof(screen->addr)) <= 0) 182 return false; 183 184 if (ofw_get_property(device, "width", &screen->width, sizeof(screen->width)) <= 0) 185 return false; 186 187 if (ofw_get_property(device, "height", &screen->height, sizeof(screen->height)) <= 0) 188 return false; 189 190 if (ofw_get_property(device, "depth", &screen->bpp, sizeof(screen->bpp)) <= 0) 191 return false; 192 193 if (ofw_get_property(device, "linebytes", &screen->scanline, sizeof(screen->scanline)) <= 0) 194 return false; 195 196 return true; 197 }
Note:
See TracChangeset
for help on using the changeset viewer.