summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2022-07-27 20:26:18 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2022-07-27 20:26:18 +0000
commit0de89a441c85f5ae679700beadbf5fe096998368 (patch)
tree831b8f0ed30e4a1963218f0c4954613894de7028 /sys/arch
parentcc0510965190e09229359319e7fea3eff1612eba (diff)
Support "empty" phandles in interrups-extended properties. This is needed
to support the device tree binding for the "apple,admac" controller. ok visa@, patrick@
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/arm64/arm64/intr.c9
-rw-r--r--sys/arch/armv7/armv7/intr.c9
-rw-r--r--sys/arch/powerpc64/powerpc64/intr.c9
-rw-r--r--sys/arch/riscv64/riscv64/intr.c9
4 files changed, 32 insertions, 4 deletions
diff --git a/sys/arch/arm64/arm64/intr.c b/sys/arch/arm64/arm64/intr.c
index e3e8d46d552..886ce8776f9 100644
--- a/sys/arch/arm64/arm64/intr.c
+++ b/sys/arch/arm64/arm64/intr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.c,v 1.24 2022/01/02 01:01:04 jsg Exp $ */
+/* $OpenBSD: intr.c,v 1.25 2022/07/27 20:26:17 kettenis Exp $ */
/*
* Copyright (c) 2011 Dale Rahn <drahn@openbsd.org>
*
@@ -377,6 +377,13 @@ arm_intr_establish_fdt_idx_cpu(int node, int idx, int level, struct cpu_info *ci
if (extended) {
phandle = cell[0];
+ /* Handle "empty" phandle reference. */
+ if (phandle == 0) {
+ cell++;
+ ncells--;
+ continue;
+ }
+
LIST_FOREACH(ic, &interrupt_controllers, ic_list) {
if (ic->ic_phandle == phandle)
break;
diff --git a/sys/arch/armv7/armv7/intr.c b/sys/arch/armv7/armv7/intr.c
index c0816da3d83..96bf04bbf4b 100644
--- a/sys/arch/armv7/armv7/intr.c
+++ b/sys/arch/armv7/armv7/intr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.c,v 1.20 2022/01/02 01:01:04 jsg Exp $ */
+/* $OpenBSD: intr.c,v 1.21 2022/07/27 20:26:17 kettenis Exp $ */
/*
* Copyright (c) 2011 Dale Rahn <drahn@openbsd.org>
*
@@ -366,6 +366,13 @@ arm_intr_establish_fdt_idx_cpu(int node, int idx, int level, struct cpu_info *ci
if (extended) {
phandle = cell[0];
+ /* Handle "empty" phandle reference. */
+ if (phandle == 0) {
+ cell++;
+ ncells--;
+ continue;
+ }
+
LIST_FOREACH(ic, &interrupt_controllers, ic_list) {
if (ic->ic_phandle == phandle)
break;
diff --git a/sys/arch/powerpc64/powerpc64/intr.c b/sys/arch/powerpc64/powerpc64/intr.c
index d2658a8176c..ebcf4ef7ba8 100644
--- a/sys/arch/powerpc64/powerpc64/intr.c
+++ b/sys/arch/powerpc64/powerpc64/intr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.c,v 1.9 2020/09/26 17:56:54 kettenis Exp $ */
+/* $OpenBSD: intr.c,v 1.10 2022/07/27 20:26:17 kettenis Exp $ */
/*
* Copyright (c) 2020 Mark Kettenis <kettenis@openbsd.org>
@@ -281,6 +281,13 @@ fdt_intr_establish_idx_cpu(int node, int idx, int level, struct cpu_info *ci,
if (extended) {
phandle = cell[0];
+ /* Handle "empty" phandle reference. */
+ if (phandle == 0) {
+ cell++;
+ ncells--;
+ continue;
+ }
+
LIST_FOREACH(ic, &interrupt_controllers, ic_list) {
if (ic->ic_phandle == phandle)
break;
diff --git a/sys/arch/riscv64/riscv64/intr.c b/sys/arch/riscv64/riscv64/intr.c
index 9fbba867cc2..a5263e70099 100644
--- a/sys/arch/riscv64/riscv64/intr.c
+++ b/sys/arch/riscv64/riscv64/intr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.c,v 1.9 2022/01/02 01:01:04 jsg Exp $ */
+/* $OpenBSD: intr.c,v 1.10 2022/07/27 20:26:17 kettenis Exp $ */
/*
* Copyright (c) 2011 Dale Rahn <drahn@openbsd.org>
@@ -359,6 +359,13 @@ riscv_intr_establish_fdt_idx_cpu(int node, int idx, int level,
if (extended) {
phandle = cell[0];
+ /* Handle "empty" phandle reference. */
+ if (phandle == 0) {
+ cell++;
+ ncells--;
+ continue;
+ }
+
LIST_FOREACH(ic, &interrupt_controllers, ic_list) {
if (ic->ic_phandle == phandle)
break;