processor family.
aboutsummaryrefslogblamecommitdiffstats
path: root/lib/cmdline.c
blob: eb6791188cf51a19b22861ea23909f93be08935d (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14













                                                                          
                         


                         
















                                                                      









                                                                           



                                                  














                                            

                         










                                                                  

                                                                          















                                                                 











                                                                        










                                                                 
                                                                             








                                                                      
                                                           
 
                                                                   
 


                                                                  








                           
                         


                      



                                 






                           
/*
 * linux/lib/cmdline.c
 * Helper functions generally used for parsing kernel command line
 * and module options.
 *
 * Code and copyrights come from init/main.c and arch/i386/kernel/setup.c.
 *
 * This source code is licensed under the GNU General Public License,
 * Version 2.  See the file COPYING for more details.
 *
 * GNU Indent formatting options for this file: -kr -i8 -npsl -pcs
 *
 */

#include <linux/export.h>
#include <linux/kernel.h>
#include <linux/string.h>

/*
 *	If a hyphen was found in get_option, this will handle the
 *	range of numbers, M-N.  This will expand the range and insert
 *	the values[M, M+1, ..., N] into the ints array in get_options.
 */

static int get_range(char **str, int *pint)
{
	int x, inc_counter, upper_range;

	(*str)++;
	upper_range = simple_strtol((*str), NULL, 0);
	inc_counter = upper_range - *pint;
	for (x = *pint; x < upper_range; x++)
		*pint++ = x;
	return inc_counter;
}

/**
 *	get_option - Parse integer from an option string
 *	@str: option string
 *	@pint: (output) integer value parsed from @str
 *
 *	Read an int from an option string; if available accept a subsequent
 *	comma as well.
 *
 *	Return values: