Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 329174
b: refs/heads/master
c: 1cef36a
h: refs/heads/master
v: v3
  • Loading branch information
Konrad Rzeszutek Wilk committed Sep 17, 2012
1 parent 3015780 commit d4b081b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 74838b75379a53678ffc5f59de86161d21e2c808
refs/heads/master: 1cef36a529f44dbb3612ee0deeb0b5563de36163
21 changes: 11 additions & 10 deletions trunk/drivers/xen/swiotlb-xen.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,25 +144,26 @@ xen_swiotlb_fixup(void *buf, size_t size, unsigned long nslabs)
} while (i < nslabs);
return 0;
}
static unsigned long xen_set_nslabs(unsigned long nr_tbl)
{
if (!nr_tbl) {
xen_io_tlb_nslabs = (64 * 1024 * 1024 >> IO_TLB_SHIFT);
xen_io_tlb_nslabs = ALIGN(xen_io_tlb_nslabs, IO_TLB_SEGSIZE);
} else
xen_io_tlb_nslabs = nr_tbl;

return xen_io_tlb_nslabs << IO_TLB_SHIFT;
}
void __init xen_swiotlb_init(int verbose)
{
unsigned long bytes;
int rc = -ENOMEM;
unsigned long nr_tbl;
char *m = NULL;
unsigned int repeat = 3;

nr_tbl = swiotlb_nr_tbl();
if (nr_tbl)
xen_io_tlb_nslabs = nr_tbl;
else {
xen_io_tlb_nslabs = (64 * 1024 * 1024 >> IO_TLB_SHIFT);
xen_io_tlb_nslabs = ALIGN(xen_io_tlb_nslabs, IO_TLB_SEGSIZE);
}
xen_io_tlb_nslabs = swiotlb_nr_tbl();
retry:
bytes = xen_io_tlb_nslabs << IO_TLB_SHIFT;

bytes = xen_set_nslabs(xen_io_tlb_nslabs);
/*
* Get IO TLB memory from any location.
*/
Expand Down

0 comments on commit d4b081b

Please sign in to comment.