librtas/0001-librtas-expose-low-level-RTAS-call-APIs-internally.patch
Michal Suchanek 6320ffa20b Accepting request 1136886 from home:michals
- Add support for new rtas kernel interface for VPD and sysparm (jsc#PED-4541).
  * 0001-librtas-expose-low-level-RTAS-call-APIs-internally.patch
  * 0002-librtas-move-VPD-code-into-separate-module.patch
  * 0003-librtas-move-system-parameter-code-to-separate-modul.patch
  * 0004-librtas-vendor-papr-miscdev.h.patch
  * 0005-librtas-vpd-prefer-dev-papr-vpd-when-available.patch
  * 0006-librtas-sysparm-prefer-dev-papr-sysparm-when-availab.patch
  * link-lpthread.patch
  * tests: activate-firmware-regress vpdupdate-regress

OBS-URL: https://build.opensuse.org/request/show/1136886
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/librtas?expand=0&rev=67
2024-01-04 16:53:48 +00:00

80 lines
2.7 KiB
Diff

From 0d48bdca32cbf7a83bcaa5a27e3454d24055e0cb Mon Sep 17 00:00:00 2001
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>
---
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;
--
2.42.0