Deleted Added
full compact
main.c (183628) main.c (188455)
1/*-
2 * Initial implementation:
3 * Copyright (c) 2001 Robert Drehmel
4 * All rights reserved.
5 *
6 * As long as the above copyright statement and this notice remain
7 * unchanged, you can do what ever you want with this file.
8 */

--- 19 unchanged lines hidden (view full) ---

28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 */
34
35#include <sys/cdefs.h>
1/*-
2 * Initial implementation:
3 * Copyright (c) 2001 Robert Drehmel
4 * All rights reserved.
5 *
6 * As long as the above copyright statement and this notice remain
7 * unchanged, you can do what ever you want with this file.
8 */

--- 19 unchanged lines hidden (view full) ---

28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 */
34
35#include <sys/cdefs.h>
36__FBSDID("$FreeBSD: head/sys/boot/sparc64/loader/main.c 183628 2008-10-05 14:00:44Z marius $");
36__FBSDID("$FreeBSD: head/sys/boot/sparc64/loader/main.c 188455 2009-02-10 21:48:42Z marius $");
37
38/*
39 * FreeBSD/sparc64 kernel loader - machine dependent part
40 *
41 * - implements copyin and readin functions that map kernel
42 * pages on demand. The machine independent code does not
43 * know the size of the kernel early enough to pre-enter
44 * TTEs and install just one 4MB mapping seemed to limiting

--- 333 unchanged lines hidden (view full) ---

378 if ((fmp = file_findmetadata(fp, MODINFOMD_ELFHDR)) == 0)
379 return (EFTYPE);
380 e = (Elf_Ehdr *)&fmp->md_data;
381
382 if ((error = md_load(fp->f_args, &mdp)) != 0)
383 return (error);
384
385 printf("jumping to kernel entry at %#lx.\n", e->e_entry);
37
38/*
39 * FreeBSD/sparc64 kernel loader - machine dependent part
40 *
41 * - implements copyin and readin functions that map kernel
42 * pages on demand. The machine independent code does not
43 * know the size of the kernel early enough to pre-enter
44 * TTEs and install just one 4MB mapping seemed to limiting

--- 333 unchanged lines hidden (view full) ---

378 if ((fmp = file_findmetadata(fp, MODINFOMD_ELFHDR)) == 0)
379 return (EFTYPE);
380 e = (Elf_Ehdr *)&fmp->md_data;
381
382 if ((error = md_load(fp->f_args, &mdp)) != 0)
383 return (error);
384
385 printf("jumping to kernel entry at %#lx.\n", e->e_entry);
386#if LOADER_DEBUG
386#ifdef LOADER_DEBUG
387 pmap_print_tlb_sun4u();
388#endif
389
390 entry = e->e_entry;
391
392 OF_release((void *)heapva, HEAPSZ);
393
394 ((kernel_entry_t *)entry)(mdp, 0, 0, 0, openfirmware);

--- 99 unchanged lines hidden (view full) ---

494 */
495 for (i = 1; i < itlb_slot_max; i++) {
496 if ((itlb_get_data_sun4u(i) & TD_V) != 0)
497 continue;
498
499 stxa(AA_IMMU_TAR, ASI_IMMU,
500 TLB_TAR_VA(vpn) | TLB_TAR_CTX(TLB_CTX_KERNEL));
501 stxa(TLB_DAR_SLOT(i), ASI_ITLB_DATA_ACCESS_REG, data);
387 pmap_print_tlb_sun4u();
388#endif
389
390 entry = e->e_entry;
391
392 OF_release((void *)heapva, HEAPSZ);
393
394 ((kernel_entry_t *)entry)(mdp, 0, 0, 0, openfirmware);

--- 99 unchanged lines hidden (view full) ---

494 */
495 for (i = 1; i < itlb_slot_max; i++) {
496 if ((itlb_get_data_sun4u(i) & TD_V) != 0)
497 continue;
498
499 stxa(AA_IMMU_TAR, ASI_IMMU,
500 TLB_TAR_VA(vpn) | TLB_TAR_CTX(TLB_CTX_KERNEL));
501 stxa(TLB_DAR_SLOT(i), ASI_ITLB_DATA_ACCESS_REG, data);
502 flush(KERNBASE);
502 flush(PROMBASE);
503 break;
504 }
505 wrpr(pstate, reg, 0);
506 if (i == itlb_slot_max)
507 panic("%s: could not find an unused slot", __func__);
508 return;
509 }
510
511 stxa(AA_IMMU_TAR, ASI_IMMU,
512 TLB_TAR_VA(vpn) | TLB_TAR_CTX(TLB_CTX_KERNEL));
513 stxa(0, ASI_ITLB_DATA_IN_REG, data);
503 break;
504 }
505 wrpr(pstate, reg, 0);
506 if (i == itlb_slot_max)
507 panic("%s: could not find an unused slot", __func__);
508 return;
509 }
510
511 stxa(AA_IMMU_TAR, ASI_IMMU,
512 TLB_TAR_VA(vpn) | TLB_TAR_CTX(TLB_CTX_KERNEL));
513 stxa(0, ASI_ITLB_DATA_IN_REG, data);
514 flush(KERNBASE);
514 flush(PROMBASE);
515 wrpr(pstate, reg, 0);
516}
517
518static void
519itlb_relocate_locked0_sun4u(void)
520{
521 u_long data, pstate, tag;
522 int i;

--- 309 unchanged lines hidden (view full) ---

832void
833exit(int code)
834{
835
836 OF_exit();
837}
838
839#ifdef LOADER_DEBUG
515 wrpr(pstate, reg, 0);
516}
517
518static void
519itlb_relocate_locked0_sun4u(void)
520{
521 u_long data, pstate, tag;
522 int i;

--- 309 unchanged lines hidden (view full) ---

832void
833exit(int code)
834{
835
836 OF_exit();
837}
838
839#ifdef LOADER_DEBUG
840static const char *page_sizes[] = {
840static const char *const page_sizes[] = {
841 " 8k", " 64k", "512k", " 4m"
842};
843
844static void
845pmap_print_tte_sun4u(tte_t tag, tte_t tte)
846{
847
848 printf("%s %s ",

--- 44 unchanged lines hidden ---
841 " 8k", " 64k", "512k", " 4m"
842};
843
844static void
845pmap_print_tte_sun4u(tte_t tag, tte_t tte)
846{
847
848 printf("%s %s ",

--- 44 unchanged lines hidden ---