From 835a1112dc5ca8d066fa1d0e2dfb979c19bf58be Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sat, 2 Mar 2019 15:38:06 -0800 Subject: shutdown: clean up debugging pieces * shutdown/acpi_shutdown.c (disappear_via_acpi): Call ioperm only on required ports, not all ports. * shutdown/shutdown.c (S_shutdown, main): Remove debugging messages, even if joyful :) --- shutdown/acpi_shutdown.c | 8 ++++++-- shutdown/shutdown.c | 3 --- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'shutdown') diff --git a/shutdown/acpi_shutdown.c b/shutdown/acpi_shutdown.c index af9b15d4..a45b2e74 100644 --- a/shutdown/acpi_shutdown.c +++ b/shutdown/acpi_shutdown.c @@ -37,8 +37,12 @@ void disappear_via_acpi(void) fclose(facp); /* Get I/O permissions */ - if (ioperm(0, 0xffff, 1)) { - mach_print("EPERM on ioperm()\n"); + if (ioperm(smi_cmd, 2, 1)) { + mach_print("EPERM on ioperm(smi_cmd)\n"); + return; + } + if (ioperm(pm1a_ctl, 2, 1)) { + mach_print("EPERM on ioperm(pm1a_ctl)\n"); return; } diff --git a/shutdown/shutdown.c b/shutdown/shutdown.c index 413b5148..44ae975a 100644 --- a/shutdown/shutdown.c +++ b/shutdown/shutdown.c @@ -56,7 +56,6 @@ struct port_class *trivfs_control_class; kern_return_t S_shutdown(trivfs_protid_t server) { - mach_print ("YAY RPC\n"); disappear_via_acpi(); return 0; } @@ -139,8 +138,6 @@ main (int argc, char *argv[]) if (err) error (3, err, "Contacting parent"); - mach_print("Hello shutdown before ports loop\n"); - /* Launch. */ do ports_manage_port_operations_multithread (port_bucket, shutdown_demuxer, -- cgit v1.2.3