]> git.proxmox.com Git - mirror_edk2.git/blob - ArmPkg/Library/BdsLib/BdsLinuxLoader.h
ArmPkg/BdsLib: Add missing BdsLoadOption.c file
[mirror_edk2.git] / ArmPkg / Library / BdsLib / BdsLinuxLoader.h
1 /** @file
2 *
3 * Copyright (c) 2011, ARM Limited. All rights reserved.
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
18 #define ATAG_MAX_SIZE 0x3000
19
20 /* ATAG : list of possible tags */
21 #define ATAG_NONE 0x00000000
22 #define ATAG_CORE 0x54410001
23 #define ATAG_MEM 0x54410002
24 #define ATAG_VIDEOTEXT 0x54410003
25 #define ATAG_RAMDISK 0x54410004
26 #define ATAG_INITRD2 0x54420005
27 #define ATAG_SERIAL 0x54410006
28 #define ATAG_REVISION 0x54410007
29 #define ATAG_VIDEOLFB 0x54410008
30 #define ATAG_CMDLINE 0x54410009
31 #define ATAG_ARM_MP_CORE 0x5441000A
32
33 /* structures for each atag */
34 typedef struct {
35 UINT32 size; /* length of tag in words including this header */
36 UINT32 type; /* tag type */
37 } LINUX_ATAG_HEADER;
38
39 typedef struct {
40 UINT32 flags;
41 UINT32 pagesize;
42 UINT32 rootdev;
43 } LINUX_ATAG_CORE;
44
45 typedef struct {
46 UINT32 size;
47 UINTN start;
48 } LINUX_ATAG_MEM;
49
50 typedef struct {
51 UINT8 x;
52 UINT8 y;
53 UINT16 video_page;
54 UINT8 video_mode;
55 UINT8 video_cols;
56 UINT16 video_ega_bx;
57 UINT8 video_lines;
58 UINT8 video_isvga;
59 UINT16 video_points;
60 } LINUX_ATAG_VIDEOTEXT;
61
62 typedef struct {
63 UINT32 flags;
64 UINT32 size;
65 UINTN start;
66 } LINUX_ATAG_RAMDISK;
67
68 typedef struct {
69 UINT32 start;
70 UINT32 size;
71 } LINUX_ATAG_INITRD2;
72
73 typedef struct {
74 UINT32 low;
75 UINT32 high;
76 } LINUX_ATAG_SERIALNR;
77
78 typedef struct {
79 UINT32 rev;
80 } LINUX_ATAG_REVISION;
81
82 typedef struct {
83 UINT16 lfb_width;
84 UINT16 lfb_height;
85 UINT16 lfb_depth;
86 UINT16 lfb_linelength;
87 UINT32 lfb_base;
88 UINT32 lfb_size;
89 UINT8 red_size;
90 UINT8 red_pos;
91 UINT8 green_size;
92 UINT8 green_pos;
93 UINT8 blue_size;
94 UINT8 blue_pos;
95 UINT8 rsvd_size;
96 UINT8 rsvd_pos;
97 } LINUX_ATAG_VIDEOLFB;
98
99 typedef struct {
100 CHAR8 cmdline[1];
101 } LINUX_ATAG_CMDLINE;
102
103 typedef struct {
104 LINUX_ATAG_HEADER header;
105 union {
106 LINUX_ATAG_CORE core_tag;
107 LINUX_ATAG_MEM mem_tag;
108 LINUX_ATAG_VIDEOTEXT videotext_tag;
109 LINUX_ATAG_RAMDISK ramdisk_tag;
110 LINUX_ATAG_INITRD2 initrd2_tag;
111 LINUX_ATAG_SERIALNR serialnr_tag;
112 LINUX_ATAG_REVISION revision_tag;
113 LINUX_ATAG_VIDEOLFB videolfb_tag;
114 LINUX_ATAG_CMDLINE cmdline_tag;
115 } body;
116 } LINUX_ATAG;
117
118 typedef VOID (*LINUX_KERNEL)(UINT32 Zero, UINT32 Arch, UINTN ParametersBase);
119
120 #define next_tag_address(t) ((LINUX_ATAG*)((UINT32)(t) + (((t)->header.size) << 2) ))
121 #define tag_size(type) ((UINT32)((sizeof(LINUX_ATAG_HEADER) + sizeof(type)) >> 2))
122
123 #endif