mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
xen/x86: move domain_clamp_alloc_bitsize() into pv32 code
The d->arch.physaddr_bitsize field is used only by PV32 code so as the domain_clamp_alloc_bitsize() function. Hence move domain_clamp_alloc_bitsize() function into PV32 code and convert it to macro. Signed-off-by: Grygorii Strashko <grygorii_strashko@epam.com> Reviewed-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
1 parent
c9f88ba993
commit
c37bcb35f9
2 files changed
+9
-9
No files matched your search
@@ -619,8 +619,15 @@ void __iomem *ioremap_wc(paddr_t pa, size_t len);
|
||||
|
||||
extern int memory_add(unsigned long spfn, unsigned long epfn, unsigned int pxm);
|
||||
|
||||
unsigned int domain_clamp_alloc_bitsize(struct domain *d, unsigned int bits);
|
||||
#define domain_clamp_alloc_bitsize(d, bits) domain_clamp_alloc_bitsize(d, bits)
|
||||
#ifdef CONFIG_PV32
|
||||
#define domain_clamp_alloc_bitsize(d, bits) ({ \
|
||||
const struct domain *_d = (d); \
|
||||
\
|
||||
((_d && _d->arch.physaddr_bitsize) \
|
||||
? min_t(unsigned int, _d->arch.physaddr_bitsize, bits) \
|
||||
: (bits)); \
|
||||
})
|
||||
#endif
|
||||
|
||||
unsigned long domain_get_maximum_gpfn(struct domain *d);
|
||||
|
||||
|
||||
@@ -1119,13 +1119,6 @@ unmap:
|
||||
return ret;
|
||||
}
|
||||
|
||||
unsigned int domain_clamp_alloc_bitsize(struct domain *d, unsigned int bits)
|
||||
{
|
||||
if ( (d == NULL) || (d->arch.physaddr_bitsize == 0) )
|
||||
return bits;
|
||||
return min(d->arch.physaddr_bitsize, bits);
|
||||
}
|
||||
|
||||
static int transfer_pages_to_heap(struct mem_hotadd_info *info)
|
||||
{
|
||||
unsigned long i;
|
||||
|
||||