aboutsummaryrefslogtreecommitdiff
path: root/acpi/main.c
diff options
context:
space:
mode:
authorDamien Zammit <damien@zamaudio.com>2022-09-12 10:39:30 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2022-09-12 20:32:24 +0200
commit160fb63ee0c72f165ab131c4d725d9badaa646ab (patch)
treeffb56a39d40b8e42213990ba5ce6f136eb9431ec /acpi/main.c
parent22676a3a6e4d99e13ee75c1ad2f4976ae6b0ce52 (diff)
downloadhurd-160fb63ee0c72f165ab131c4d725d9badaa646ab.tar.gz
hurd-160fb63ee0c72f165ab131c4d725d9badaa646ab.tar.bz2
hurd-160fb63ee0c72f165ab131c4d725d9badaa646ab.zip
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>
Diffstat (limited to 'acpi/main.c')
-rw-r--r--acpi/main.c12
1 files changed, 10 insertions, 2 deletions
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 <argp.h>
#include <hurd/netfs.h>
+#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 <acpi/acpi_init.h>
#include <acpifs.h>
/* 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,11 +79,16 @@ 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");
/* Create the ACPI filesystem */
@@ -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;
}