Lines Matching defs:mem

316 		} else if (cur_func->mem[i]) {
317 ibmphp_remove_resource(cur_func->mem[i]);
318 cur_func->mem[i] = NULL;
345 struct resource_node *mem[6];
447 debug("there's no pfmem... going into mem.\n");
474 debug("inside the mem 64 case, count %d\n", count);
488 mem[count] = kzalloc(sizeof(struct resource_node), GFP_KERNEL);
489 if (!mem[count])
492 mem[count]->type = MEM;
493 mem[count]->busno = func->busno;
494 mem[count]->devfunc = PCI_DEVFN(func->device,
496 mem[count]->len = len[count];
497 if (ibmphp_check_resource(mem[count], 0) == 0) {
498 ibmphp_add_resource(mem[count]);
499 func->mem[count] = mem[count];
501 err("cannot allocate requested mem for bus %x, device %x, len %x\n",
503 kfree(mem[count]);
506 pci_bus_write_config_dword(ibmphp_pci_bus, devfn, address[count], func->mem[count]->start);
508 debug("b4 writing, start address is %x\n", func->mem[count]->start);
515 debug("inside mem 64 case, reg. mem, count %d\n", count);
521 } /* end of mem */
561 struct resource_node *mem = NULL;
630 /* First we need to allocate mem/io for the bridge itself in case it needs it */
750 func->mem[count] = bus_mem[count];
752 err("cannot allocate requested mem for bus %x, device %x, len %x\n",
758 pci_bus_write_config_dword(ibmphp_pci_bus, devfn, address[count], func->mem[count]->start);
768 } /* end of mem */
780 debug("amount_needed->mem = %x\n", amount_needed->mem);
795 func->mem[count] = NULL;
824 if (!amount_needed->mem) {
828 debug("it wants %x memory behind the bridge\n", amount_needed->mem);
829 mem = kzalloc(sizeof(*mem), GFP_KERNEL);
830 if (!mem) {
834 mem->type = MEM;
835 mem->busno = func->busno;
836 mem->devfunc = PCI_DEVFN(func->device, func->function);
837 mem->len = amount_needed->mem;
838 if (ibmphp_check_resource(mem, 1) == 0) {
839 ibmphp_add_resource(mem);
841 debug("were we able to add mem\n");
846 debug("it doesn't want n.e.pfmem mem?\n");
901 rc = add_new_bus(bus, io, mem, pfmem, func->busno);
903 rc = add_new_bus(bus, io, mem, pfmem, 0xFF);
1023 if (mem)
1024 ibmphp_remove_resource(mem);
1034 func->mem[i] = NULL;
1150 amount->mem += len[count];
1168 if ((amount->mem) && (amount->mem < MEMBRIDGE))
1169 amount->mem = MEMBRIDGE;
1196 struct resource_node *mem;
1276 debug("start address of mem is %x\n", start_address);
1279 if (ibmphp_find_resource(bus, start_address, &mem, MEM) < 0) {
1283 if (mem) {
1284 debug("mem->start = %x\n", mem->start);
1286 ibmphp_remove_resource(mem);
1293 } /* end of mem */
1310 struct resource_node *mem = NULL;
1395 if (ibmphp_find_resource(bus, start_address, &mem, MEM) < 0) {
1399 if (mem) {
1400 debug("mem->start = %x\n", mem->start);
1402 ibmphp_remove_resource(mem);
1409 } /* end of mem */
1569 if (cur_func->mem[i]) {
1570 debug("mem[%d] exists\n", i);
1572 ibmphp_remove_resource(cur_func->mem[i]);
1573 cur_func->mem[i] = NULL;
1603 static int add_new_bus(struct bus_node *bus, struct resource_node *io, struct resource_node *mem, struct resource_node *pfmem, u8 parent_busno)
1631 if (mem) {
1636 mem_range->start = mem->start;
1637 mem_range->end = mem->end;