blob: ac4b5a5b35e0406c16c20cfd38d1bb63c6414642 [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 ***
Ben Cheng94a85f62012-03-06 15:45:52 -080010 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080017 ****************************************************************************
18 ****************************************************************************/
19#ifndef _LINUX_RBTREE_H
20#define _LINUX_RBTREE_H
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080021#include <linux/kernel.h>
22#include <linux/stddef.h>
Ben Cheng94a85f62012-03-06 15:45:52 -080023/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080024struct rb_node
25{
26 unsigned long rb_parent_color;
27#define RB_RED 0
Ben Cheng94a85f62012-03-06 15:45:52 -080028/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080029#define RB_BLACK 1
30 struct rb_node *rb_right;
31 struct rb_node *rb_left;
32} __attribute__((aligned(sizeof(long))));
Ben Cheng94a85f62012-03-06 15:45:52 -080033/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080034struct rb_root
35{
36 struct rb_node *rb_node;
37};
Ben Cheng94a85f62012-03-06 15:45:52 -080038/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080039#define rb_parent(r) ((struct rb_node *)((r)->rb_parent_color & ~3))
40#define rb_color(r) ((r)->rb_parent_color & 1)
41#define rb_is_red(r) (!rb_color(r))
42#define rb_is_black(r) rb_color(r)
Ben Cheng94a85f62012-03-06 15:45:52 -080043/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080044#define rb_set_red(r) do { (r)->rb_parent_color &= ~1; } while (0)
45#define rb_set_black(r) do { (r)->rb_parent_color |= 1; } while (0)
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080046#define RB_ROOT (struct rb_root) { NULL, }
47#define rb_entry(ptr, type, member) container_of(ptr, type, member)
Ben Cheng94a85f62012-03-06 15:45:52 -080048/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080049#define RB_EMPTY_ROOT(root) ((root)->rb_node == NULL)
50#define RB_EMPTY_NODE(node) (rb_parent(node) != node)
51#define RB_CLEAR_NODE(node) (rb_set_parent(node, node))
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080052#endif
Ben Cheng94a85f62012-03-06 15:45:52 -080053/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */