diff options
author | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2006-04-14 14:54:46 +0100 |
---|---|---|
committer | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2006-04-14 14:54:46 +0100 |
commit | 813669dd41fca8ea6b985d6e930815af7e937fef (patch) | |
tree | 1672b02dfafd7fd4345d32873b8de30c332cbe70 /xen/include/xen/grant_table.h | |
parent | 8965df86b53f8045440694fa057d2952c7952bcf (diff) | |
download | xen-813669dd41fca8ea6b985d6e930815af7e937fef.tar.gz xen-813669dd41fca8ea6b985d6e930815af7e937fef.tar.bz2 xen-813669dd41fca8ea6b985d6e930815af7e937fef.zip |
Replace grant-table typedefs with explicit structs.
Reduce MAPTRACK_MAX_ENTRIES to something plausible.
Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'xen/include/xen/grant_table.h')
-rw-r--r-- | xen/include/xen/grant_table.h | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/xen/include/xen/grant_table.h b/xen/include/xen/grant_table.h index 65a1c67802..9fc63a0cbb 100644 --- a/xen/include/xen/grant_table.h +++ b/xen/include/xen/grant_table.h @@ -29,11 +29,11 @@ #include <asm/grant_table.h> /* Active grant entry - used for shadowing GTF_permit_access grants. */ -typedef struct { +struct active_grant_entry { u32 pin; /* Reference count information. */ domid_t domid; /* Domain being granted access. */ unsigned long frame; /* Frame being granted. */ -} active_grant_entry_t; +}; /* Count of writable host-CPU mappings. */ #define GNTPIN_hstw_shift (0) @@ -60,29 +60,30 @@ typedef struct { * Tracks a mapping of another domain's grant reference. Each domain has a * table of these, indexes into which are returned as a 'mapping handle'. */ -typedef struct { +struct grant_mapping { u32 ref; /* grant ref */ u16 flags; /* 0-4: GNTMAP_* ; 5-15: unused */ domid_t domid; /* granting domain */ -} grant_mapping_t; -#define MAPTRACK_GNTMAP_MASK 0x1f -#define MAPTRACK_MAX_ENTRIES (~((u32)0)) +}; + +/* Fairly arbitrary. [POLICY] */ +#define MAPTRACK_MAX_ENTRIES 16384 /* Per-domain grant information. */ -typedef struct { +struct grant_table { /* Shared grant table (see include/public/grant_table.h). */ - grant_entry_t *shared; + struct grant_entry *shared; /* Active grant table. */ - active_grant_entry_t *active; + struct active_grant_entry *active; /* Mapping tracking table. */ - grant_mapping_t *maptrack; + struct grant_mapping *maptrack; unsigned int maptrack_head; unsigned int maptrack_order; unsigned int maptrack_limit; unsigned int map_count; /* Lock protecting updates to active and shared grant tables. */ spinlock_t lock; -} grant_table_t; +}; /* Create/destroy per-domain grant table context. */ int grant_table_create( |