[SLOF] [PATCH v5 1/7] slof: Implement SLOF_get_keystroke() and SLOF_reset()
Stefan Berger
stefanb at linux.ibm.com
Sat Jan 11 12:21:49 AEDT 2020
Implement SLOF_get_keystroke() and SLOF_reset() helper functions.
Signed-off-by: Stefan Berger <stefanb at linux.ibm.com>
---
include/helpers.h | 2 ++
slof/helpers.c | 11 +++++++++++
2 files changed, 13 insertions(+)
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");
+}
--
2.17.1
More information about the SLOF
mailing list