Fix reporting of the CloudABI ABI in kdump.

- Advertise the word size for CloudABI ABIs via the SV_LP64 flag.  All of
  the other ABIs include either SV_ILP32 or SV_LP64.
- Fix kdump to not assume a 32-bit ABI if the ABI flags field is non-zero
  but SV_LP64 isn't set.  Instead, only assume a 32-bit ABI if SV_ILP32 is
  set and fallback to the unknown value of "00" if neither SV_LP64 nor
  SV_ILP32 is set.

Reviewed by:	kib, ed
Differential Revision:	https://reviews.freebsd.org/D5560
This commit is contained in:
John Baldwin 2016-03-09 18:38:30 +00:00
parent 47d306bf35
commit 6fc8053f1a
3 changed files with 7 additions and 8 deletions

View File

@ -143,7 +143,7 @@ static struct sysentvec cloudabi64_elf_sysvec = {
.sv_usrstack = USRSTACK,
.sv_stackprot = VM_PROT_READ | VM_PROT_WRITE,
.sv_copyout_strings = cloudabi64_copyout_strings,
.sv_flags = SV_ABI_CLOUDABI | SV_CAPSICUM,
.sv_flags = SV_ABI_CLOUDABI | SV_CAPSICUM | SV_LP64,
.sv_set_syscall_retval = cloudabi64_set_syscall_retval,
.sv_fetch_syscall_args = cloudabi64_fetch_syscall_args,
.sv_syscallnames = cloudabi64_syscallnames,

View File

@ -144,7 +144,7 @@ static struct sysentvec cloudabi64_elf_sysvec = {
.sv_usrstack = USRSTACK,
.sv_stackprot = VM_PROT_READ | VM_PROT_WRITE,
.sv_copyout_strings = cloudabi64_copyout_strings,
.sv_flags = SV_ABI_CLOUDABI | SV_CAPSICUM,
.sv_flags = SV_ABI_CLOUDABI | SV_CAPSICUM | SV_LP64,
.sv_set_syscall_retval = cloudabi64_set_syscall_retval,
.sv_fetch_syscall_args = cloudabi64_fetch_syscall_args,
.sv_syscallnames = cloudabi64_syscallnames,

View File

@ -529,12 +529,11 @@ abidump(struct ktr_header *kth)
break;
}
if (flags != 0) {
if (flags & SV_LP64)
arch = "64";
else
arch = "32";
} else
if (flags & SV_LP64)
arch = "64";
else if (flags & SV_ILP32)
arch = "32";
else
arch = "00";
printf("%s%s ", abi, arch);