1#ifndef __ASM_HOST_LDT_I386_H
2#define __ASM_HOST_LDT_I386_H
3
4#include "asm/arch/ldt.h"
5
6/*
7 * macros stolen from include/asm-i386/desc.h
8 */
9#define LDT_entry_a(info) \
10	((((info)->base_addr & 0x0000ffff) << 16) | ((info)->limit & 0x0ffff))
11
12#define LDT_entry_b(info) \
13	(((info)->base_addr & 0xff000000) | \
14	(((info)->base_addr & 0x00ff0000) >> 16) | \
15	((info)->limit & 0xf0000) | \
16	(((info)->read_exec_only ^ 1) << 9) | \
17	((info)->contents << 10) | \
18	(((info)->seg_not_present ^ 1) << 15) | \
19	((info)->seg_32bit << 22) | \
20	((info)->limit_in_pages << 23) | \
21	((info)->useable << 20) | \
22	0x7000)
23
24#define LDT_empty(info) (\
25	(info)->base_addr	== 0	&& \
26	(info)->limit		== 0	&& \
27	(info)->contents	== 0	&& \
28	(info)->read_exec_only	== 1	&& \
29	(info)->seg_32bit	== 0	&& \
30	(info)->limit_in_pages	== 0	&& \
31	(info)->seg_not_present	== 1	&& \
32	(info)->useable		== 0	)
33
34#endif
35