Commit 22d5e317 authored by Bernhard Heinloth's avatar Bernhard Heinloth
Browse files

Vermeide Zuweisung von großer Struktur in APICSystem - Clang will sonst memcpy verwenden

parent cc9c2cc5
......@@ -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
......
......@@ -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();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment