diff mbox series

[v5,1/7] slof: Implement SLOF_get_keystroke() and SLOF_reset()

Message ID 20200111012155.3350198-2-stefanb@linux.ibm.com
State Superseded
Headers show
Series Add vTPM 2.0 support to SLOF | expand

Commit Message

Stefan Berger Jan. 11, 2020, 1:21 a.m. UTC
Implement SLOF_get_keystroke() and SLOF_reset() helper functions.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
---
 include/helpers.h |  2 ++
 slof/helpers.c    | 11 +++++++++++
 2 files changed, 13 insertions(+)
diff mbox series

Patch

diff --git a/include/helpers.h b/include/helpers.h
index 5834bce..9a06a5c 100644
--- a/include/helpers.h
+++ b/include/helpers.h
@@ -42,6 +42,8 @@  extern void SLOF_encode_bootp_response(void *addr, size_t size);
 extern void SLOF_encode_dhcp_response(void *addr, size_t size);
 extern int SLOF_get_property(const char *node, const char *propname,
                              char **addr, int *len);
+extern int SLOF_get_keystroke(void);
+extern void SLOF_reset(void);
 
 #define offset_of(type, member) ((long) &((type *)0)->member)
 #define container_of(ptr, type, member) ({                      \
diff --git a/slof/helpers.c b/slof/helpers.c
index dfb0c13..9d37bc3 100644
--- a/slof/helpers.c
+++ b/slof/helpers.c
@@ -224,3 +224,14 @@  int SLOF_get_property(const char *node, const char *propname,
 	*addr = (char *)forth_pop();
 	return 0;
 }
+
+int SLOF_get_keystroke(void)
+{
+	forth_eval("key");
+	return forth_pop();
+}
+
+void SLOF_reset(void)
+{
+	forth_eval("reset-all");
+}