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
013bf2c5
Commit
013bf2c5
authored
Sep 30, 2006
by
Andi Kleen
Committed by
Andi Kleen
Sep 30, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] Refactor some duplicated code in mpparse.c
No logic changes Signed-off-by:
Andi Kleen
<
ak@suse.de
>
parent
d802ab98
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
18 deletions
+19
-18
arch/x86_64/kernel/mpparse.c
arch/x86_64/kernel/mpparse.c
+19
-18
No files found.
arch/x86_64/kernel/mpparse.c
View file @
013bf2c5
...
...
@@ -152,6 +152,21 @@ static void __init MP_bus_info (struct mpc_config_bus *m)
}
}
static
int
bad_ioapic
(
unsigned
long
address
)
{
if
(
nr_ioapics
>=
MAX_IO_APICS
)
{
printk
(
KERN_ERR
"ERROR: Max # of I/O APICs (%d) exceeded "
"(found %d)
\n
"
,
MAX_IO_APICS
,
nr_ioapics
);
panic
(
"Recompile kernel with bigger MAX_IO_APICS!
\n
"
);
}
if
(
!
address
)
{
printk
(
KERN_ERR
"WARNING: Bogus (zero) I/O APIC address"
" found in table, skipping!
\n
"
);
return
1
;
}
return
0
;
}
static
void
__init
MP_ioapic_info
(
struct
mpc_config_ioapic
*
m
)
{
if
(
!
(
m
->
mpc_flags
&
MPC_APIC_USABLE
))
...
...
@@ -159,16 +174,10 @@ static void __init MP_ioapic_info (struct mpc_config_ioapic *m)
printk
(
"I/O APIC #%d at 0x%X.
\n
"
,
m
->
mpc_apicid
,
m
->
mpc_apicaddr
);
if
(
nr_ioapics
>=
MAX_IO_APICS
)
{
printk
(
KERN_ERR
"Max # of I/O APICs (%d) exceeded (found %d).
\n
"
,
MAX_IO_APICS
,
nr_ioapics
);
panic
(
"Recompile kernel with bigger MAX_IO_APICS!.
\n
"
);
}
if
(
!
m
->
mpc_apicaddr
)
{
printk
(
KERN_ERR
"WARNING: bogus zero I/O APIC address"
" found in MP table, skipping!
\n
"
);
if
(
bad_ioapic
(
m
->
mpc_apicaddr
))
return
;
}
mp_ioapics
[
nr_ioapics
]
=
*
m
;
nr_ioapics
++
;
}
...
...
@@ -647,16 +656,8 @@ void __init mp_register_ioapic(u8 id, u32 address, u32 gsi_base)
{
int
idx
=
0
;
if
(
nr_ioapics
>=
MAX_IO_APICS
)
{
printk
(
KERN_ERR
"ERROR: Max # of I/O APICs (%d) exceeded "
"(found %d)
\n
"
,
MAX_IO_APICS
,
nr_ioapics
);
panic
(
"Recompile kernel with bigger MAX_IO_APICS!
\n
"
);
}
if
(
!
address
)
{
printk
(
KERN_ERR
"WARNING: Bogus (zero) I/O APIC address"
" found in MADT table, skipping!
\n
"
);
if
(
bad_ioapic
(
address
))
return
;
}
idx
=
nr_ioapics
++
;
...
...
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