Skip to content

Commit 5b11ef0

Browse files
committed
Conditional compilation & remove redefinition
Description: Conditionally compile ACPICA only if system is amd64. Until arm64 compat is introduced, all of ACPICA needs to be conditionally compiled like so. After my GSoC final deliverable (Lua bindings), the next goal will be arm64 compat. Sponsored by: Google Summer of Code 2025 Signed-off-by: Kayla Powell (AKA Kat) <[email protected]>
1 parent 0fb3424 commit 5b11ef0

File tree

5 files changed

+6
-10
lines changed

5 files changed

+6
-10
lines changed
File renamed without changes.

stand/efi/acpica/include/init_acpi.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@
2727
#ifndef INIT_ACPI_H
2828
#define INIT_ACPI_H
2929

30-
#include <efi.h>
31-
#include <efilib.h>
32-
3330
#define ACPI_LOADER 0x00020000
3431

3532
#include <contrib/dev/acpica/include/acpi.h>

stand/efi/acpica/init_acpi.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,10 @@
2424
* SUCH DAMAGE.
2525
*/
2626

27-
#include <machine/_inttypes.h>
28-
29-
#include <efi.h>
30-
3127
#include <stand.h>
32-
3328
#include <acpi.h>
3429
#include <accommon.h>
3530
#include <acoutput.h>
36-
3731
#include <init_acpi.h>
3832

3933
#define _COMPONENT ACPI_LOADER

stand/efi/loader/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,10 @@ SRCS= autoload.c \
3434
SRCS+= acpi_detect.c
3535
.PATH: ${.CURDIR}/../acpica
3636

37+
.if ${MACHINE_ARCH} == "amd64"
3738
SRCS+= OsdMemory.c osunixxf.c
3839

39-
.PATH: ${.CURDIR}/../acpica/amd64/Osd
40+
.PATH: ${.CURDIR}/../acpica/amd64/Osd/
4041
.PATH: ${.CURDIR}/../contrib/dev/acpica/os_specific/service_layers
4142

4243
CFLAGS+= -DACPI_SINGLE_THREADED \
@@ -77,6 +78,7 @@ SRCS+= libefi.c utinit.c utglobal.c utresrc.c utlock.c utownerid.c \
7778
.PATH: ${SYSDIR}/contrib/dev/acpica/components/hardware
7879
.PATH: ${SYSDIR}/contrib/dev/acpica/components/events
7980
.PATH: ${SYSDIR}/contrib/dev/acpica/components/parser
81+
.endif # ACPICA
8082

8183
CFLAGS+= -I${.CURDIR}/../loader
8284
.if ${MK_LOADER_ZFS} != "no"

stand/efi/loader/main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
#include "actbl.h"
7171

7272
#include <init_acpi.h>
73+
#include <acpi_detect.h>
7374

7475
#include "loader_efi.h"
7576

@@ -1230,10 +1231,12 @@ main(int argc, CHAR16 *argv[])
12301231

12311232
devinit();
12321233

1234+
#if defined(__amd64__)
12331235
/* Initialize ACPI Subsystem and Tables. */
12341236
if ((ret = init_acpi()) != 0) {
12351237
printf("Failed to initialize ACPI\n.");
12361238
}
1239+
#endif
12371240

12381241
/*
12391242
* Detect console settings two different ways: one via the command

0 commit comments

Comments
 (0)