projects
/
seabios.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b8a90f5
)
Minor formatting and comment updates to acpi.c.
author
Kevin O'Connor
<kevin@koconnor.net>
Fri, 2 Sep 2011 22:11:58 +0000
(18:11 -0400)
committer
Kevin O'Connor
<kevin@koconnor.net>
Fri, 2 Sep 2011 22:11:58 +0000
(18:11 -0400)
src/acpi.c
patch
|
blob
|
history
diff --git
a/src/acpi.c
b/src/acpi.c
index 29160f484ed35dd29e3d8825ee9ca29663c67d8c..6bb6ff632e819daafaab0ede748bb6550b119835 100644
(file)
--- a/
src/acpi.c
+++ b/
src/acpi.c
@@
-208,9
+208,9
@@
build_header(struct acpi_table_header *h, u32 sig, int len, u8 rev)
h->revision = rev;
memcpy(h->oem_id, CONFIG_APPNAME6, 6);
memcpy(h->oem_table_id, CONFIG_APPNAME4, 4);
h->revision = rev;
memcpy(h->oem_id, CONFIG_APPNAME6, 6);
memcpy(h->oem_table_id, CONFIG_APPNAME4, 4);
- memcpy(h->asl_compiler_id, CONFIG_APPNAME4, 4);
memcpy(h->oem_table_id + 4, (void*)&sig, 4);
h->oem_revision = cpu_to_le32(1);
memcpy(h->oem_table_id + 4, (void*)&sig, 4);
h->oem_revision = cpu_to_le32(1);
+ memcpy(h->asl_compiler_id, CONFIG_APPNAME4, 4);
h->asl_compiler_revision = cpu_to_le32(1);
h->checksum -= checksum(h, len);
}
h->asl_compiler_revision = cpu_to_le32(1);
h->checksum -= checksum(h, len);
}
@@
-463,7
+463,7
@@
build_ssdt(void)
return ssdt;
}
return ssdt;
}
-#define HPET_SIGNATURE 0x54455048 //HPET
+#define HPET_SIGNATURE 0x54455048 //
HPET
static void*
build_hpet(void)
{
static void*
build_hpet(void)
{
@@
-473,7
+473,7
@@
build_hpet(void)
u32 hpet_period = readl(hpet_base + HPET_PERIOD);
if (hpet_vendor == 0 || hpet_vendor == 0xffff ||
u32 hpet_period = readl(hpet_base + HPET_PERIOD);
if (hpet_vendor == 0 || hpet_vendor == 0xffff ||
- hpet_period == 0 || hpet_period >
0x05F5E1
00)
+ hpet_period == 0 || hpet_period >
1000000
00)
return NULL;
hpet = malloc_high(sizeof(*hpet));
return NULL;
hpet = malloc_high(sizeof(*hpet));
@@
-499,7
+499,7
@@
acpi_build_srat_memory(struct srat_memory_affinity *numamem,
{
numamem->type = SRAT_MEMORY;
numamem->length = sizeof(*numamem);
{
numamem->type = SRAT_MEMORY;
numamem->length = sizeof(*numamem);
- memset
(numamem->proximity, 0 ,4);
+ memset(numamem->proximity, 0 ,4);
numamem->proximity[0] = node;
numamem->flags = cpu_to_le32(!!enabled);
numamem->base_addr_low = base & 0xFFFFFFFF;
numamem->proximity[0] = node;
numamem->flags = cpu_to_le32(!!enabled);
numamem->base_addr_low = base & 0xFFFFFFFF;
@@
-508,7
+508,7
@@
acpi_build_srat_memory(struct srat_memory_affinity *numamem,
numamem->length_high = len >> 32;
}
numamem->length_high = len >> 32;
}
-#define SRAT_SIGNATURE 0x54415253 //
HPE
T
+#define SRAT_SIGNATURE 0x54415253 //
SRA
T
static void *
build_srat(void)
{
static void *
build_srat(void)
{
@@
-628,13
+628,7
@@
acpi_bios_init(void)
// Device not found
return;
// Device not found
return;
- // Create initial rsdt table
- struct rsdp_descriptor *rsdp = malloc_fseg(sizeof(*rsdp));
- if (!rsdp) {
- warn_noalloc();
- return;
- }
-
+ // Build ACPI tables
u32 tables[MAX_ACPI_TABLES], tbl_idx = 0;
#define ACPI_INIT_TABLE(X) \
u32 tables[MAX_ACPI_TABLES], tbl_idx = 0;
#define ACPI_INIT_TABLE(X) \
@@
-644,7
+638,6
@@
acpi_bios_init(void)
tbl_idx++; \
} while(0)
tbl_idx++; \
} while(0)
- // Add tables
ACPI_INIT_TABLE(build_fadt(pci));
ACPI_INIT_TABLE(build_ssdt());
ACPI_INIT_TABLE(build_madt());
ACPI_INIT_TABLE(build_fadt(pci));
ACPI_INIT_TABLE(build_ssdt());
ACPI_INIT_TABLE(build_madt());
@@
-653,7
+646,7
@@
acpi_bios_init(void)
u16 i, external_tables = qemu_cfg_acpi_additional_tables();
u16 i, external_tables = qemu_cfg_acpi_additional_tables();
- for(i = 0; i < external_tables; i++) {
+ for
(i = 0; i < external_tables; i++) {
u16 len = qemu_cfg_next_acpi_table_len();
void *addr = malloc_high(len);
if (!addr) {
u16 len = qemu_cfg_next_acpi_table_len();
void *addr = malloc_high(len);
if (!addr) {
@@
-667,20
+660,24
@@
acpi_bios_init(void)
}
}
}
}
+ // Build final rsdt table
struct rsdt_descriptor_rev1 *rsdt;
size_t rsdt_len = sizeof(*rsdt) + sizeof(u32) * tbl_idx;
rsdt = malloc_high(rsdt_len);
struct rsdt_descriptor_rev1 *rsdt;
size_t rsdt_len = sizeof(*rsdt) + sizeof(u32) * tbl_idx;
rsdt = malloc_high(rsdt_len);
-
if (!rsdt) {
warn_noalloc();
return;
}
memset(rsdt, 0, rsdt_len);
memcpy(rsdt->table_offset_entry, tables, sizeof(u32) * tbl_idx);
if (!rsdt) {
warn_noalloc();
return;
}
memset(rsdt, 0, rsdt_len);
memcpy(rsdt->table_offset_entry, tables, sizeof(u32) * tbl_idx);
-
build_header((void*)rsdt, RSDT_SIGNATURE, rsdt_len, 1);
// Build rsdp pointer table
build_header((void*)rsdt, RSDT_SIGNATURE, rsdt_len, 1);
// Build rsdp pointer table
+ struct rsdp_descriptor *rsdp = malloc_fseg(sizeof(*rsdp));
+ if (!rsdp) {
+ warn_noalloc();
+ return;
+ }
memset(rsdp, 0, sizeof(*rsdp));
rsdp->signature = RSDP_SIGNATURE;
memcpy(rsdp->oem_id, CONFIG_APPNAME6, 6);
memset(rsdp, 0, sizeof(*rsdp));
rsdp->signature = RSDP_SIGNATURE;
memcpy(rsdp->oem_id, CONFIG_APPNAME6, 6);