printf("\n\rzImage starting: loaded at 0x%x\n\r", (unsigned)_start); 
printf("\n\rzImage starting: loaded at 0x%lx\n\r", (unsigned long) _start);  /* * The first available claim_base must be above the end of the * the loaded kernel wrapper file (_start to _end includes the * initrd image if it is present) and rounded up to a nice * 1 MB boundary for good measure. */  claim_base = _ALIGN_UP((unsigned long)_end, ONE_MB);  #if defined(PROG_START) /* * Maintain a "magic" minimum address. This keeps some older * firmware platforms running. */  if (claim_base < PROG_START) claim_base = PROG_START; #endif 
void start(unsigned long a1, unsigned long a2, void *promptr){	unsigned long i;	kernel_entry_t kernel_entry;	Elf64_Ehdr *elf64;	Elf64_Phdr *elf64ph;	prom = (int (*)(void *)) promptr;	chosen_handle = finddevice("/chosen");	if (chosen_handle == (void *) -1)		exit();	if (getprop(chosen_handle, "stdout", &stdout, sizeof(stdout)) != 4)		exit();	stderr = stdout;	if (getprop(chosen_handle, "stdin", &stdin, sizeof(stdin)) != 4)		exit();	printf("\n\rzImage starting: loaded at 0x%x\n\r", (unsigned)_start);	/*	 * Now we try to claim some memory for the kernel itself	 * our "vmlinux_memsize" is the memory footprint in RAM, _HOWEVER_, what	 * our Makefile stuffs in is an image containing all sort of junk including	 * an ELF header. We need to do some calculations here to find the right	 * size... In practice we add 1Mb, that is enough, but we should really	 * consider fixing the Makefile to put a _raw_ kernel in there !	 */	vmlinux_memsize += 0x100000;	printf("Allocating 0x%lx bytes for kernel ...\n\r", vmlinux_memsize);	vmlinux.addr = try_claim(vmlinux_memsize);	if (vmlinux.addr == 0) {		printf("Can't allocate memory for kernel image !\n\r");		exit();	}	vmlinuz.addr = (unsigned long)_vmlinux_start;	vmlinuz.size = (unsigned long)(_vmlinux_end - _vmlinux_start);	vmlinux.size = PAGE_ALIGN(vmlinux_filesize);	vmlinux.memsize = vmlinux_memsize;	/*	 * Now we try to claim memory for the initrd (and copy it there)	 */	initrd.size = (unsigned long)(_initrd_end - _initrd_start);	initrd.memsize = initrd.size;	if ( initrd.size > 0 ) {		printf("Allocating 0x%lx bytes for initrd ...\n\r", initrd.size);		initrd.addr = try_claim(initrd.size);		if (initrd.addr == 0) {			printf("Can't allocate memory for initial ramdisk !\n\r");			exit();		}		a1 = initrd.addr;		a2 = initrd.size;		printf("initial ramdisk moving 0x%lx <- 0x%lx (0x%lx bytes)\n\r",		       initrd.addr, (unsigned long)_initrd_start, initrd.size);		memmove((void *)initrd.addr, (void *)_initrd_start, initrd.size);		printf("initrd head: 0x%lx\n\r", *((unsigned long *)initrd.addr));	}	/* Eventually gunzip the kernel */	if (*(unsigned short *)vmlinuz.addr == 0x1f8b) {		int len;		avail_ram = scratch;		begin_avail = avail_high = avail_ram;		end_avail = scratch + sizeof(scratch);		printf("gunzipping (0x%lx <- 0x%lx:0x%0lx)...",		       vmlinux.addr, vmlinuz.addr, vmlinuz.addr+vmlinuz.size);		len = vmlinuz.size;		gunzip((void *)vmlinux.addr, vmlinux.size,			(unsigned char *)vmlinuz.addr, &len);		printf("done 0x%lx bytes\n\r", len);		printf("0x%x bytes of heap consumed, max in use 0x%x\n\r",		       (unsigned)(avail_high - begin_avail), heap_max);	} else {		memmove((void *)vmlinux.addr,(void *)vmlinuz.addr,vmlinuz.size);	}	/* Skip over the ELF header */	elf64 = (Elf64_Ehdr *)vmlinux.addr;	if ( elf64->e_ident[EI_MAG0]  != ELFMAG0	||	     elf64->e_ident[EI_MAG1]  != ELFMAG1	||	     elf64->e_ident[EI_MAG2]  != ELFMAG2	||	     elf64->e_ident[EI_MAG3]  != ELFMAG3	||	     elf64->e_ident[EI_CLASS] != ELFCLASS64	||	     elf64->e_ident[EI_DATA]  != ELFDATA2MSB	||	     elf64->e_type            != ET_EXEC	||	     elf64->e_machine         != EM_PPC64 )	{		printf("Error: not a valid PPC64 ELF file!\n\r");		exit();	}	elf64ph = (Elf64_Phdr *)((unsigned long)elf64 +				(unsigned long)elf64->e_phoff);	for(i=0; i < (unsigned int)elf64->e_phnum ;i++,elf64ph++) {		if (elf64ph->p_type == PT_LOAD && elf64ph->p_offset != 0)			break;	}#ifdef DEBUG	printf("... skipping 0x%lx bytes of ELF header\n\r",			(unsigned long)elf64ph->p_offset);#endif	vmlinux.addr += (unsigned long)elf64ph->p_offset;	vmlinux.size -= (unsigned long)elf64ph->p_offset;	flush_cache((void *)vmlinux.addr, vmlinux.size);	kernel_entry = (kernel_entry_t)vmlinux.addr;#ifdef DEBUG	printf( "kernel:\n\r"		"        entry addr = 0x%lx\n\r"		"        a1         = 0x%lx,\n\r"		"        a2         = 0x%lx,\n\r"		"        prom       = 0x%lx,\n\r"		"        bi_recs    = 0x%lx,\n\r",		(unsigned long)kernel_entry, a1, a2,		(unsigned long)prom, NULL);#endif	kernel_entry( a1, a2, prom, NULL );	printf("Error: Linux kernel returned to zImage bootloader!\n\r");	exit();}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/3cc747e96480d4e26560e5bc59f2b9c9204ade0e/main.c/clean/arch/ppc64/boot/main.c