diff --git a/Makefile.inc1 b/Makefile.inc1 index 951906c00a22..4fda6db83596 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -107,7 +107,7 @@ TARGET= ${TARGET_ARCH} TARGET?= ${MACHINE} TARGET_ARCH?= ${MACHINE_ARCH} -KNOWN_ARCHES?= amd64 arm i386 i386/pc98 ia64 powerpc sparc64 +KNOWN_ARCHES?= amd64 arm i386 i386/pc98 ia64 powerpc sparc64 sparc64/sun4v .if ${TARGET} == ${TARGET_ARCH} _t= ${TARGET} .else diff --git a/lib/libdisk/Makefile b/lib/libdisk/Makefile index ebc59918d597..01a7f85d3d39 100644 --- a/lib/libdisk/Makefile +++ b/lib/libdisk/Makefile @@ -9,7 +9,13 @@ _open_disk= open_disk.c LIB= disk SRCS= blocks.c ${_change} chunk.c create_chunk.c disk.c ${_open_disk} \ - rules.c write_disk.c write_${MACHINE}_disk.c + rules.c write_disk.c +.if ${TARGET} == "sun4v" +SRCS+= write_sparc64_disk.c +.else +SRCS+= write_${MACHINE}_disk.c +.endif + INCS= libdisk.h WARNS?= 2 diff --git a/lib/libkvm/Makefile b/lib/libkvm/Makefile index 8008c89fada1..2cb769023710 100644 --- a/lib/libkvm/Makefile +++ b/lib/libkvm/Makefile @@ -4,6 +4,10 @@ LIB= kvm SHLIBDIR?= /lib CFLAGS+=-DLIBC_SCCS -I${.CURDIR} +.if ${TARGET} == "sun4v" +CFLAGS+=-DSUN4V +.endif + SRCS= kvm.c kvm_${MACHINE_ARCH}.c kvm_file.c kvm_getloadavg.c \ kvm_getswapinfo.c kvm_proc.c .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" diff --git a/lib/libkvm/kvm_sparc64.c b/lib/libkvm/kvm_sparc64.c index 6e0cd3728548..daec04c65a43 100644 --- a/lib/libkvm/kvm_sparc64.c +++ b/lib/libkvm/kvm_sparc64.c @@ -194,7 +194,9 @@ int _kvm_kvatop(kvm_t *kd, u_long va, off_t *pa) { struct vmstate *vm; +#if !defined(SUN4V) struct tte tte; +#endif off_t tte_off, pa_off; u_long pg_off, vpn; int rest; @@ -202,6 +204,7 @@ _kvm_kvatop(kvm_t *kd, u_long va, off_t *pa) pg_off = va & PAGE_MASK; if (va >= VM_MIN_DIRECT_ADDRESS) pa_off = TLB_DIRECT_TO_PHYS(va) & ~PAGE_MASK; +#if !defined(SUN4V) else { vpn = btop(va); tte_off = kd->vmst->vm_tsb_off + @@ -212,6 +215,7 @@ _kvm_kvatop(kvm_t *kd, u_long va, off_t *pa) goto invalid; pa_off = TTE_GET_PA(&tte); } +#endif rest = PAGE_SIZE - pg_off; pa_off = _kvm_find_off(kd->vmst, pa_off, rest); if (pa_off == KVM_OFF_NOTFOUND)