Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Bernhard Heinloth
OOStuBS - WS18
Commits
22d5e317
Commit
22d5e317
authored
Nov 09, 2018
by
Bernhard Heinloth
Browse files
Vermeide Zuweisung von großer Struktur in APICSystem - Clang will sonst memcpy verwenden
parent
cc9c2cc5
Changes
2
Hide whitespace changes
Inline
Side-by-side
machine/apicsystem.cc
View file @
22d5e317
...
...
@@ -4,6 +4,7 @@
#include "device/cgastr.h"
#include "machine/io_port.h"
#include "machine/lapic.h"
#include "machine/ioapic.h"
#include "debug/output.h"
#include "machine/acpi.h"
...
...
@@ -61,17 +62,17 @@ void APICSystem::detectSystemType()
#endif
if
(
acpi_conf
.
cpu_count
>=
mps_conf
.
cpu_count
)
{
sys_conf
=
acpi_conf
;
sys_conf
=
&
acpi_conf
;
}
else
{
sys_conf
=
mps_conf
;
sys_conf
=
&
mps_conf
;
}
if
(
sys_conf
.
disablePICs
)
{
if
(
sys_conf
->
disablePICs
)
{
disablePICs
();
}
if
(
sys_conf
.
cpu_count
>
1
)
{
if
(
sys_conf
->
cpu_count
>
1
)
{
system_type
=
MP_APIC
;
}
else
{
if
(
sys_conf
.
ioapic_id
<
0
)
{
if
(
sys_conf
->
ioapic_id
<
0
)
{
system_type
=
UNDETECTED
;
}
system_type
=
UP_APIC
;
...
...
@@ -81,7 +82,7 @@ void APICSystem::detectSystemType()
DBG
<<
"SMP Detection using ACPI: FAIL"
<<
endl
<<
"Did not detect SMP system."
<<
endl
;
#endif
sys_conf
.
cpu_count
=
1
;
sys_conf
->
cpu_count
=
1
;
onlineCPUs
=
1
;
}
return
;
...
...
@@ -283,7 +284,7 @@ void APICSystem::generateIRQMap(char ioapic_irqs[], char slot_map[])
unsigned
char
APICSystem
::
getIOAPICSlot
(
APICSystem
::
Device
device
)
{
return
sys_conf
.
slot_map
[
device
];
return
sys_conf
->
slot_map
[
device
];
}
int
APICSystem
::
getCPUID
()
...
...
@@ -591,11 +592,11 @@ extern "C" void setup_ap(void);
/* aktiviert die CPU mit der ID id, gibt bei erfolg true, ansonsten false zurück */
bool
APICSystem
::
bootCPU
(
unsigned
int
cpu_id
,
void
*
top_of_stack
)
{
if
(
cpu_id
>=
sys_conf
.
cpu_count
)
{
if
(
cpu_id
>=
sys_conf
->
cpu_count
)
{
//return false;
}
unsigned
int
id
=
sys_conf
.
lapic_id
[
cpu_id
];
unsigned
int
id
=
sys_conf
->
lapic_id
[
cpu_id
];
// if (id == bspID) {
// // don't start the BSP, just set the LAPIC's logical destination address
...
...
machine/apicsystem.h
View file @
22d5e317
...
...
@@ -77,7 +77,7 @@ private:
void
*
relocatedSetupAP
;
///< Zeiger auf den Setupcode für die Applikation
SystemConfig
mps_conf
;
SystemConfig
acpi_conf
;
SystemConfig
sys_conf
;
SystemConfig
*
sys_conf
;
public:
APICSystem
()
:
system_type
(
UNDETECTED
),
onlineCPUs
(
1
),
callout_cpu_number
(
0
),
// The boot processor has an waiting callout with id = 0
...
...
@@ -141,7 +141,7 @@ public:
*
*/
unsigned
int
getNumberOfCPUs
()
{
return
sys_conf
.
cpu_count
;
return
sys_conf
->
cpu_count
;
}
/*! \brief Gibt die Anzahl der erfolgreich gebooteten CPUs zurück
*
...
...
@@ -153,11 +153,11 @@ public:
*
*/
unsigned
char
getIOAPICID
()
{
return
sys_conf
.
ioapic_id
;
return
sys_conf
->
ioapic_id
;
}
/// Liefert die ID des Bootprozessors (BSP)
unsigned
char
getBSPID
()
{
return
sys_conf
.
bsp_id
;
return
sys_conf
->
bsp_id
;
}
void
setupThisProcessor
();
...
...
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