diff options
author | Jan Beulich <jbeulich@suse.com> | 2012-09-12 10:21:21 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2012-09-12 10:21:21 +0200 |
commit | 6da1e2af7d2bc70d697fcc605745df038b078eb6 (patch) | |
tree | cd9a31ec83b8bf0cbed48670335808d9c7cc5eec /xen/include/xen/grant_table.h | |
parent | 48baddaa861a8f0704586d449cf1655c87792610 (diff) | |
download | xen-6da1e2af7d2bc70d697fcc605745df038b078eb6.tar.gz xen-6da1e2af7d2bc70d697fcc605745df038b078eb6.tar.bz2 xen-6da1e2af7d2bc70d697fcc605745df038b078eb6.zip |
gnttab: cleanup of number-of-active-frames calculations
max_nr_active_grant_frames() is merly is special case of
num_act_frames_from_sha_frames(), so there's no need to have a special
case implementation for it.
Further, some of the related definitions (including the "struct
active_grant_entry" definition itself) can (and hence should) really be
private to grant_table.c.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/include/xen/grant_table.h')
-rw-r--r-- | xen/include/xen/grant_table.h | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/xen/include/xen/grant_table.h b/xen/include/xen/grant_table.h index 76c0b06bbb..0820da1207 100644 --- a/xen/include/xen/grant_table.h +++ b/xen/include/xen/grant_table.h @@ -28,21 +28,6 @@ #include <asm/page.h> #include <asm/grant_table.h> -/* Active grant entry - used for shadowing GTF_permit_access grants. */ -struct active_grant_entry { - u32 pin; /* Reference count information. */ - domid_t domid; /* Domain being granted access. */ - struct domain *trans_domain; - uint32_t trans_gref; - unsigned long frame; /* Frame being granted. */ - unsigned long gfn; /* Guest's idea of the frame being granted. */ - unsigned is_sub_page:1; /* True if this is a sub-page grant. */ - unsigned start:15; /* For sub-page grants, the start offset - in the page. */ - unsigned length:16; /* For sub-page grants, the length of the - grant. */ -}; - /* Count of writable host-CPU mappings. */ #define GNTPIN_hstw_shift (0) #define GNTPIN_hstw_inc (1 << GNTPIN_hstw_shift) @@ -147,23 +132,4 @@ static inline unsigned int grant_to_status_frames(int grant_frames) GRANT_STATUS_PER_PAGE; } -static inline unsigned int -num_act_frames_from_sha_frames(const unsigned int num) -{ - /* How many frames are needed for the active grant table, - * given the size of the shared grant table? */ - unsigned act_per_page = PAGE_SIZE / sizeof(struct active_grant_entry); - unsigned sha_per_page = PAGE_SIZE / sizeof(grant_entry_v1_t); - unsigned num_sha_entries = num * sha_per_page; - unsigned num_act_frames = - (num_sha_entries + (act_per_page-1)) / act_per_page; - return num_act_frames; -} - -static inline unsigned int -nr_active_grant_frames(struct grant_table *gt) -{ - return num_act_frames_from_sha_frames(nr_grant_frames(gt)); -} - #endif /* __XEN_GRANT_TABLE_H__ */ |