Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.
/ jdk22u Public archive

Commit

Permalink
8328776: [AIX] remove checked_vmgetinfo, use vmgetinfo directly
Browse files Browse the repository at this point in the history
Backport-of: cf9b5a71bd66a51147d0dbf9ecf4038101a1e191
  • Loading branch information
MBaesken committed Apr 5, 2024
1 parent 95772e6 commit 083f9d1
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions src/hotspot/os/aix/os_aix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,27 +324,14 @@ static char cpu_arch[] = "ppc64";
#error Add appropriate cpu_arch setting
#endif

// Wrap the function "vmgetinfo" which is not available on older OS releases.
static int checked_vmgetinfo(void *out, int command, int arg) {
if (os::Aix::on_pase() && os::Aix::os_version_short() < 0x0601) {
guarantee(false, "cannot call vmgetinfo on AS/400 older than V6R1");
}
return ::vmgetinfo(out, command, arg);
}

// Given an address, returns the size of the page backing that address.
size_t os::Aix::query_pagesize(void* addr) {

if (os::Aix::on_pase() && os::Aix::os_version_short() < 0x0601) {
// AS/400 older than V6R1: no vmgetinfo here, default to 4K
return 4*K;
}

vm_page_info pi;
pi.addr = (uint64_t)addr;
if (checked_vmgetinfo(&pi, VM_PAGE_INFO, sizeof(pi)) == 0) {
if (::vmgetinfo(&pi, VM_PAGE_INFO, sizeof(pi)) == 0) {
return pi.pagesize;
} else {
trcVerbose("vmgetinfo(VM_PAGE_INFO) failed (errno: %d)", errno);
assert(false, "vmgetinfo failed to retrieve page size");
return 4*K;
}
Expand Down Expand Up @@ -446,7 +433,7 @@ static void query_multipage_support() {
{
const int MAX_PAGE_SIZES = 4;
psize_t sizes[MAX_PAGE_SIZES];
const int num_psizes = checked_vmgetinfo(sizes, VMINFO_GETPSIZES, MAX_PAGE_SIZES);
const int num_psizes = ::vmgetinfo(sizes, VMINFO_GETPSIZES, MAX_PAGE_SIZES);
if (num_psizes == -1) {
trcVerbose("vmgetinfo(VMINFO_GETPSIZES) failed (errno: %d)", errno);
trcVerbose("disabling multipage support.");
Expand Down

1 comment on commit 083f9d1

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.