Changeset View
Changeset View
Standalone View
Standalone View
sys/powerpc/powernv/opal_pci.c
Show First 20 Lines • Show All 210 Lines • ▼ Show 20 Lines | |||||
* limiting us to 64GB if we have 1M entries. | * limiting us to 64GB if we have 1M entries. | ||||
*/ | */ | ||||
static uint64_t | static uint64_t | ||||
max_tce_size(device_t dev) | 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; | ||||
int cell_size; | |||||
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)) | cell_size = sizeof(cell_t); | ||||
if (count < cell_size); | |||||
wma: Looks good, except the semicolon at the end ;) | |||||
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 |
Looks good, except the semicolon at the end ;)