From 160fb63ee0c72f165ab131c4d725d9badaa646ab Mon Sep 17 00:00:00 2001 From: Damien Zammit Date: Mon, 12 Sep 2022 10:39:30 +0000 Subject: acpi: Link translator to libacpica and provide RPCs Provides two new acpi RPCs to sleep the machine and to get the irq of any pci device. ACPI mode is enabled by default when the translator is started. NB: Merging this commit means libacpica is a build dep. Message-Id: <20220912103837.556815-2-damien@zamaudio.com> --- acpi/main.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'acpi/main.c') diff --git a/acpi/main.c b/acpi/main.c index ac325915..fc46f4f2 100644 --- a/acpi/main.c +++ b/acpi/main.c @@ -26,12 +26,14 @@ #include #include +#include "acpi_S.h" #include "libnetfs/io_S.h" #include "libnetfs/fs_S.h" #include "libports/notify_S.h" #include "libnetfs/fsys_S.h" #include "libports/interrupt_S.h" #include "libnetfs/ifsock_S.h" +#include #include /* Libnetfs stuff */ @@ -53,7 +55,8 @@ netfs_demuxer (mach_msg_header_t * inp, mach_msg_header_t * outp) (routine = ports_notify_server_routine (inp)) || (routine = netfs_fsys_server_routine (inp)) || (routine = ports_interrupt_server_routine (inp)) || - (routine = netfs_ifsock_server_routine (inp))) + (routine = netfs_ifsock_server_routine (inp)) || + (routine = acpi_server_routine (inp))) { (*routine) (inp, outp); return TRUE; @@ -76,10 +79,15 @@ main (int argc, char **argv) if (bootstrap == MACH_PORT_NULL) error (1, 0, "must be started as a translator"); + /* Initialize ACPI */ + acpi_init(); + /* Initialize netfs and start the translator. */ netfs_init (); err = maptime_map (0, 0, &acpifs_maptime); + if (err) + err = maptime_map (1, 0, &acpifs_maptime); if (err) error (1, err, "mapping time"); @@ -98,7 +106,7 @@ main (int argc, char **argv) if (err) error (1, err, "setting permissions"); - netfs_server_loop (); /* Never returns. */ + netfs_server_loop (); /* Never returns. */ return 0; } -- cgit v1.2.3