Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
a2eb0723
Commit
a2eb0723
authored
Mar 26, 2003
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SPARC64]: Fix pcibios_resource_to_bus and the build for this platform.
parent
f364ff23
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
3 deletions
+73
-3
arch/sparc64/kernel/pci.c
arch/sparc64/kernel/pci.c
+69
-0
include/asm-sparc64/pci.h
include/asm-sparc64/pci.h
+4
-3
No files found.
arch/sparc64/kernel/pci.c
View file @
a2eb0723
...
...
@@ -470,6 +470,54 @@ int pci_assign_resource(struct pci_dev *pdev, int resource)
return
err
;
}
/* Sort resources by alignment */
void
pdev_sort_resources
(
struct
pci_dev
*
dev
,
struct
resource_list
*
head
)
{
int
i
;
for
(
i
=
0
;
i
<
PCI_NUM_RESOURCES
;
i
++
)
{
struct
resource
*
r
;
struct
resource_list
*
list
,
*
tmp
;
unsigned
long
r_align
;
r
=
&
dev
->
resource
[
i
];
r_align
=
r
->
end
-
r
->
start
;
if
(
!
(
r
->
flags
)
||
r
->
parent
)
continue
;
if
(
!
r_align
)
{
printk
(
KERN_WARNING
"PCI: Ignore bogus resource %d "
"[%lx:%lx] of %s
\n
"
,
i
,
r
->
start
,
r
->
end
,
dev
->
dev
.
name
);
continue
;
}
r_align
=
(
i
<
PCI_BRIDGE_RESOURCES
)
?
r_align
+
1
:
r
->
start
;
for
(
list
=
head
;
;
list
=
list
->
next
)
{
unsigned
long
align
=
0
;
struct
resource_list
*
ln
=
list
->
next
;
int
idx
;
if
(
ln
)
{
idx
=
ln
->
res
-
&
ln
->
dev
->
resource
[
0
];
align
=
(
idx
<
PCI_BRIDGE_RESOURCES
)
?
ln
->
res
->
end
-
ln
->
res
->
start
+
1
:
ln
->
res
->
start
;
}
if
(
r_align
>
align
)
{
tmp
=
kmalloc
(
sizeof
(
*
tmp
),
GFP_KERNEL
);
if
(
!
tmp
)
panic
(
"pdev_sort_resources(): "
"kmalloc() failed!
\n
"
);
tmp
->
next
=
ln
;
tmp
->
res
=
r
;
tmp
->
dev
=
dev
;
list
->
next
=
tmp
;
break
;
}
}
}
}
void
pcibios_update_irq
(
struct
pci_dev
*
pdev
,
int
irq
)
{
}
...
...
@@ -484,6 +532,27 @@ int pcibios_enable_device(struct pci_dev *pdev, int mask)
return
0
;
}
void
pcibios_resource_to_bus
(
struct
pci_dev
*
pdev
,
struct
pci_bus_region
*
region
,
struct
resource
*
res
)
{
struct
pci_pbm_info
*
pbm
=
pci_bus2pbm
[
pdev
->
bus
->
number
];
struct
resource
zero_res
,
*
root
;
zero_res
.
start
=
0
;
zero_res
.
end
=
0
;
zero_res
.
flags
=
res
->
flags
;
if
(
res
->
flags
&
IORESOURCE_IO
)
root
=
&
pbm
->
io_space
;
else
root
=
&
pbm
->
mem_space
;
pbm
->
parent
->
resource_adjust
(
pdev
,
&
zero_res
,
root
);
region
->
start
=
res
->
start
-
zero_res
.
start
;
region
->
end
=
res
->
end
-
zero_res
.
start
;
}
char
*
__init
pcibios_setup
(
char
*
str
)
{
if
(
!
strcmp
(
str
,
"onboardfirst"
))
{
...
...
include/asm-sparc64/pci.h
View file @
a2eb0723
...
...
@@ -205,9 +205,10 @@ extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
#define HAVE_ARCH_PCI_MWI
extern
int
pcibios_prep_mwi
(
struct
pci_dev
*
dev
);
#endif
/* __KERNEL__ */
extern
void
pcibios_resource_to_bus
(
struct
pci_dev
*
dev
,
struct
pci_bus_region
*
region
,
struct
resource
*
res
);
/* generic pci stuff */
#include <asm-generic/pci.h>
#endif
/* __KERNEL__ */
#endif
/* __SPARC64_PCI_H */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment