Changeset 272c219 in mainline for arch/ppc32/loader/ofw.c
- Timestamp:
- 2006-03-13T18:42:58Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- eebd172
- Parents:
- 8cbe350
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/ppc32/loader/ofw.c
r8cbe350 r272c219 28 28 29 29 #include "ofw.h" 30 #include "printf.h" 30 31 31 32 ofw_entry ofw; 32 33 33 34 phandle ofw_chosen; 35 ihandle ofw_mmu; 34 36 ihandle ofw_stdout; 35 37 … … 39 41 ofw_chosen = ofw_find_device("/chosen"); 40 42 if (ofw_chosen == -1) 41 ofw_call("exit", 0, 0);43 halt(); 42 44 43 45 if (ofw_get_property(ofw_chosen, "stdout", &ofw_stdout, sizeof(ofw_stdout)) <= 0) 44 46 ofw_stdout = 0; 47 48 ofw_mmu = ofw_open("/mmu"); 49 if (ofw_mmu == -1) { 50 puts("Unable to open /mmu node\n"); 51 halt(); 52 } 53 } 54 55 void halt(void) 56 { 57 ofw_call("exit", 0, 0); 45 58 } 46 59 … … 66 79 ofw(&args); 67 80 68 return args.args[nargs]; 81 if (nret > 0) 82 return args.args[nargs + nret - 1]; 83 else 84 return 0; 85 } 86 87 88 ihandle ofw_open(const char *name) 89 { 90 return ofw_call("open", 1, 1, name); 69 91 } 70 92 … … 76 98 77 99 ofw_call("write", 3, 1, ofw_stdout, str, len); 78 }79 80 81 void ofw_puts(const char *str)82 {83 int len = 0;84 85 while (str[len] != 0)86 len++;87 88 ofw_write(str, len);89 100 } 90 101 … … 106 117 return (void *) ofw_call("claim", 3, 1, addr, size, align); 107 118 } 119 120 121 void *ofw_translate(const void *virt) 122 { 123 return (void *) ofw_call_method(ofw_mmu, "translate", 1, 5, virt); 124 }
Note:
See TracChangeset
for help on using the changeset viewer.