Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F146018772
D53404.1779123632.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
4 KB
Referenced Files
None
Subscribers
None
D53404.1779123632.diff
View Options
diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c
--- a/sys/compat/linuxkpi/common/src/linux_pci.c
+++ b/sys/compat/linuxkpi/common/src/linux_pci.c
@@ -547,7 +547,7 @@
dev = pdev->pdrv != NULL && pdev->pdrv->isdrm ?
device_get_parent(pdev->dev.bsddev) : pdev->dev.bsddev;
- res = pci_reserve_map(device_get_parent(dev), dev, type, &rid, 0, ~0,
+ res = pci_reserve_map(device_get_parent(dev), dev, type, rid, 0, ~0,
1, 1, 0);
if (res == NULL)
return (NULL);
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c
--- a/sys/dev/pci/pci.c
+++ b/sys/dev/pci/pci.c
@@ -5505,7 +5505,7 @@
#endif /* DDB */
struct resource *
-pci_reserve_map(device_t dev, device_t child, int type, int *rid,
+pci_reserve_map(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int num,
u_int flags)
{
@@ -5520,10 +5520,10 @@
res = NULL;
/* If rid is managed by EA, ignore it */
- if (pci_ea_is_enabled(child, *rid))
+ if (pci_ea_is_enabled(child, rid))
goto out;
- pm = pci_find_bar(child, *rid);
+ pm = pci_find_bar(child, rid);
if (pm != NULL) {
/* This is a BAR that we failed to allocate earlier. */
mapsize = pm->pm_size;
@@ -5537,28 +5537,28 @@
* have a atapci device in legacy mode and it fails
* here, that other code is broken.
*/
- pci_read_bar(child, *rid, &map, &testval, NULL);
+ pci_read_bar(child, rid, &map, &testval, NULL);
/*
* Determine the size of the BAR and ignore BARs with a size
* of 0. Device ROM BARs use a different mask value.
*/
- if (PCIR_IS_BIOS(&dinfo->cfg, *rid))
+ if (PCIR_IS_BIOS(&dinfo->cfg, rid))
mapsize = pci_romsize(testval);
else
mapsize = pci_mapsize(testval);
if (mapsize == 0)
goto out;
- pm = pci_add_bar(child, *rid, map, mapsize);
+ pm = pci_add_bar(child, rid, map, mapsize);
}
- if (PCI_BAR_MEM(map) || PCIR_IS_BIOS(&dinfo->cfg, *rid)) {
+ if (PCI_BAR_MEM(map) || PCIR_IS_BIOS(&dinfo->cfg, rid)) {
if (type != SYS_RES_MEMORY) {
if (bootverbose)
device_printf(dev,
"child %s requested type %d for rid %#x,"
" but the BAR says it is an memio\n",
- device_get_nameunit(child), type, *rid);
+ device_get_nameunit(child), type, rid);
goto out;
}
} else {
@@ -5567,7 +5567,7 @@
device_printf(dev,
"child %s requested type %d for rid %#x,"
" but the BAR says it is an ioport\n",
- device_get_nameunit(child), type, *rid);
+ device_get_nameunit(child), type, rid);
goto out;
}
}
@@ -5589,20 +5589,20 @@
* Allocate enough resource, and then write back the
* appropriate BAR for that resource.
*/
- resource_list_add(rl, type, *rid, start, end, count);
- res = resource_list_reserve(rl, dev, child, type, *rid, start, end,
+ resource_list_add(rl, type, rid, start, end, count);
+ res = resource_list_reserve(rl, dev, child, type, rid, start, end,
count, flags & ~RF_ACTIVE);
if (res == NULL) {
- resource_list_delete(rl, type, *rid);
+ resource_list_delete(rl, type, rid);
device_printf(child,
"%#jx bytes of rid %#x res %d failed (%#jx, %#jx).\n",
- count, *rid, type, start, end);
+ count, rid, type, start, end);
goto out;
}
if (bootverbose)
device_printf(child,
"Lazy allocation of %#jx bytes rid %#x type %d at %#jx\n",
- count, *rid, type, rman_get_start(res));
+ count, rid, type, rman_get_start(res));
/* Disable decoding via the CMD register before updating the BAR */
cmd = pci_read_config(child, PCIR_COMMAND, 2);
@@ -5680,7 +5680,7 @@
/* Reserve resources for this BAR if needed. */
rle = resource_list_find(rl, type, rid);
if (rle == NULL) {
- res = pci_reserve_map(dev, child, type, &rid, start, end,
+ res = pci_reserve_map(dev, child, type, rid, start, end,
count, num, flags);
if (res == NULL)
return (NULL);
diff --git a/sys/dev/pci/pci_private.h b/sys/dev/pci/pci_private.h
--- a/sys/dev/pci/pci_private.h
+++ b/sys/dev/pci/pci_private.h
@@ -147,7 +147,7 @@
pci_addr_t size);
struct resource *pci_reserve_map(device_t dev, device_t child, int type,
- int *rid, rman_res_t start, rman_res_t end,
+ int rid, rman_res_t start, rman_res_t end,
rman_res_t count, u_int num, u_int flags);
struct resource *pci_alloc_multi_resource(device_t dev, device_t child,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, May 18, 5:00 PM (22 m, 30 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28719613
Default Alt Text
D53404.1779123632.diff (4 KB)
Attached To
Mode
D53404: pci_reserve_map: Pass rid by value
Attached
Detach File
Event Timeline
Log In to Comment