-/* $OpenBSD: acpi_machdep.c,v 1.20 2022/09/13 17:14:54 kettenis Exp $ */
+/* $OpenBSD: acpi_machdep.c,v 1.21 2022/11/26 17:23:15 tobhe Exp $ */
/*
* Copyright (c) 2018 Mark Kettenis
*
#include "apm.h"
-int lid_action;
int pwr_action = 1;
int acpi_fdt_match(struct device *, void *, void *);
-/* $OpenBSD: machdep.c,v 1.77 2022/11/24 14:43:16 kettenis Exp $ */
+/* $OpenBSD: machdep.c,v 1.78 2022/11/26 17:23:15 tobhe Exp $ */
/*
* Copyright (c) 2014 Patrick Wildt <patrick@blueri.se>
* Copyright (c) 2021 Mark Kettenis <kettenis@openbsd.org>
void (*powerdownfn)(void);
int cold = 1;
+int lid_action = 0;
struct vm_map *exec_map = NULL;
struct vm_map *phys_map = NULL;
* machine dependent system variables.
*/
+const struct sysctl_bounded_args cpuctl_vars[] = {
+ { CPU_LIDACTION, &lid_action, 0, 2 },
+};
+
int
cpu_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp,
size_t newlen, struct proc *p)
case CPU_ID_AA64ZFR0:
return sysctl_rdquad(oldp, oldlenp, newp, 0);
default:
- return (EOPNOTSUPP);
+ return (sysctl_bounded_arr(cpuctl_vars, nitems(cpuctl_vars),
+ name, namelen, oldp, oldlenp, newp, newlen));
}
/* NOTREACHED */
}
-/* $OpenBSD: aplsmc.c,v 1.19 2022/11/25 20:33:11 tobhe Exp $ */
+/* $OpenBSD: aplsmc.c,v 1.20 2022/11/26 17:23:15 tobhe Exp $ */
/*
* Copyright (c) 2021 Mark Kettenis <kettenis@openbsd.org>
*
#include "apm.h"
+extern int lid_action;
extern void (*simplefb_burn_hook)(u_int);
extern void (*cpuresetfn)(void);
sc->sc_dev.dv_xname, data);
break;
}
+ switch (lid_action) {
+ case 1:
+ /* XXX: suspend */
+ break;
+ case 2:
+ /* XXX: hibernate */
+ break;
+ }
break;
default:
#ifdef APLSMC_DEBUG
-/* $OpenBSD: cpu.h,v 1.31 2022/11/24 14:43:16 kettenis Exp $ */
+/* $OpenBSD: cpu.h,v 1.32 2022/11/26 17:23:15 tobhe Exp $ */
/*
* Copyright (c) 2016 Dale Rahn <drahn@dalerahn.com>
*
#define CPU_ID_AA64PFR1 9
#define CPU_ID_AA64SMFR0 10
#define CPU_ID_AA64ZFR0 11
-#define CPU_MAXID 12 /* number of valid machdep ids */
+#define CPU_LIDACTION 12
+#define CPU_MAXID 13 /* number of valid machdep ids */
#define CTL_MACHDEP_NAMES { \
{ 0, 0 }, \