bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH mig] header: add definitions for RPC presence and IDs


From: Luca Dariz
Subject: [PATCH mig] header: add definitions for RPC presence and IDs
Date: Sun, 5 Jan 2025 16:20:01 +0100

This allows to check at compilation time for some rpc (as done in
glibc for thread_set/get_name() and host_page_size()).
Also the IDs can be useful for testing purposes, or when assembling
messages manually.
---
 header.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/header.c b/header.c
index 8190376..3df04de 100644
--- a/header.c
+++ b/header.c
@@ -84,6 +84,11 @@ WriteUserRoutine(FILE *file, const routine_t *rt)
 {
     fprintf(file, "\n");
     fprintf(file, "/* %s %s */\n", rtRoutineKindToStr(rt->rtKind), rt->rtName);
+    fprintf(file, "#define MIG_RPC_HAVE_%s\n", rt->rtUserName);
+    fprintf(file, "#define MIG_RPC_REQUEST_ID_%s %d\n",
+            rt->rtUserName, rt->rtNumber + SubsystemBase);
+    fprintf(file, "#define MIG_RPC_REPLY_ID_%s %d\n",
+            rt->rtUserName, rt->rtNumber + SubsystemBase + 100);
     WriteMigExternal(file);
     fprintf(file, "%s %s\n", ReturnTypeStr(rt), rt->rtUserName);
     fprintf(file, "(\n");
@@ -139,6 +144,11 @@ WriteServerRoutine(FILE *file, const routine_t *rt)
 {
     fprintf(file, "\n");
     fprintf(file, "/* %s %s */\n", rtRoutineKindToStr(rt->rtKind), rt->rtName);
+    fprintf(file, "#define MIG_RPC_HAVE_%s\n", rt->rtServerName);
+    fprintf(file, "#define MIG_RPC_REQUEST_ID_%s %d\n",
+            rt->rtServerName, rt->rtNumber + SubsystemBase);
+    fprintf(file, "#define MIG_RPC_REPLY_ID_%s %d\n",
+            rt->rtServerName, rt->rtNumber + SubsystemBase + 100);
     WriteMigExternal(file);
     fprintf(file, "%s %s\n", ReturnTypeStr(rt), rt->rtServerName);
     fprintf(file, "(\n");
-- 
2.39.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]