bootx.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. /*
  2. * This file describes the structure passed from the BootX application
  3. * (for MacOS) when it is used to boot Linux.
  4. *
  5. * Written by Benjamin Herrenschmidt.
  6. */
  7. #ifndef _UAPI__ASM_BOOTX_H__
  8. #define _UAPI__ASM_BOOTX_H__
  9. #include <linux/types.h>
  10. #ifdef macintosh
  11. #include <Types.h>
  12. #include "linux_type_defs.h"
  13. #endif
  14. #ifdef macintosh
  15. /* All this requires PowerPC alignment */
  16. #pragma options align=power
  17. #endif
  18. /* On kernel entry:
  19. *
  20. * r3 = 0x426f6f58 ('BooX')
  21. * r4 = pointer to boot_infos
  22. * r5 = NULL
  23. *
  24. * Data and instruction translation disabled, interrupts
  25. * disabled, kernel loaded at physical 0x00000000 on PCI
  26. * machines (will be different on NuBus).
  27. */
  28. #define BOOT_INFO_VERSION 5
  29. #define BOOT_INFO_COMPATIBLE_VERSION 1
  30. /* Bit in the architecture flag mask. More to be defined in
  31. future versions. Note that either BOOT_ARCH_PCI or
  32. BOOT_ARCH_NUBUS is set. The other BOOT_ARCH_NUBUS_xxx are
  33. set additionally when BOOT_ARCH_NUBUS is set.
  34. */
  35. #define BOOT_ARCH_PCI 0x00000001UL
  36. #define BOOT_ARCH_NUBUS 0x00000002UL
  37. #define BOOT_ARCH_NUBUS_PDM 0x00000010UL
  38. #define BOOT_ARCH_NUBUS_PERFORMA 0x00000020UL
  39. #define BOOT_ARCH_NUBUS_POWERBOOK 0x00000040UL
  40. /* Maximum number of ranges in phys memory map */
  41. #define MAX_MEM_MAP_SIZE 26
  42. /* This is the format of an element in the physical memory map. Note that
  43. the map is optional and current BootX will only build it for pre-PCI
  44. machines */
  45. typedef struct boot_info_map_entry
  46. {
  47. __u32 physAddr; /* Physical starting address */
  48. __u32 size; /* Size in bytes */
  49. } boot_info_map_entry_t;
  50. /* Here are the boot informations that are passed to the bootstrap
  51. * Note that the kernel arguments and the device tree are appended
  52. * at the end of this structure. */
  53. typedef struct boot_infos
  54. {
  55. /* Version of this structure */
  56. __u32 version;
  57. /* backward compatible down to version: */
  58. __u32 compatible_version;
  59. /* NEW (vers. 2) this holds the current _logical_ base addr of
  60. the frame buffer (for use by early boot message) */
  61. __u8* logicalDisplayBase;
  62. /* NEW (vers. 4) Apple's machine identification */
  63. __u32 machineID;
  64. /* NEW (vers. 4) Detected hw architecture */
  65. __u32 architecture;
  66. /* The device tree (internal addresses relative to the beginning of the tree,
  67. * device tree offset relative to the beginning of this structure).
  68. * On pre-PCI macintosh (BOOT_ARCH_PCI bit set to 0 in architecture), this
  69. * field is 0.
  70. */
  71. __u32 deviceTreeOffset; /* Device tree offset */
  72. __u32 deviceTreeSize; /* Size of the device tree */
  73. /* Some infos about the current MacOS display */
  74. __u32 dispDeviceRect[4]; /* left,top,right,bottom */
  75. __u32 dispDeviceDepth; /* (8, 16 or 32) */
  76. __u8* dispDeviceBase; /* base address (physical) */
  77. __u32 dispDeviceRowBytes; /* rowbytes (in bytes) */
  78. __u32 dispDeviceColorsOffset; /* Colormap (8 bits only) or 0 (*) */
  79. /* Optional offset in the registry to the current
  80. * MacOS display. (Can be 0 when not detected) */
  81. __u32 dispDeviceRegEntryOffset;
  82. /* Optional pointer to boot ramdisk (offset from this structure) */
  83. __u32 ramDisk;
  84. __u32 ramDiskSize; /* size of ramdisk image */
  85. /* Kernel command line arguments (offset from this structure) */
  86. __u32 kernelParamsOffset;
  87. /* ALL BELOW NEW (vers. 4) */
  88. /* This defines the physical memory. Valid with BOOT_ARCH_NUBUS flag
  89. (non-PCI) only. On PCI, memory is contiguous and it's size is in the
  90. device-tree. */
  91. boot_info_map_entry_t
  92. physMemoryMap[MAX_MEM_MAP_SIZE]; /* Where the phys memory is */
  93. __u32 physMemoryMapSize; /* How many entries in map */
  94. /* The framebuffer size (optional, currently 0) */
  95. __u32 frameBufferSize; /* Represents a max size, can be 0. */
  96. /* NEW (vers. 5) */
  97. /* Total params size (args + colormap + device tree + ramdisk) */
  98. __u32 totalParamsSize;
  99. } boot_infos_t;
  100. #ifdef macintosh
  101. #pragma options align=reset
  102. #endif
  103. #endif /* _UAPI__ASM_BOOTX_H__ */