Date: Wed, 22 Feb 2006 19:23:34 GMT From: Kip Macy <kmacy@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 92222 for review Message-ID: <200602221923.k1MJNYRt074103@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=92222 Change 92222 by kmacy@kmacy_storage:sun4v_work on 2006/02/22 19:22:34 add virtual mappings through ofw so that we can recover them along with other PROM mappings in pmap_bootstrap Affected files ... .. //depot/projects/kmacy_sun4v/src/sys/boot/ofw/libofw/Makefile#2 edit .. //depot/projects/kmacy_sun4v/src/sys/boot/ofw/libofw/openfirm.c#2 edit .. //depot/projects/kmacy_sun4v/src/sys/boot/ofw/libofw/openfirm.h#2 edit .. //depot/projects/kmacy_sun4v/src/sys/boot/ofw/libofw/openfirm_mmu.c#1 add .. //depot/projects/kmacy_sun4v/src/sys/boot/sparc64/loader/main.c#3 edit Differences ... ==== //depot/projects/kmacy_sun4v/src/sys/boot/ofw/libofw/Makefile#2 (text+ko) ==== @@ -5,7 +5,7 @@ SRCS= devicename.c elf_freebsd.c ofw_console.c ofw_copy.c ofw_disk.c \ ofw_memory.c ofw_module.c ofw_net.c ofw_reboot.c \ - ofw_time.c openfirm.c + ofw_time.c openfirm.c openfirm_mmu.c CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ ==== //depot/projects/kmacy_sun4v/src/sys/boot/ofw/libofw/openfirm.c#2 (text+ko) ==== @@ -87,6 +87,20 @@ panic("failed to get mmu ihandle"); } +phandle_t +OF_chosennode(void) +{ + static phandle_t chosen; + + if (chosen) + return (chosen); + + if ((chosen = OF_finddevice("/chosen")) == -1) + OF_exit(); + + return (chosen); +} + /* * Generic functions */ ==== //depot/projects/kmacy_sun4v/src/sys/boot/ofw/libofw/openfirm.h#2 (text+ko) ==== @@ -126,4 +126,12 @@ /* Time function */ int OF_milliseconds(void); + +/* MMU functions */ +int OF_translate_virt(vm_offset_t va, int *valid, vm_paddr_t *physaddr, int *mode); +vm_paddr_t OF_vtophys(vm_offset_t va); +int OF_map_phys(int mode, size_t size, vm_offset_t va, uint64_t pa); + + + #endif /* _OPENFIRM_H_ */ ==== //depot/projects/kmacy_sun4v/src/sys/boot/sparc64/loader/main.c#3 (text+ko) ==== @@ -372,9 +372,8 @@ } tlb_store[va >> 22].te_pa = pa; - data = VTD_V | VTD_PA(pa) | VTD_CP | VTD_CV | VTD_P | VTD_W | VTD_4M; - if ((ret = hv_mmu_map_perm_addr(va, 0, data, MAP_DTLB | MAP_ITLB)) != 0) - printf("hv_mmu_map_perm_addr failed: %d\n", ret);; + if ((ret = OF_map_phys(-1, PAGE_SIZE_4M, va, pa)) != 0) + printf("OF_map_phys failed: %d\n", ret); pa = (vm_offset_t)-1; } len -= len > PAGE_SIZE_4M ? PAGE_SIZE_4M : len;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200602221923.k1MJNYRt074103>