4 IOPRIO_WHO_PROCESS = 1,
9 #include "xlat/ioprio_who.h"
18 #include "xlat/ioprio_class.h"
20 #define IOPRIO_CLASS_SHIFT (13)
21 #define IOPRIO_PRIO_MASK ((1ul << IOPRIO_CLASS_SHIFT) - 1)
23 #define IOPRIO_PRIO_CLASS(mask) ((mask) >> IOPRIO_CLASS_SHIFT)
24 #define IOPRIO_PRIO_DATA(mask) ((mask) & IOPRIO_PRIO_MASK)
27 sprint_ioprio(int ioprio)
29 static char outstr[256];
33 class = IOPRIO_PRIO_CLASS(ioprio);
34 data = IOPRIO_PRIO_DATA(ioprio);
35 str = xlookup(ioprio_class, class);
37 sprintf(outstr, "IOPRIO_PRIO_VALUE(%s,%d)", str, data);
39 sprintf(outstr, "IOPRIO_PRIO_VALUE(%#x /* %s */,%d)",
40 class, "IOPRIO_CLASS_???", data);
46 sys_ioprio_get(struct tcb *tcp)
50 printxval(ioprio_who, tcp->u_arg[0], "IOPRIO_WHO_???");
52 tprintf(", %d", (int) tcp->u_arg[1]);
58 tcp->auxstr = sprint_ioprio(tcp->u_rval);
64 sys_ioprio_set(struct tcb *tcp)
68 printxval(ioprio_who, tcp->u_arg[0], "IOPRIO_WHO_???");
70 tprintf(", %d, ", (int) tcp->u_arg[1]);
72 tprints(sprint_ioprio(tcp->u_arg[2]));