Changeset View
Changeset View
Standalone View
Standalone View
head/sys/powerpc/powernv/opal_pci.c
Show First 20 Lines • Show All 215 Lines • ▼ Show 20 Lines | max_tce_size(device_t dev) | ||||
phandle_t node; | phandle_t node; | ||||
cell_t sizes[64]; /* Property is a list of bit-widths, up to 64-bits */ | cell_t sizes[64]; /* Property is a list of bit-widths, up to 64-bits */ | ||||
int count; | int count; | ||||
node = ofw_bus_get_node(dev); | node = ofw_bus_get_node(dev); | ||||
count = OF_getencprop(node, "ibm,supported-tce-sizes", | count = OF_getencprop(node, "ibm,supported-tce-sizes", | ||||
sizes, sizeof(sizes)); | sizes, sizeof(sizes)); | ||||
if (count < sizeof(cell_t)) | if (count < (int) sizeof(cell_t)) | ||||
return OPAL_PCI_TCE_DEFAULT_SEG_SIZE; | return OPAL_PCI_TCE_DEFAULT_SEG_SIZE; | ||||
count /= sizeof(cell_t); | count /= sizeof(cell_t); | ||||
return (1ULL << sizes[count - 1]); | return (1ULL << sizes[count - 1]); | ||||
} | } | ||||
static int | static int | ||||
▲ Show 20 Lines • Show All 450 Lines • Show Last 20 Lines |