ldt.h 901 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Copyright (C) 2004 Fujitsu Siemens Computers GmbH
  3. * Licensed under the GPL
  4. *
  5. * Author: Bodo Stroesser <bstroesser@fujitsu-siemens.com>
  6. */
  7. #ifndef __ASM_LDT_H
  8. #define __ASM_LDT_H
  9. #include "asm/semaphore.h"
  10. #include "asm/host_ldt.h"
  11. struct mmu_context_skas;
  12. extern void ldt_host_info(void);
  13. extern long init_new_ldt(struct mmu_context_skas * to_mm,
  14. struct mmu_context_skas * from_mm);
  15. extern void free_ldt(struct mmu_context_skas * mm);
  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. struct ldt_entry {
  23. __u32 a;
  24. __u32 b;
  25. };
  26. typedef struct uml_ldt {
  27. int entry_count;
  28. struct semaphore semaphore;
  29. union {
  30. struct ldt_entry * pages[LDT_PAGES_MAX];
  31. struct ldt_entry entries[LDT_DIRECT_ENTRIES];
  32. } u;
  33. } uml_ldt_t;
  34. #endif