]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPkg/Library/BdsLib/BdsLinuxLoader.h
ArmPkg/BdsLib: Fixed ShutdownUefiBootServices() in case the first gBS->GetMemoryMap...
[mirror_edk2.git] / ArmPkg / Library / BdsLib / BdsLinuxLoader.h
CommitLineData
1bfda055 1/** @file
2*
995d9676 3* Copyright (c) 2011-2012, ARM Limited. All rights reserved.
1bfda055 4*
5* This program and the accompanying materials
6* are licensed and made available under the terms and conditions of the BSD License
7* which accompanies this distribution. The full text of the license may be found at
8* http://opensource.org/licenses/bsd-license.php
9*
10* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12*
13**/
14
15#ifndef __BDSLINUXLOADER_H
16#define __BDSLINUXLOADER_H
17
995d9676 18#define LINUX_UIMAGE_SIGNATURE 0x56190527
19
76d17c31 20#define LINUX_ATAG_MAX_OFFSET (PcdGet32(PcdSystemMemoryBase) + PcdGet32(PcdArmLinuxAtagMaxOffset))
21#define LINUX_KERNEL_MAX_OFFSET (PcdGet32(PcdSystemMemoryBase) + PcdGet32(PcdArmLinuxKernelMaxOffset))
22
a355a365 23#define ATAG_MAX_SIZE 0x3000
1bfda055 24
25/* ATAG : list of possible tags */
26#define ATAG_NONE 0x00000000
27#define ATAG_CORE 0x54410001
28#define ATAG_MEM 0x54410002
29#define ATAG_VIDEOTEXT 0x54410003
30#define ATAG_RAMDISK 0x54410004
31#define ATAG_INITRD2 0x54420005
32#define ATAG_SERIAL 0x54410006
33#define ATAG_REVISION 0x54410007
34#define ATAG_VIDEOLFB 0x54410008
35#define ATAG_CMDLINE 0x54410009
36#define ATAG_ARM_MP_CORE 0x5441000A
37
1bfda055 38/* structures for each atag */
a355a365 39typedef struct {
1bfda055 40 UINT32 size; /* length of tag in words including this header */
41 UINT32 type; /* tag type */
a355a365 42} LINUX_ATAG_HEADER;
1bfda055 43
a355a365 44typedef struct {
1bfda055 45 UINT32 flags;
46 UINT32 pagesize;
47 UINT32 rootdev;
a355a365 48} LINUX_ATAG_CORE;
1bfda055 49
a355a365 50typedef struct {
1bfda055 51 UINT32 size;
52 UINTN start;
a355a365 53} LINUX_ATAG_MEM;
1bfda055 54
a355a365 55typedef struct {
1bfda055 56 UINT8 x;
57 UINT8 y;
58 UINT16 video_page;
59 UINT8 video_mode;
60 UINT8 video_cols;
61 UINT16 video_ega_bx;
62 UINT8 video_lines;
63 UINT8 video_isvga;
64 UINT16 video_points;
a355a365 65} LINUX_ATAG_VIDEOTEXT;
1bfda055 66
a355a365 67typedef struct {
1bfda055 68 UINT32 flags;
69 UINT32 size;
70 UINTN start;
a355a365 71} LINUX_ATAG_RAMDISK;
1bfda055 72
a355a365 73typedef struct {
1bfda055 74 UINT32 start;
75 UINT32 size;
a355a365 76} LINUX_ATAG_INITRD2;
1bfda055 77
a355a365 78typedef struct {
1bfda055 79 UINT32 low;
80 UINT32 high;
a355a365 81} LINUX_ATAG_SERIALNR;
1bfda055 82
a355a365 83typedef struct {
1bfda055 84 UINT32 rev;
a355a365 85} LINUX_ATAG_REVISION;
1bfda055 86
a355a365 87typedef struct {
1bfda055 88 UINT16 lfb_width;
89 UINT16 lfb_height;
90 UINT16 lfb_depth;
91 UINT16 lfb_linelength;
92 UINT32 lfb_base;
93 UINT32 lfb_size;
94 UINT8 red_size;
95 UINT8 red_pos;
96 UINT8 green_size;
97 UINT8 green_pos;
98 UINT8 blue_size;
99 UINT8 blue_pos;
100 UINT8 rsvd_size;
101 UINT8 rsvd_pos;
a355a365 102} LINUX_ATAG_VIDEOLFB;
1bfda055 103
a355a365 104typedef struct {
1bfda055 105 CHAR8 cmdline[1];
a355a365 106} LINUX_ATAG_CMDLINE;
1bfda055 107
a355a365 108typedef struct {
109 LINUX_ATAG_HEADER header;
1bfda055 110 union {
a355a365 111 LINUX_ATAG_CORE core_tag;
112 LINUX_ATAG_MEM mem_tag;
113 LINUX_ATAG_VIDEOTEXT videotext_tag;
114 LINUX_ATAG_RAMDISK ramdisk_tag;
115 LINUX_ATAG_INITRD2 initrd2_tag;
116 LINUX_ATAG_SERIALNR serialnr_tag;
117 LINUX_ATAG_REVISION revision_tag;
118 LINUX_ATAG_VIDEOLFB videolfb_tag;
119 LINUX_ATAG_CMDLINE cmdline_tag;
1bfda055 120 } body;
a355a365 121} LINUX_ATAG;
1bfda055 122
a355a365 123typedef VOID (*LINUX_KERNEL)(UINT32 Zero, UINT32 Arch, UINTN ParametersBase);
1bfda055 124
a355a365 125#define next_tag_address(t) ((LINUX_ATAG*)((UINT32)(t) + (((t)->header.size) << 2) ))
126#define tag_size(type) ((UINT32)((sizeof(LINUX_ATAG_HEADER) + sizeof(type)) >> 2))
1bfda055 127
128#endif