blob: bf6de4ad3d93cd0ab5552235b82aceeed4b7ceb4 [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 __ARCH_DESC_DEFS_H
13#define __ARCH_DESC_DEFS_H
14
15#ifndef __ASSEMBLY__
16
17#include <linux/types.h>
18
19struct desc_struct {
20 u16 limit0;
21 u16 base0;
22 unsigned base1 : 8, type : 4, s : 1, dpl : 2, p : 1;
23 unsigned limit : 4, avl : 1, l : 1, d : 1, g : 1, base2 : 8;
24} __attribute__((packed));
25
26struct n_desc_struct {
27 unsigned int a,b;
28};
29
30enum {
31 GATE_INTERRUPT = 0xE,
32 GATE_TRAP = 0xF,
33 GATE_CALL = 0xC,
34};
35
36struct gate_struct {
37 u16 offset_low;
38 u16 segment;
39 unsigned ist : 3, zero0 : 5, type : 5, dpl : 2, p : 1;
40 u16 offset_middle;
41 u32 offset_high;
42 u32 zero1;
43} __attribute__((packed));
44
45#define PTR_LOW(x) ((unsigned long)(x) & 0xFFFF)
46#define PTR_MIDDLE(x) (((unsigned long)(x) >> 16) & 0xFFFF)
47#define PTR_HIGH(x) ((unsigned long)(x) >> 32)
48
49enum {
50 DESC_TSS = 0x9,
51 DESC_LDT = 0x2,
52};
53
54struct ldttss_desc {
55 u16 limit0;
56 u16 base0;
57 unsigned base1 : 8, type : 5, dpl : 2, p : 1;
58 unsigned limit1 : 4, zero0 : 3, g : 1, base2 : 8;
59 u32 base3;
60 u32 zero1;
61} __attribute__((packed));
62
63struct desc_ptr {
64 unsigned short size;
65 unsigned long address;
66} __attribute__((packed)) ;
67
68#endif
69
70#endif