Discussion:
sys/arch/i386/i386/bios.c won't compile if NACPI==0 and NAPM>0
Nick Briggs
2017-07-14 22:39:25 UTC
Permalink
Synopsis: sys/arch/i386/i386/bios.c won't compile if NACPI ==0 and NAPM>0
Category: system
System : OpenBSD 6.1
Details : OpenBSD 6.1-stable (PIGEON) #5: Thu Jul 13 17:09:51 PDT 2017
***@pigeon:/usr/obj/sys/arch/i386/compile/PIGEON

Architecture: OpenBSD.i386
Machine : i386
In bios.c:171 "usingacpi" is declared with

#if NACPI > 0
int usingacpi = 0;
#endif

but at bios.c:390, we find

#if NAPM > 0
if (usingacpi == 0 && apm && ncpu < 2 && smbiosrev < 240) {
recompile kernel for i386 with apm but without acpi in the configuration.
One possibility:

Index: sys/arch/i386/i386/bios.c
===================================================================
RCS file: /cvs/src/sys/arch/i386/i386/bios.c,v
retrieving revision 1.115
diff -u -p -r1.115 bios.c
--- sys/arch/i386/i386/bios.c 7 Mar 2016 05:32:46 -0000 1.115
+++ sys/arch/i386/i386/bios.c 14 Jul 2017 19:33:20 -0000
@@ -171,7 +171,7 @@ biosattach(struct device *parent, struct
volatile u_int8_t *va;
char scratch[64], *str;
int flags, smbiosrev = 0, ncpu = 0, isa_hole_exec = 0;
-#if NACPI > 0
+#if NACPI > 0 || NAPM > 0
int usingacpi = 0;
#endif

Alternatively, make the reference to usingacpi conditional on NACPI > 0.
Mike Larkin
2017-07-15 05:29:18 UTC
Permalink
Post by Nick Briggs
Synopsis: sys/arch/i386/i386/bios.c won't compile if NACPI ==0 and NAPM>0
Category: system
System : OpenBSD 6.1
Details : OpenBSD 6.1-stable (PIGEON) #5: Thu Jul 13 17:09:51 PDT 2017
Architecture: OpenBSD.i386
Machine : i386
In bios.c:171 "usingacpi" is declared with
#if NACPI > 0
int usingacpi = 0;
#endif
but at bios.c:390, we find
#if NAPM > 0
if (usingacpi == 0 && apm && ncpu < 2 && smbiosrev < 240) {
recompile kernel for i386 with apm but without acpi in the configuration.
Index: sys/arch/i386/i386/bios.c
===================================================================
RCS file: /cvs/src/sys/arch/i386/i386/bios.c,v
retrieving revision 1.115
diff -u -p -r1.115 bios.c
--- sys/arch/i386/i386/bios.c 7 Mar 2016 05:32:46 -0000 1.115
+++ sys/arch/i386/i386/bios.c 14 Jul 2017 19:33:20 -0000
@@ -171,7 +171,7 @@ biosattach(struct device *parent, struct
volatile u_int8_t *va;
char scratch[64], *str;
int flags, smbiosrev = 0, ncpu = 0, isa_hole_exec = 0;
-#if NACPI > 0
+#if NACPI > 0 || NAPM > 0
int usingacpi = 0;
#endif
Alternatively, make the reference to usingacpi conditional on NACPI > 0.
what are you trying to do here?

We generally don't support bizarre custom kernel configurations.

-ml
Nick Briggs
2017-07-15 06:40:30 UTC
Permalink
Post by Mike Larkin
Post by Nick Briggs
Synopsis: sys/arch/i386/i386/bios.c won't compile if NACPI ==0 and NAPM>0
Category: system
System : OpenBSD 6.1
Details : OpenBSD 6.1-stable (PIGEON) #5: Thu Jul 13 17:09:51 PDT 2017
Architecture: OpenBSD.i386
Machine : i386
In bios.c:171 "usingacpi" is declared with
#if NACPI > 0
int usingacpi = 0;
#endif
but at bios.c:390, we find
#if NAPM > 0
if (usingacpi == 0 && apm && ncpu < 2 && smbiosrev < 240) {
recompile kernel for i386 with apm but without acpi in the configuration.
Index: sys/arch/i386/i386/bios.c
===================================================================
RCS file: /cvs/src/sys/arch/i386/i386/bios.c,v
retrieving revision 1.115
diff -u -p -r1.115 bios.c
--- sys/arch/i386/i386/bios.c 7 Mar 2016 05:32:46 -0000 1.115
+++ sys/arch/i386/i386/bios.c 14 Jul 2017 19:33:20 -0000
@@ -171,7 +171,7 @@ biosattach(struct device *parent, struct
volatile u_int8_t *va;
char scratch[64], *str;
int flags, smbiosrev = 0, ncpu = 0, isa_hole_exec = 0;
-#if NACPI > 0
+#if NACPI > 0 || NAPM > 0
int usingacpi = 0;
#endif
Alternatively, make the reference to usingacpi conditional on NACPI > 0.
what are you trying to do here?
We generally don't support bizarre custom kernel configurations.
-ml
It's an old piece of hardware I was building a minimal kernel for. There is no ACPI support on it, only APM -- it's not exactly bizarre, just old.
I had gone through the config and removed any devices that weren't present, thus:
...
apm0 at bios0 flags 0x0000 # flags 0x0101 to force protocol version 1.1
#acpi0 at bios?
...

This is the only place in the kernel that won't compile in this situation, and there's no requirement that I can find that says you must configure in ACPI support if you have APM.

Anyway -- it seems like a simple and harmless fix and captures the actual dependencies of the rest of the code.
Loading...