1 /*
2  * Copyright (c) 2014 Travis Geiselbrecht
3  *
4  * Use of this source code is governed by a MIT-style
5  * license that can be found in the LICENSE file or at
6  * https://opensource.org/licenses/MIT
7  */
8 #pragma once
9 
10 #include <stdint.h>
11 #include <stdbool.h>
12 #include <sys/types.h>
13 
14 /* recovering boot arguments that were passed */
15 bool bootargs_are_valid(void);
16 const char *bootargs_get_command_line(void);
17 status_t bootargs_get_bootimage_pointer(uint64_t *offset, size_t *len, const char **device);
18 
19 /* constructing boot arguments */
20 status_t bootargs_start(void *buf, size_t buf_len);
21 status_t bootargs_add_command_line(void *buf, size_t buf_len, const char *str);
22 status_t bootargs_add_bootimage_pointer(void *buf, size_t buf_len, const char *device, uint64_t offset, size_t len);
23 
24 /* build 4 ulong arguments to pass to a second stage */
25 void bootargs_generate_lk_arg_values(ulong buf, ulong args[4]);
26 
27