aboutsummaryrefslogtreecommitdiff
path: root/sys/powerpc/include
diff options
context:
space:
mode:
Diffstat (limited to 'sys/powerpc/include')
-rw-r--r--sys/powerpc/include/atomic.h33
-rw-r--r--sys/powerpc/include/kexec.h38
-rw-r--r--sys/powerpc/include/openpicvar.h9
3 files changed, 73 insertions, 7 deletions
diff --git a/sys/powerpc/include/atomic.h b/sys/powerpc/include/atomic.h
index 015a283e2de7..b2d7549e5bd0 100644
--- a/sys/powerpc/include/atomic.h
+++ b/sys/powerpc/include/atomic.h
@@ -1137,7 +1137,38 @@ atomic_thread_fence_seq_cst(void)
#define atomic_cmpset_short atomic_cmpset_16
#define atomic_fcmpset_char atomic_fcmpset_8
#define atomic_fcmpset_short atomic_fcmpset_16
-#endif
+#define atomic_set_short atomic_set_16
+#define atomic_clear_short atomic_clear_16
+#else
+
+static __inline void
+atomic_set_short(volatile u_short *p, u_short bit)
+{
+ u_short v;
+
+ v = atomic_load_short(p);
+ for (;;) {
+ if (atomic_fcmpset_16(p, &v, v | bit))
+ break;
+ }
+}
+
+static __inline void
+atomic_clear_short(volatile u_short *p, u_short bit)
+{
+ u_short v;
+
+ v = atomic_load_short(p);
+ for (;;) {
+ if (atomic_fcmpset_16(p, &v, v & ~bit))
+ break;
+ }
+}
+
+#define atomic_set_16 atomic_set_short
+#define atomic_clear_16 atomic_clear_short
+
+#endif /* ISA_206_ATOMICS */
/* These need sys/_atomic_subword.h on non-ISA-2.06-atomic platforms. */
ATOMIC_CMPSET_ACQ_REL(char);
diff --git a/sys/powerpc/include/kexec.h b/sys/powerpc/include/kexec.h
new file mode 100644
index 000000000000..a57c50926696
--- /dev/null
+++ b/sys/powerpc/include/kexec.h
@@ -0,0 +1,38 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2025 Juniper Networks, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef _POWERPC_KEXEC_H_
+#define _POWERPC_KEXEC_H_
+
+int
+kexec_load_md(struct kexec_image *image)
+{
+ return (ENOSYS);
+}
+
+#define kexec_reboot_md(x) do {} while (0)
+#endif /* _POWERPC_KEXEC_H_ */
diff --git a/sys/powerpc/include/openpicvar.h b/sys/powerpc/include/openpicvar.h
index 3a170a8a35fe..12f01cb80406 100644
--- a/sys/powerpc/include/openpicvar.h
+++ b/sys/powerpc/include/openpicvar.h
@@ -28,6 +28,8 @@
#ifndef _POWERPC_OPENPICVAR_H_
#define _POWERPC_OPENPICVAR_H_
+#include <sys/kobj.h>
+
#define OPENPIC_DEVSTR "OpenPIC Interrupt Controller"
#define OPENPIC_IRQMAX 256 /* h/w allows more */
@@ -75,16 +77,11 @@ int openpic_common_attach(device_t, uint32_t);
/*
* PIC interface.
*/
-void openpic_bind(device_t dev, u_int irq, cpuset_t cpumask, void **);
void openpic_config(device_t, u_int, enum intr_trigger, enum intr_polarity);
-void openpic_dispatch(device_t, struct trapframe *);
void openpic_enable(device_t, u_int, u_int, void **);
void openpic_eoi(device_t, u_int, void *);
-void openpic_ipi(device_t, u_int);
-void openpic_mask(device_t, u_int, void *);
void openpic_unmask(device_t, u_int, void *);
-int openpic_suspend(device_t dev);
-int openpic_resume(device_t dev);
+DECLARE_CLASS(openpic_class);
#endif /* _POWERPC_OPENPICVAR_H_ */