Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove IOKit / IOMainPort / IOMMasterPort logic #1614

Merged
merged 1 commit into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,6 @@ AC_CHECK_FUNCS([ \

if test "$my_htop_platform" = darwin; then
AC_CHECK_FUNCS([mach_timebase_info])
AC_CHECK_DECLS([IOMainPort], [], [], [[#include <IOKit/IOKitLib.h>]])
AC_CHECK_DECLS([IOMasterPort], [], [], [[#include <IOKit/IOKitLib.h>]])

AC_CHECK_FUNCS([host_statistics64], [
AC_CHECK_TYPES([struct vm_statistics64], [], [], [[#include <mach/vm_statistics.h>]])
Expand Down
14 changes: 0 additions & 14 deletions darwin/Platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ static double Platform_nanosecondsPerMachTick = 1.0;

static double Platform_nanosecondsPerSchedulerTick = -1;

static bool iokit_available = false;
static mach_port_t iokit_port; // the mach port used to initiate communication with IOKit

bool Platform_init(void) {
Expand All @@ -169,17 +168,6 @@ bool Platform_init(void) {
const double nanos_per_sec = 1e9;
Platform_nanosecondsPerSchedulerTick = nanos_per_sec / scheduler_ticks_per_sec;

// Since macOS 12.0, IOMasterPort is deprecated, and one should use IOMainPort instead
#if defined(HAVE_DECL_IOMAINPORT) && HAVE_DECL_IOMAINPORT
if (!IOMainPort(bootstrap_port, &iokit_port)) {
iokit_available = true;
}
#elif defined(HAVE_DECL_IOMASTERPORT) && HAVE_DECL_IOMASTERPORT
if (!IOMasterPort(bootstrap_port, &iokit_port)) {
iokit_available = true;
}
#endif

return true;
}

Expand Down Expand Up @@ -410,8 +398,6 @@ void Platform_getFileDescriptors(double* used, double* max) {
}

bool Platform_getDiskIO(DiskIOData* data) {
if (!iokit_available)
return false;

io_iterator_t drive_list;

Expand Down
Loading