Skip to contentSkip to conversation

Where is <mercury/wrappers.h>?

DISCUSSION [email protected] 3 participants 4 messages Feb 15, 2021

lore
Share & tools
lore
#0 lore raw

Hi all,

I'm currently inspecting the code base regarding Y2038 problem (= overflow of 32 bit time_t in January 2038) and trying to list / summarize all affected APIs / drivers / ...

In include/copperplate/wrappers.h we have:
#include <mercury/wrappers.h>

I guess this is broken since
1fbf0f398064 ("lib/boilerplate: introduce ancillary service layer"). Right?

Background:
I'm trying to find the right expansion for __RT() used by the alchemy library, e.g. in lib/alchemy/pipe.c. I found two possibilities so far:

- include/cobalt/wrappers.h
- include/mercury/boilerplate/wrappers.h

Which one is being used by the alchemy library? I was not able to find my way through all the include directories and include paths...

Best regards,
Florian

Signature · 2 lines
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux
#1 lore raw
Quoted 6 lines · florian.bezdeka--- via Xenomai

Hi all,

I'm currently inspecting the code base regarding Y2038 problem (= overflow of 32 bit time_t in January 2038) and trying to list / summarize all affected APIs / drivers / ...

Quoted 6 lines

In include/copperplate/wrappers.h we have:
#include <mercury/wrappers.h>

I guess this is broken since
1fbf0f398064 ("lib/boilerplate: introduce ancillary service layer"). Right?

Sorry, -ENOPARSE. What may be broken?

Quoted 11 lines

Background:
I'm trying to find the right expansion for __RT() used by the alchemy library, e.g. in lib/alchemy/pipe.c. I found two possibilities so far:

- include/cobalt/wrappers.h
- include/mercury/boilerplate/wrappers.h

Which one is being used by the alchemy library? I was not able to find my way through all the include directories and include paths...

If you build for Mercury, libcobalt is not involved, Alchemy and other non-POSIX APIs are built on top of libcopperplate -> *libc directly. This is merely a native build for prototyping, or running the APIs on top of PREEMPT_RT. So in this case, __RT() and __STD() expand to:

#define __RT(call) call
#define __STD(call) call

meaning, we don't route the call to libcobalt but to the regular *libc. This is defined in include/mercury/boilerplate/wrappers.h.

So, for a Cobalt-based build:

    include/copperplate/wrappers.h -> include/cobalt/boilerplate/wrappers.h.

For a Mercury build:

    include/copperplate/wrappers.h -> include/mercury/boilerplate/wrappers.h.
Signature · 1 line
Philippe.
#2 lore raw
Quoted 8 lines · Philippe Gerum
Quoted 6 lines · florian.bezdeka--- via Xenomai

Hi all,

I'm currently inspecting the code base regarding Y2038 problem (= overflow of 32 bit time_t in January 2038) and trying to list / summarize all affected APIs / drivers / ...

Quoted 8 lines
Quoted 6 lines

In include/copperplate/wrappers.h we have:
#include <mercury/wrappers.h>

I guess this is broken since
1fbf0f398064 ("lib/boilerplate: introduce ancillary service layer"). Right?

Sorry, -ENOPARSE. What may be broken?

See below...

Quoted 18 lines
Quoted 6 lines

Background:
I'm trying to find the right expansion for __RT() used by the alchemy library, e.g. in lib/alchemy/pipe.c. I found two possibilities so far:

Quoted 6 lines

- include/cobalt/wrappers.h
- include/mercury/boilerplate/wrappers.h

Which one is being used by the alchemy library? I was not able to find my way through all the include directories and include paths...

If you build for Mercury, libcobalt is not involved, Alchemy and other non-POSIX APIs are built on top of libcopperplate -> *libc directly. This is merely a native build for prototyping, or running the APIs on top of PREEMPT_RT. So in this case, __RT() and __STD() expand to:

Quoted 5 lines

#define __RT(call) call
#define __STD(call) call

meaning, we don't route the call to libcobalt but to the regular *libc. This is defined in include/mercury/boilerplate/wrappers.h.

Thanks for the explanation. IOTW: No (libc) symbol wrapping in case of building for mercury.

I assume the selection which wrappers.h is being used is done in include/copperplate/wrappers.h, but I'm unable to find a usage of that header...

Quoted 8 lines

So, for a Cobalt-based build:

    include/copperplate/wrappers.h -> include/cobalt/boilerplate/wrappers.h.

For a Mercury build:

    include/copperplate/wrappers.h -> include/mercury/boilerplate/wrappers.h.

include/copperplate/wrappers.h has
#include <mercury/wrappers.h>

but there is no <mercury/wrappers.h>. As you said it should be #include <mercury/boilerplate/wrappers.h>

The commit mentioned above moved the file from include/mercury/wrappers.h to include/mercury/boilerplate/wrappers.h

#3 lore raw
In reply to [email protected]
Quoted 6 lines · Florian (T RDA IOT SES-DE)

Hi all,

I'm currently inspecting the code base regarding Y2038 problem (= overflow of 32 bit time_t in January 2038) and trying to list / summarize all affected APIs / drivers / ...

Quoted 7 lines

In include/copperplate/wrappers.h we have:
#include <mercury/wrappers.h>

I guess this is broken since
1fbf0f398064 ("lib/boilerplate: introduce ancillary service layer"). Right?

I would rather blame f058f3c2c12fa882e97aed931416c8a34e389767 here.

include/copperplate/wrapper.h, seems like dead code. It's not used in- tree, and if someone tried it out-of-tree, we would have received complaints over the past 8 years.

Quoted 5 lines

Background:
I'm trying to find the right expansion for __RT() used by the alchemy library, e.g. in lib/alchemy/pipe.c. I found two possibilities so far:

- include/cobalt/wrappers.h

This one is in use, for cobalt.

Quoted 1 line

- include/mercury/boilerplate/wrappers.h

This one contains what is expected by include/copperplate/wrappers.h.

Quoted 4 lines

Which one is being used by the alchemy library? I was not able to find my way through all the include directories and include paths...

Thanks for reporting. I suspect the quick fix would be

include/copperplate/wrappers.h +1 -1
index a7c68f5cb8..06b94b5e4c 100644
@@ -24,7 +24,7 @@
 #ifdef CONFIG_XENO_COBALT
 #include <cobalt/wrappers.h>
 #else /* CONFIG_XENO_MERCURY */
-#include <mercury/wrappers.h>
+#include <mercury/boilerplate/wrappers.h>
 #endif /* CONFIG_XENO_MERCURY */
 
 #endif /* _COPPERPLATE_WRAPPERS_H */

But that won't change the fact that this header is likely unused, thus untested.

Jan

Signature · 2 lines
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux