libpldm: Explicit deprecated, stable and testing ABI classes

Experimenting with new APIs is important, but ABI stability of the
library is also important. We wish to have the freedom to add APIs
without being burdened by them being immediately set in stone.

We implement this wish by introducing three classes of ABI:

1. deprecated
2. stable
3. testing

These are enforced by corresponding function attributes:

1. LIBPLDM_ABI_DEPRECATED
2. LIBPLDM_ABI_STABLE
3. LIBPLDM_ABI_TESTING

Symbol visibility in the library is flipped to 'hidden' by default, so
one of these annotations must be used for the symbol to be exposed.

With these classes in place there are now clear points in time at which
we update the ABI dumps captured under the abi/ directory: When an API
is migrated from the 'testing' class to the 'stable' class, or when
removed from the 'deprecated' class.

Which classes of functions are exposed by the build is controlled by the
new 'abi' meson option. The option is of array type which contains the
list of ABI classes the build should consider. It defaults to enabling
all classes to provide test coverage in CI. The classes used should be
constrained to deprecated and stable (and not test) in any dependent
projects.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I25402e20c7be9c9f264f9ccd7ac36b384823734c
diff --git a/src/transport/af-mctp.c b/src/transport/af-mctp.c
index f499a72..5084f7d 100644
--- a/src/transport/af-mctp.c
+++ b/src/transport/af-mctp.c
@@ -1,4 +1,5 @@
-#include "../mctp-defines.h"
+#include "config.h"
+#include "mctp-defines.h"
 #include "base.h"
 #include "container-of.h"
 #include "libpldm/pldm.h"
@@ -25,12 +26,14 @@
 #define transport_to_af_mctp(ptr)                                              \
 	container_of(ptr, struct pldm_transport_af_mctp, transport)
 
+LIBPLDM_ABI_TESTING
 struct pldm_transport *
 pldm_transport_af_mctp_core(struct pldm_transport_af_mctp *ctx)
 {
 	return &ctx->transport;
 }
 
+LIBPLDM_ABI_TESTING
 int pldm_transport_af_mctp_init_pollfd(struct pldm_transport *t,
 				       struct pollfd *pollfd)
 {
@@ -54,6 +57,7 @@
 	return -1;
 }
 
+LIBPLDM_ABI_TESTING
 int pldm_transport_af_mctp_map_tid(struct pldm_transport_af_mctp *ctx,
 				   pldm_tid_t tid, mctp_eid_t eid)
 {
@@ -62,6 +66,7 @@
 	return 0;
 }
 
+LIBPLDM_ABI_TESTING
 int pldm_transport_af_mctp_unmap_tid(struct pldm_transport_af_mctp *ctx,
 				     __attribute__((unused)) pldm_tid_t tid,
 				     mctp_eid_t eid)
@@ -122,6 +127,7 @@
 	return PLDM_REQUESTER_SUCCESS;
 }
 
+LIBPLDM_ABI_TESTING
 int pldm_transport_af_mctp_init(struct pldm_transport_af_mctp **ctx)
 {
 	if (!ctx || *ctx) {
@@ -147,6 +153,7 @@
 	return 0;
 }
 
+LIBPLDM_ABI_TESTING
 void pldm_transport_af_mctp_destroy(struct pldm_transport_af_mctp *ctx)
 {
 	if (!ctx) {