Changes to kernel_args to make it identical for x86 and x86_64.

* Added a FixedWidthPointer template class which uses 64-bit storage to hold
  a pointer. This is used in place of raw pointers in kernel_args.
* Added __attribute__((packed)) to kernel_args and all structures contained
  within it. This is necessary due to different alignment behaviour for
  32-bit and 64-bit compilation with GCC.
* With these changes, kernel_args will now come out the same size for both
  the x86_64 kernel and the loader, excluding the preloaded_image structure
  which has not yet been changed.
* Tested both an x86 GCC2 and GCC4 build, no problems caused by these changes.
This commit is contained in:
Alex Smith
2012-06-21 18:02:23 +01:00
parent 192af9e0af
commit d8efc6caf6
21 changed files with 174 additions and 41 deletions
@@ -12,6 +12,7 @@
#include <arch/x86/apm.h>
#include <bios_drive.h>
#include <util/FixedWidthPointer.h>
// must match SMP_MAX_CPUS in arch_smp.h
@@ -25,9 +26,10 @@
typedef struct {
uint16 serial_base_ports[MAX_SERIAL_PORTS];
bios_drive *drives; // this does not contain the boot drive
FixedWidthPointer<bios_drive> drives;
// this does not contain the boot drive
apm_info apm;
} platform_kernel_args;
} _PACKED platform_kernel_args;
#endif /* KERNEL_BOOT_PLATFORM_BIOS_IA32_KERNEL_ARGS_H */