blob: a0a5d486240da353e8e275546cf9322388490832 [file] [log] [blame]
The Android Open Source Project1dc9e472009-03-03 19:28:35 -08001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 ****************************************************************************
11 ****************************************************************************/
12#ifndef IOPRIO_H
13#define IOPRIO_H
Ben Cheng4b29af02012-03-07 16:14:53 -080014
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080015#include <linux/sched.h>
Ben Cheng4b29af02012-03-07 16:14:53 -080016
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080017#define IOPRIO_BITS (16)
18#define IOPRIO_CLASS_SHIFT (13)
19#define IOPRIO_PRIO_MASK ((1UL << IOPRIO_CLASS_SHIFT) - 1)
Ben Cheng4b29af02012-03-07 16:14:53 -080020
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080021#define IOPRIO_PRIO_CLASS(mask) ((mask) >> IOPRIO_CLASS_SHIFT)
22#define IOPRIO_PRIO_DATA(mask) ((mask) & IOPRIO_PRIO_MASK)
23#define IOPRIO_PRIO_VALUE(class, data) (((class) << IOPRIO_CLASS_SHIFT) | data)
Ben Cheng4b29af02012-03-07 16:14:53 -080024
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080025#define ioprio_valid(mask) (IOPRIO_PRIO_CLASS((mask)) != IOPRIO_CLASS_NONE)
Ben Cheng4b29af02012-03-07 16:14:53 -080026
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080027enum {
28 IOPRIO_CLASS_NONE,
29 IOPRIO_CLASS_RT,
30 IOPRIO_CLASS_BE,
31 IOPRIO_CLASS_IDLE,
32};
Ben Cheng4b29af02012-03-07 16:14:53 -080033
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080034#define IOPRIO_BE_NR (8)
Ben Cheng4b29af02012-03-07 16:14:53 -080035
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080036enum {
37 IOPRIO_WHO_PROCESS = 1,
38 IOPRIO_WHO_PGRP,
39 IOPRIO_WHO_USER,
40};
Ben Cheng4b29af02012-03-07 16:14:53 -080041
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080042#define IOPRIO_NORM (4)
Ben Cheng4b29af02012-03-07 16:14:53 -080043
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080044#endif