projects
/
seabios.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b64db30
)
Minor - breakup mptable allocation into two calls.
author
Kevin O'Connor
<kevin@koconnor.net>
Wed, 29 Jul 2009 23:44:42 +0000
(19:44 -0400)
committer
Kevin O'Connor
<kevin@koconnor.net>
Wed, 29 Jul 2009 23:44:42 +0000
(19:44 -0400)
src/mptable.c
patch
|
blob
|
history
diff --git
a/src/mptable.c
b/src/mptable.c
index dd3b10afe2eff281ca07c2b55c91b376ced1ec5a..8f622fffbb2d43fd8d35f1000d143f7da9bab683 100644
(file)
--- a/
src/mptable.c
+++ b/
src/mptable.c
@@
-29,22
+29,20
@@
mptable_init(void)
// Building an mptable on uniprocessor machines confuses some OSes.
return;
// Building an mptable on uniprocessor machines confuses some OSes.
return;
- int length = (sizeof(struct mptable_floating_s)
- + sizeof(struct mptable_config_s)
+ int length = (sizeof(struct mptable_config_s)
+ sizeof(struct mpt_cpu) * smp_cpus
+ sizeof(struct mpt_bus)
+ sizeof(struct mpt_ioapic)
+ sizeof(struct mpt_intsrc) * 16);
+ sizeof(struct mpt_cpu) * smp_cpus
+ sizeof(struct mpt_bus)
+ sizeof(struct mpt_ioapic)
+ sizeof(struct mpt_intsrc) * 16);
- void *start = malloc_fseg(length);
- if (!start) {
+ struct mptable_config_s *config = malloc_fseg(length);
+ struct mptable_floating_s *floating = malloc_fseg(sizeof(*floating));
+ if (!config || !floating) {
dprintf(1, "No room for MPTABLE!\n");
return;
}
/* floating pointer structure */
dprintf(1, "No room for MPTABLE!\n");
return;
}
/* floating pointer structure */
- struct mptable_floating_s *floating = start;
memset(floating, 0, sizeof(*floating));
memset(floating, 0, sizeof(*floating));
- struct mptable_config_s *config = (void*)&floating[1];
floating->signature = MPTABLE_SIGNATURE;
floating->physaddr = (u32)config;
floating->length = 1;
floating->signature = MPTABLE_SIGNATURE;
floating->physaddr = (u32)config;
floating->length = 1;