Make some room among pipe request codes 19/254719/2
authorMichal Bloch <m.bloch@samsung.com>
Thu, 4 Mar 2021 23:25:13 +0000 (00:25 +0100)
committerMateusz Majewski <m.majewski2@samsung.com>
Fri, 12 Mar 2021 12:09:41 +0000 (13:09 +0100)
Peanut brain: encoding N values in N bits
Galaxy brain: encoding N values in log2(N) bits

We're pressured to do this because the request is
encoded as a char so we're running out of bits.

Change-Id: Ide0949886a67e92bb792e612ae0ef3e87f7331a0
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
include/logpipe.h

index 29f2e92..b578b6b 100644 (file)
 #define DLOG_CTRL_REQ_PIPE (struct dlog_control_msg) {sizeof(struct dlog_control_msg), DLOG_REQ_PIPE, 0}
 
 enum {
-       DLOG_REQ_REPLY          = 1 << 0,
+       DLOG_REQ_REPLY          = 1,
+
+       /* the following can be OR'd with REPLY,
+        * but are exclusive with each other */
        DLOG_REQ_PIPE           = 1 << 1,
-       DLOG_REQ_CLEAR          = 1 << 2,
-       DLOG_REQ_HANDLE_LOGUTIL = 1 << 3,
-       DLOG_REQ_GET_CAPACITY   = 1 << 4,
-       DLOG_REQ_GET_USAGE      = 1 << 5,
-       DLOG_REQ_STDOUT         = 1 << 6,
+       DLOG_REQ_CLEAR          = 2 << 1,
+       DLOG_REQ_HANDLE_LOGUTIL = 3 << 1,
+       DLOG_REQ_GET_CAPACITY   = 4 << 1,
+       DLOG_REQ_GET_USAGE      = 5 << 1,
+       DLOG_REQ_STDOUT         = 6 << 1,
 };
 
 enum {