/* Keep in sync with trampoline.S:early_boot_opts label! */
typedef struct __packed {
- u8 skip_realmode;
- u8 opt_edd;
- u8 opt_edid;
- u8 padding;
+ uint8_t skip_realmode;
+ uint8_t opt_edd;
+ uint8_t opt_edid;
+ uint8_t padding;
#ifdef CONFIG_VIDEO
- u16 boot_vid_mode;
- u16 vesa_width;
- u16 vesa_height;
- u16 vesa_depth;
+ uint16_t boot_vid_mode;
+ uint16_t vesa_width;
+ uint16_t vesa_height;
+ uint16_t vesa_depth;
#endif
} early_boot_opts_t;
return find_opt(cmdline, "no-real-mode", false) || find_opt(cmdline, "tboot=", true);
}
-static u8 edd_parse(const char *cmdline)
+static uint8_t edd_parse(const char *cmdline)
{
const char *c;
return !strmaxcmp(c, "skipmbr", delim_chars);
}
-static u8 edid_parse(const char *cmdline)
+static uint8_t edid_parse(const char *cmdline)
{
const char *c;
}
#ifdef CONFIG_VIDEO
-static u16 rows2vmode(unsigned int rows)
+static uint16_t rows2vmode(unsigned int rows)
{
switch ( rows )
{
{
vesa_width = strtoui(c + strlen("gfx-"), "x", &c);
- if ( vesa_width > U16_MAX )
+ if ( vesa_width > UINT16_MAX )
return;
/*
++c;
vesa_height = strtoui(c, "x", &c);
- if ( vesa_height > U16_MAX )
+ if ( vesa_height > UINT16_MAX )
return;
vesa_depth = strtoui(++c, delim_chars_comma, NULL);
- if ( vesa_depth > U16_MAX )
+ if ( vesa_depth > UINT16_MAX )
return;
ebo->vesa_width = vesa_width;
{
tmp = strtoui(c + strlen("mode-"), delim_chars_comma, NULL);
- if ( tmp > U16_MAX )
+ if ( tmp > UINT16_MAX )
return;
ebo->boot_vid_mode = tmp;
#endif /* CONFIG_VIDEO */
#define get_mb2_data(tag, type, member) (((const multiboot2_tag_##type##_t *)(tag))->member)
-#define get_mb2_string(tag, type, member) ((u32)get_mb2_data(tag, type, member))
+#define get_mb2_string(tag, type, member) ((uint32_t)get_mb2_data(tag, type, member))
-static u32 alloc;
+static uint32_t alloc;
-static u32 alloc_mem(u32 bytes)
+static uint32_t alloc_mem(uint32_t bytes)
{
return alloc -= ALIGN_UP(bytes, 16);
}
-static void zero_mem(u32 s, u32 bytes)
+static void zero_mem(uint32_t s, uint32_t bytes)
{
while ( bytes-- )
*(char *)s++ = 0;
}
-static u32 copy_mem(u32 src, u32 bytes)
+static uint32_t copy_mem(uint32_t src, uint32_t bytes)
{
- u32 dst, dst_ret;
+ uint32_t dst, dst_ret;
dst = alloc_mem(bytes);
dst_ret = dst;
return dst_ret;
}
-static u32 copy_string(u32 src)
+static uint32_t copy_string(uint32_t src)
{
- u32 p;
+ uint32_t p;
if ( !src )
return 0;
return copy_mem(src, p - src + 1);
}
-static struct hvm_start_info *pvh_info_reloc(u32 in)
+static struct hvm_start_info *pvh_info_reloc(uint32_t in)
{
struct hvm_start_info *out;
return out;
}
-static multiboot_info_t *mbi_reloc(u32 mbi_in)
+static multiboot_info_t *mbi_reloc(uint32_t mbi_in)
{
int i;
multiboot_info_t *mbi_out;
#ifdef CONFIG_VIDEO
struct boot_video_info *video = NULL;
#endif
- u32 ptr;
+ uint32_t ptr;
unsigned int i, mod_idx = 0;
ptr = alloc_mem(sizeof(*mbi_out));
ptr = ALIGN_UP(mbi_in + sizeof(*mbi_fix), MULTIBOOT2_TAG_ALIGN);
/* Get the number of modules. */
- for ( tag = _p(ptr); (u32)tag - mbi_in < mbi_fix->total_size;
- tag = _p(ALIGN_UP((u32)tag + tag->size, MULTIBOOT2_TAG_ALIGN)) )
+ for ( tag = _p(ptr); (uint32_t)tag - mbi_in < mbi_fix->total_size;
+ tag = _p(ALIGN_UP((uint32_t)tag + tag->size, MULTIBOOT2_TAG_ALIGN)) )
{
if ( tag->type == MULTIBOOT2_TAG_TYPE_MODULE )
++mbi_out->mods_count;
ptr = ALIGN_UP(mbi_in + sizeof(*mbi_fix), MULTIBOOT2_TAG_ALIGN);
/* Put all needed data into mbi_out. */
- for ( tag = _p(ptr); (u32)tag - mbi_in < mbi_fix->total_size;
- tag = _p(ALIGN_UP((u32)tag + tag->size, MULTIBOOT2_TAG_ALIGN)) )
+ for ( tag = _p(ptr); (uint32_t)tag - mbi_in < mbi_fix->total_size;
+ tag = _p(ALIGN_UP((uint32_t)tag + tag->size, MULTIBOOT2_TAG_ALIGN)) )
{
switch ( tag->type )
{
mmap_dst[i].size = sizeof(*mmap_dst);
mmap_dst[i].size -= sizeof(mmap_dst[i].size);
/* Now copy a given region data. */
- mmap_dst[i].base_addr_low = (u32)mmap_src->addr;
- mmap_dst[i].base_addr_high = (u32)(mmap_src->addr >> 32);
- mmap_dst[i].length_low = (u32)mmap_src->len;
- mmap_dst[i].length_high = (u32)(mmap_src->len >> 32);
+ mmap_dst[i].base_addr_low = (uint32_t)mmap_src->addr;
+ mmap_dst[i].base_addr_high = (uint32_t)(mmap_src->addr >> 32);
+ mmap_dst[i].length_low = (uint32_t)mmap_src->len;
+ mmap_dst[i].length_high = (uint32_t)(mmap_src->len >> 32);
mmap_dst[i].type = mmap_src->type;
mmap_src = _p(mmap_src) + get_mb2_data(tag, mmap, entry_size);
}