blob: 08a0f375c4cc965e0372a4894aba892297922901 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#include "mboot.h"
void *locate_mboot_table(volatile void *mboot, uint32_t type)
{
struct mboot_info *info = (struct mboot_info *) mboot;
const char *mboot_end = ((char *) info) + info->total_size;
char *tag_ptr = info->tags;
while (tag_ptr < mboot_end) {
struct mboot_tag *tag = (struct mboot_tag *) tag_ptr;
if (tag->type == type)
return tag;
// goto next
int size = tag->size;
if (size % 8 != 0) {
size += 8 - (size % 8);
}
tag_ptr += size;
}
return NULL;
}
|