2024-02-01 09:49:01 +01:00
|
|
|
From 569da8e5f0d5009694dc2def350cb9cd2c1d81a6 Mon Sep 17 00:00:00 2001
|
2024-01-04 17:53:48 +01:00
|
|
|
From: Nathan Lynch <nathanl@linux.ibm.com>
|
|
|
|
Date: Sat, 12 Aug 2023 12:41:36 -0500
|
|
|
|
Subject: [PATCH 1/6] librtas: expose low-level RTAS call APIs internally
|
|
|
|
|
|
|
|
Make these functions available outside of syscall_calls.c, marking
|
|
|
|
them hidden so that they aren't exposed in the library ABI.
|
|
|
|
|
|
|
|
The implementations of librtas APIs will move into separate C files as
|
|
|
|
they gain support for new interfaces offered by the kernel.
|
|
|
|
|
|
|
|
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
|
2024-02-01 09:49:01 +01:00
|
|
|
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
|
2024-01-04 17:53:48 +01:00
|
|
|
---
|
|
|
|
librtas_src/internal.h | 5 +++++
|
|
|
|
librtas_src/syscall_calls.c | 11 ++++++-----
|
|
|
|
2 files changed, 11 insertions(+), 5 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/librtas_src/internal.h b/librtas_src/internal.h
|
|
|
|
index 3b6ba88..97411d3 100644
|
|
|
|
--- a/librtas_src/internal.h
|
|
|
|
+++ b/librtas_src/internal.h
|
|
|
|
@@ -52,6 +52,11 @@ int read_entire_file(int fd, char **buf, size_t *len);
|
|
|
|
int rtas_token(const char *call_name);
|
|
|
|
int sanity_check(void);
|
|
|
|
|
|
|
|
+#define CALL_AGAIN 1
|
|
|
|
+unsigned int handle_delay(int status, uint64_t * elapsed);
|
|
|
|
+int rtas_call_no_delay(const char *name, int ninputs, int nrets, ...);
|
|
|
|
+int rtas_call(const char *name, int ninputs, int nrets, ...);
|
|
|
|
+
|
|
|
|
#define BITS32_LO(_num) (uint32_t) (_num & 0xffffffffll)
|
|
|
|
#define BITS32_HI(_num) (uint32_t) (_num >> 32)
|
|
|
|
#define BITS64(_high, _low) (uint64_t) (((uint64_t) _high << 32) | _low)
|
|
|
|
diff --git a/librtas_src/syscall_calls.c b/librtas_src/syscall_calls.c
|
|
|
|
index 1e09217..eabc5ea 100644
|
|
|
|
--- a/librtas_src/syscall_calls.c
|
|
|
|
+++ b/librtas_src/syscall_calls.c
|
|
|
|
@@ -32,8 +32,6 @@
|
|
|
|
#include "internal.h"
|
|
|
|
#include "librtas.h"
|
|
|
|
|
|
|
|
-#define CALL_AGAIN 1
|
|
|
|
-
|
|
|
|
int dbg_lvl = 0;
|
|
|
|
static uint64_t rtas_timeout_ms;
|
|
|
|
|
|
|
|
@@ -65,7 +63,8 @@ int sanity_check(void)
|
|
|
|
* CALL_AGAIN if the status is delay related
|
|
|
|
* RTAS_TIMEOUT if the requested timeout has been exceeded
|
|
|
|
*/
|
|
|
|
-static unsigned int handle_delay(int status, uint64_t * elapsed)
|
|
|
|
+__attribute__((visibility("hidden")))
|
|
|
|
+unsigned int handle_delay(int status, uint64_t * elapsed)
|
|
|
|
{
|
|
|
|
int order = status - EXTENDED_DELAY_MIN;
|
|
|
|
unsigned long ms = 0;
|
|
|
|
@@ -213,7 +212,8 @@ static int _rtas_call(int delay_handling, int token, int ninputs,
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static int rtas_call_no_delay(const char *name, int ninputs, int nrets, ...)
|
|
|
|
+__attribute__((visibility("hidden")))
|
|
|
|
+int rtas_call_no_delay(const char *name, int ninputs, int nrets, ...)
|
|
|
|
{
|
|
|
|
va_list ap;
|
|
|
|
int rc, token;
|
|
|
|
@@ -229,7 +229,8 @@ static int rtas_call_no_delay(const char *name, int ninputs, int nrets, ...)
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static int rtas_call(const char *name, int ninputs, int nrets, ...)
|
|
|
|
+__attribute__((visibility("hidden")))
|
|
|
|
+int rtas_call(const char *name, int ninputs, int nrets, ...)
|
|
|
|
{
|
|
|
|
va_list ap;
|
|
|
|
int rc, token;
|
|
|
|
--
|
2024-02-01 09:49:01 +01:00
|
|
|
2.43.0
|
2024-01-04 17:53:48 +01:00
|
|
|
|