diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2009-10-07 07:44:50 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2009-10-07 07:44:50 +0100 |
commit | b6856c76a6287570ab74430e5445d6f1c1fbeeb8 (patch) | |
tree | 6ce3a79228e95f187b63a3b72fb850e011d4cbd1 /xen/include/xen/grant_table.h | |
parent | c4debc45154cd6821805cfa6175e42d67f11d310 (diff) | |
download | xen-b6856c76a6287570ab74430e5445d6f1c1fbeeb8.tar.gz xen-b6856c76a6287570ab74430e5445d6f1c1fbeeb8.tar.bz2 xen-b6856c76a6287570ab74430e5445d6f1c1fbeeb8.zip |
Simplify include/xen/grant_table.h a bit:
-- INITIAL_GRANT_ENTRIES is never used, so can be removed.
-- Simplify num_act_frames_from_sha_frames a little.
Signed-off-by: Steven Smith <steven.smith@citrix.com>
Diffstat (limited to 'xen/include/xen/grant_table.h')
-rw-r--r-- | xen/include/xen/grant_table.h | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/xen/include/xen/grant_table.h b/xen/include/xen/grant_table.h index 096af9bb4c..27cc3fad91 100644 --- a/xen/include/xen/grant_table.h +++ b/xen/include/xen/grant_table.h @@ -53,10 +53,6 @@ struct active_grant_entry { #define GNTPIN_devr_inc (1 << GNTPIN_devr_shift) #define GNTPIN_devr_mask (0xFFU << GNTPIN_devr_shift) -/* Initial size of a grant table. */ -#define INITIAL_NR_GRANT_ENTRIES ((INITIAL_NR_GRANT_FRAMES << PAGE_SHIFT) / \ - sizeof(grant_entry_t)) - #ifndef DEFAULT_MAX_NR_GRANT_FRAMES /* to allow arch to override */ /* Default maximum size of a grant table. [POLICY] */ #define DEFAULT_MAX_NR_GRANT_FRAMES 32 @@ -128,16 +124,13 @@ 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? - * - * act_per_page = PAGE_SIZE / sizeof(active_grant_entry_t); - * sha_per_page = PAGE_SIZE / sizeof(grant_entry_t); - * num_sha_entries = num * sha_per_page; - * num_act_frames = (num_sha_entries + (act_per_page-1)) / act_per_page; - */ - return ((num * (PAGE_SIZE / sizeof(grant_entry_t))) + - ((PAGE_SIZE / sizeof(struct active_grant_entry))-1)) - / (PAGE_SIZE / sizeof(struct active_grant_entry)); + * 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_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 |