4 IOPRIO_WHO_PROCESS = 1,
9 static const struct xlat ioprio_who[] = {
10 XLAT(IOPRIO_WHO_PROCESS),
11 XLAT(IOPRIO_WHO_PGRP),
12 XLAT(IOPRIO_WHO_USER),
23 static const struct xlat ioprio_class[] = {
24 XLAT(IOPRIO_CLASS_NONE),
25 XLAT(IOPRIO_CLASS_RT),
26 XLAT(IOPRIO_CLASS_BE),
27 XLAT(IOPRIO_CLASS_IDLE),
31 #define IOPRIO_CLASS_SHIFT (13)
32 #define IOPRIO_PRIO_MASK ((1ul << IOPRIO_CLASS_SHIFT) - 1)
34 #define IOPRIO_PRIO_CLASS(mask) ((mask) >> IOPRIO_CLASS_SHIFT)
35 #define IOPRIO_PRIO_DATA(mask) ((mask) & IOPRIO_PRIO_MASK)
38 sprint_ioprio(int ioprio)
40 static char outstr[256];
44 class = IOPRIO_PRIO_CLASS(ioprio);
45 data = IOPRIO_PRIO_DATA(ioprio);
46 str = xlookup(ioprio_class, class);
48 sprintf(outstr, "IOPRIO_PRIO_VALUE(%s,%d)", str, data);
50 sprintf(outstr, "IOPRIO_PRIO_VALUE(%#x /* %s */,%d)",
51 class, "IOPRIO_CLASS_???", data);
57 sys_ioprio_get(struct tcb *tcp)
61 printxval(ioprio_who, tcp->u_arg[0], "IOPRIO_WHO_???");
63 tprintf(", %d", (int) tcp->u_arg[1]);
69 tcp->auxstr = sprint_ioprio(tcp->u_rval);
75 sys_ioprio_set(struct tcb *tcp)
79 printxval(ioprio_who, tcp->u_arg[0], "IOPRIO_WHO_???");
81 tprintf(", %d, ", (int) tcp->u_arg[1]);
83 tprints(sprint_ioprio(tcp->u_arg[2]));