MCPcopy Create free account
hub / github.com/coreboot/coreboot / main

Function main

util/sconfig/main.c:1978–2106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1976}
1977
1978int main(int argc, char **argv)
1979{
1980 static const struct option long_options[] = {
1981 { "mainboard_devtree", required_argument, NULL, 'm' },
1982 { "override_devtree", required_argument, NULL, 'o' },
1983 { "chipset_devtree", required_argument, NULL, 'p' },
1984 { "output_c", required_argument, NULL, 'c' },
1985 { "output_h", required_argument, NULL, 'r' },
1986 { "output_d", required_argument, NULL, 'd' },
1987 { "output_f", required_argument, NULL, 'f' },
1988 { "help", no_argument, NULL, 'h' },
1989 { }
1990 };
1991 const char *override_devtree = NULL;
1992 const char *base_devtree = NULL;
1993 const char *chipset_devtree = NULL;
1994 const char *outputc = NULL;
1995 const char *outputh = NULL;
1996 const char *outputd = NULL;
1997 const char *outputf = NULL;
1998 int opt, option_index;
1999
2000 while ((opt = getopt_long(argc, argv, "m:o:p:c:r:d:f:h", long_options,
2001 &option_index)) != EOF) {
2002 switch (opt) {
2003 case 'm':
2004 base_devtree = optarg;
2005 break;
2006 case 'o':
2007 override_devtree = optarg;
2008 break;
2009 case 'p':
2010 chipset_devtree = optarg;
2011 break;
2012 case 'c':
2013 outputc = optarg;
2014 break;
2015 case 'r':
2016 outputh = optarg;
2017 break;
2018 case 'd':
2019 outputd = optarg;
2020 break;
2021 case 'f':
2022 outputf = optarg;
2023 break;
2024 case 'h':
2025 default:
2026 usage();
2027 }
2028 }
2029
2030 if (!base_devtree || !outputc || !outputh || !outputd || !outputf)
2031 usage();
2032
2033 if (chipset_devtree) {
2034 /* Use the chipset devicetree as the base, then override
2035 with the mainboard "base" devicetree. */

Callers

nothing calls this directly

Calls 15

getopt_longFunction · 0.85
fopenFunction · 0.85
fprintfFunction · 0.85
perrorFunction · 0.85
exitFunction · 0.85
fcloseFunction · 0.85
generate_outputhFunction · 0.85
generate_outputcFunction · 0.85
generate_outputdFunction · 0.85
generate_outputfFunction · 0.85
usageFunction · 0.70

Tested by

no test coverage detected