direct-io.hg

view tools/domain_builder/mem_defs.h @ 204:0e45b167992d

bitkeeper revision 1.65 (3e536858YdNPGFSv3J35Fl8zAGLJjQ)

sched.h, xen_block.c, domain.c:
Now have per-domain IO completion queue.
author kaf24@labyrinth.cl.cam.ac.uk
date Wed Feb 19 11:19:52 2003 +0000 (2003-02-19)
parents 9713c0d10ee7
children
line source
1 /*
2 * memory related definitions needed for userspace domain builder dom0 application. these _need_ to
3 * be kept in sync with the kernel .h files they were copied over from or something horrible will
4 * happen. remmember: god kills a kitten every time you forget to keep these in sync.
5 *
6 * KAF: Boris, these constants are all fixed by x86 hardware. So the kittens are safe for now :-)
7 *
8 * Copyright 2002 by B Dragovic
9 */
11 /* copied over from hypervisor: include/asm-i386/page.h */
13 #define _PAGE_PRESENT 0x001
14 #define _PAGE_RW 0x002
15 #define _PAGE_USER 0x004
16 #define _PAGE_PWT 0x008
17 #define _PAGE_PCD 0x010
18 #define _PAGE_ACCESSED 0x020
19 #define _PAGE_DIRTY 0x040
20 #define _PAGE_PAT 0x080
21 #define _PAGE_PSE 0x080
22 #define _PAGE_GLOBAL 0x100
25 #define L1_PAGETABLE_SHIFT 12
26 #define L2_PAGETABLE_SHIFT 22
28 #define ENTRIES_PER_L1_PAGETABLE 1024
29 #define ENTRIES_PER_L2_PAGETABLE 1024
31 #define PAGE_SHIFT L1_PAGETABLE_SHIFT
32 #define PAGE_SIZE (1UL << PAGE_SHIFT)
33 #define PAGE_MASK (~(PAGE_SIZE-1))
35 typedef struct { unsigned long l1_lo; } l1_pgentry_t;
36 typedef struct { unsigned long l2_lo; } l2_pgentry_t;
38 #define l1_table_offset(_a) \
39 (((_a) >> L1_PAGETABLE_SHIFT) & (ENTRIES_PER_L1_PAGETABLE - 1))
40 #define l2_table_offset(_a) \
41 ((_a) >> L2_PAGETABLE_SHIFT)
43 /* local definitions */
45 #define nr_2_page(x) (x << PAGE_SHIFT)