iPXE
|
#include <hci/linux_args.h>
#include <getopt.h>
#include <string.h>
#include <stdio.h>
#include <ipxe/settings.h>
#include <ipxe/linux.h>
#include <ipxe/malloc.h>
#include <ipxe/init.h>
Go to the source code of this file.
Functions | |
FILE_LICENCE (GPL2_OR_LATER) | |
__asmcall void | save_args (int argc, char **argv) |
Save argc and argv for later access. More... | |
static int | parse_kv (char *kv, struct list_head *list) |
Parse k1=v1[,k2=v2]* into linux_settings. More... | |
static int | parse_net_args (char *args) |
Parse –net arguments. More... | |
static int | parse_settings_args (char *args) |
Parse –settings arguments. More... | |
void | linux_args_parse () |
Parse passed command-line arguments. More... | |
void | linux_args_cleanup (int flags __unused) |
Clean up requests and settings. More... | |
struct startup_fn startup_linux_args | __startup_fn (STARTUP_EARLY) |
Variables | |
static int | saved_argc = 0 |
Saved argc. More... | |
static char ** | saved_argv |
Saved argv. More... | |
static struct option | options [] |
Supported command-line options. More... | |
FILE_LICENCE | ( | GPL2_OR_LATER | ) |
__asmcall void save_args | ( | int | argc, |
char ** | argv | ||
) |
Save argc and argv for later access.
To be called by linuxprefix
Definition at line 40 of file linux_args.c.
References saved_argc, and saved_argv.
|
static |
Parse k1=v1[,k2=v2]* into linux_settings.
Definition at line 56 of file linux_args.c.
References DBG, linux_setting::list, list_add, malloc(), setting::name, name, NULL, strsep(), token, and value.
Referenced by parse_net_args(), and parse_settings_args().
|
static |
Parse –net arguments.
Format is –net driver_name[,name=value]*
Definition at line 92 of file linux_args.c.
References linux_device_request::driver, INIT_LIST_HEAD, linux_device_requests, linux_device_request::list, list_add_tail, malloc(), parse_kv(), printf(), rc, linux_device_request::settings, strlen(), and strsep().
Referenced by linux_args_parse().
|
static |
Parse –settings arguments.
Format is –settings name=value[,name=value]*
Definition at line 125 of file linux_args.c.
References linux_global_settings, and parse_kv().
Referenced by linux_args_parse().
void linux_args_parse | ( | ) |
Parse passed command-line arguments.
Definition at line 132 of file linux_args.c.
References c, getopt_long(), optarg, options, parse_net_args(), parse_settings_args(), rc, reset_getopt(), saved_argc, and saved_argv.
void linux_args_cleanup | ( | int flags | __unused | ) |
Clean up requests and settings.
Definition at line 163 of file linux_args.c.
References free, linux_device_requests, linux_global_settings, linux_setting::list, list_del, list_for_each_entry_safe, and request.
struct startup_fn startup_linux_args __startup_fn | ( | STARTUP_EARLY | ) |
|
static |
Saved argc.
Definition at line 31 of file linux_args.c.
Referenced by linux_args_parse(), and save_args().
|
static |
Saved argv.
Definition at line 33 of file linux_args.c.
Referenced by linux_args_parse(), and save_args().
|
static |
Supported command-line options.
Definition at line 47 of file linux_args.c.
Referenced by linux_args_parse().