Date: Sun, 6 Apr 2003 14:00:50 -0700 (PDT) From: Peter Wemm <peter@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 28356 for review Message-ID: <200304062100.h36L0oBK075812@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=28356 Change 28356 by peter@peter_overcee on 2003/04/06 13:59:50 argh. I hate this VTOP stuff. fix some other silly bogons. actually set the entry points. Affected files ... .. //depot/projects/hammer/sys/boot/i386/libi386/elf64_freebsd.c#5 edit Differences ... ==== //depot/projects/hammer/sys/boot/i386/libi386/elf64_freebsd.c#5 (text+ko) ==== @@ -65,7 +65,7 @@ { struct file_metadata *md; Elf_Ehdr *ehdr; - vm_offset_t entry, bootinfop, modulep; + vm_offset_t bootinfop, modulep; int boothowto, err, bootdev; struct bootinfo *bi; vm_offset_t ssym, esym; @@ -77,7 +77,6 @@ if ((err = bi_load(fp->f_args, &boothowto, &bootdev, &bootinfop, &modulep)) != 0) return(err); - entry = ehdr->e_entry & 0xffffff; ssym = esym = 0; if ((md = file_findmetadata(fp, MODINFOMD_SSYM)) != NULL) @@ -100,12 +99,12 @@ bzero(PT2, PAGE_SIZE); /* single PML4 entry */ - PT4[0] = (p4_entry_t)(uintptr_t)&PT3[0]; + PT4[0] = (p4_entry_t)VTOP((uintptr_t)&PT3[0]); PT4[0] |= PG_V | PG_RW | PG_U; /* four PDP entries, 1G each */ for (i = 0; i < 4; i++) { - PT3[i] = (p3_entry_t)(uintptr_t)&PT2[i * 512]; + PT3[i] = (p3_entry_t)VTOP((uintptr_t)&PT2[i * 512]); PT3[i] |= PG_V | PG_RW | PG_U; } @@ -115,12 +114,14 @@ PT2[i] |= PG_V | PG_RW | PG_PS | PG_U; } + entry_lo = ehdr->e_entry & 0xffffffff; + entry_hi = (ehdr->e_entry >> 32) & 0xffffffff; printf("entry_hi: %#x \n", entry_hi); printf("entry_lo: %#x \n", entry_lo); - printf("Start @ %#llx ...\n", entry); + printf("Start @ %#llx ...\n", ehdr->e_entry); dev_cleanup(); - __exec((void *)x86_64_tramp, boothowto, bootdev, 0, 0, 0, bootinfop, modulep, bi->bi_kernend); + __exec((void *)VTOP(x86_64_tramp), boothowto, bootdev, 0, 0, 0, bootinfop, modulep, bi->bi_kernend); panic("exec returned"); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200304062100.h36L0oBK075812>