blob: 52af512f5e7dcf272a73de968b709f900218e98d [file] [log] [blame]
Paolo 'Blaisorblade' Giarrussofbdf2162006-03-31 02:30:19 -08001/*
2 * Copyright (C) 2004 Fujitsu Siemens Computers GmbH
3 * Licensed under the GPL
4 *
5 * Author: Bodo Stroesser <bstroesser@fujitsu-siemens.com>
6 */
7
8#ifndef __ASM_LDT_H
9#define __ASM_LDT_H
10
Daniel Walker01ac8352008-02-04 22:31:26 -080011#include <linux/mutex.h>
Paolo 'Blaisorblade' Giarrussofbdf2162006-03-31 02:30:19 -080012#include "asm/host_ldt.h"
13
Paolo 'Blaisorblade' Giarrussofbdf2162006-03-31 02:30:19 -080014extern void ldt_host_info(void);
Paolo 'Blaisorblade' Giarrussofbdf2162006-03-31 02:30:19 -080015
16#define LDT_PAGES_MAX \
17 ((LDT_ENTRIES * LDT_ENTRY_SIZE)/PAGE_SIZE)
18#define LDT_ENTRIES_PER_PAGE \
19 (PAGE_SIZE/LDT_ENTRY_SIZE)
20#define LDT_DIRECT_ENTRIES \
21 ((LDT_PAGES_MAX*sizeof(void *))/LDT_ENTRY_SIZE)
22
23struct ldt_entry {
24 __u32 a;
25 __u32 b;
26};
27
28typedef struct uml_ldt {
29 int entry_count;
Daniel Walker01ac8352008-02-04 22:31:26 -080030 struct mutex lock;
Paolo 'Blaisorblade' Giarrussofbdf2162006-03-31 02:30:19 -080031 union {
32 struct ldt_entry * pages[LDT_PAGES_MAX];
33 struct ldt_entry entries[LDT_DIRECT_ENTRIES];
34 } u;
35} uml_ldt_t;
36
37#endif