/* The following structure is used to communicate with open firmware.
* All arguments in and out are in big endian format. */ struct prom_args {
__be32 service; /* Address of service name string. */
__be32 nargs; /* Number of input arguments. */
__be32 nret; /* Number of output arguments. */
__be32 args[10]; /* Input/output arguments. */
};
/* returns true if s2 is a prefix of s1 */ staticint string_match(constchar *s1, constchar *s2)
{ for (; *s2; ++s2) if (*s1++ != *s2) return 0; return 1;
}
/* * Older OF's require that when claiming a specific range of addresses, * we claim the physical space in the /memory node and the virtual * space in the chosen mmu node, and then do a map operation to * map virtual to physical.
*/ staticint need_map = -1; static ihandle chosen_mmu; static ihandle memory;
/* With some older POWER4 firmware we need to claim the area the kernel * will reside in. Newer firmwares don't need this so we just ignore * the return value.
*/
addr = (unsignedlong) of_claim(start, end - start, 0);
printf("Trying to claim from 0x%lx to 0x%lx (0x%lx) got %lx\r\n",
start, end, end - start, addr);
p = malloc(size); if (!p)
fatal("Can't allocate memory for kernel image!\n\r");
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.