summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2020-06-10 14:33:30 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2020-06-10 14:33:30 +0000
commitd8717991b38b605324fd22ee7221d9cef608acdf (patch)
tree6055a5fc98a7a4156e69f2940aa9436a450408cd
parent9bb7b1d63972492787c085e0cac82788ae0bde36 (diff)
Add RTC read and write calls.
-rw-r--r--sys/arch/powerpc64/include/opal.h6
-rw-r--r--sys/arch/powerpc64/powerpc64/locore.S4
2 files changed, 8 insertions, 2 deletions
diff --git a/sys/arch/powerpc64/include/opal.h b/sys/arch/powerpc64/include/opal.h
index eb4a6eaac81..51a111977d4 100644
--- a/sys/arch/powerpc64/include/opal.h
+++ b/sys/arch/powerpc64/include/opal.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: opal.h,v 1.5 2020/06/08 18:35:10 kettenis Exp $ */
+/* $OpenBSD: opal.h,v 1.6 2020/06/10 14:33:29 kettenis Exp $ */
/*
* Copyright (c) 2020 Mark Kettenis <kettenis@openbsd.org>
@@ -23,6 +23,8 @@
#define OPAL_TEST 0
#define OPAL_CONSOLE_WRITE 1
#define OPAL_CONSOLE_READ 2
+#define OPAL_RTC_READ 3
+#define OPAL_RTC_WRITE 4
#define OPAL_CEC_POWER_DOWN 5
#define OPAL_CEC_REBOOT 6
#define OPAL_POLL_EVENTS 10
@@ -91,6 +93,8 @@
int64_t opal_test(uint64_t);
int64_t opal_console_write(int64_t, int64_t *, const uint8_t *);
int64_t opal_console_read(int64_t, int64_t *, uint8_t *);
+int64_t opal_rtc_read(uint32_t *, uint64_t *);
+int64_t opal_rtc_write(uint32_t, uint64_t);
int64_t opal_cec_power_down(uint64_t);
int64_t opal_cec_reboot(void);
int64_t opal_poll_events(uint64_t *);
diff --git a/sys/arch/powerpc64/powerpc64/locore.S b/sys/arch/powerpc64/powerpc64/locore.S
index 1a2edb5c126..533ef4e2392 100644
--- a/sys/arch/powerpc64/powerpc64/locore.S
+++ b/sys/arch/powerpc64/powerpc64/locore.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.S,v 1.7 2020/06/08 18:35:10 kettenis Exp $ */
+/* $OpenBSD: locore.S,v 1.8 2020/06/10 14:33:29 kettenis Exp $ */
/*
* Copyright (c) 2020 Mark Kettenis <kettenis@openbsd.org>
@@ -81,6 +81,8 @@ name: \
OPAL_CALL(OPAL_TEST, opal_test)
OPAL_CALL(OPAL_CONSOLE_WRITE, opal_console_write)
OPAL_CALL(OPAL_CONSOLE_READ, opal_console_read)
+OPAL_CALL(OPAL_RTC_READ, opal_rtc_read)
+OPAL_CALL(OPAL_RTC_WRITE, opal_rtc_write)
OPAL_CALL(OPAL_CEC_POWER_DOWN, opal_cec_power_down)
OPAL_CALL(OPAL_CEC_REBOOT, opal_cec_reboot)
OPAL_CALL(OPAL_POLL_EVENTS, opal_poll_events)