mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
xen/init: Annotate all command line parameter infrastructure as const
There is no reason for any of it to be modified. Additionally, link .init.setup beside the other constant .init data. While editing this area, correct the types used in the extern declarations for __setup_start and __setup_end to match the types the linker actually produces. No functional change. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Reviewed-by: Jan Beulich <jbeulich@suse.com> Acked-by: Julien Grall <julien.grall@arm.com>
This commit is contained in:
1 parent
91b26a3591
commit
a6066af5b1
4 files changed
+19
-16
No files matched your search
@@ -135,6 +135,12 @@ SECTIONS
|
||||
*(.init.rodata)
|
||||
*(.init.rodata.rel)
|
||||
*(.init.rodata.str*)
|
||||
|
||||
. = ALIGN(POINTER_ALIGN);
|
||||
__setup_start = .;
|
||||
*(.init.setup)
|
||||
__setup_end = .;
|
||||
|
||||
*(.init.data)
|
||||
*(.init.data.rel)
|
||||
*(.init.data.rel.*)
|
||||
@@ -145,11 +151,6 @@ SECTIONS
|
||||
__ctors_end = .;
|
||||
} :text
|
||||
. = ALIGN(32);
|
||||
.init.setup : {
|
||||
__setup_start = .;
|
||||
*(.init.setup)
|
||||
__setup_end = .;
|
||||
} :text
|
||||
.init.proc.info : {
|
||||
__proc_info_start = .;
|
||||
*(.init.proc.info)
|
||||
|
||||
@@ -152,6 +152,12 @@ SECTIONS
|
||||
*(.init.rodata)
|
||||
*(.init.rodata.rel)
|
||||
*(.init.rodata.str*)
|
||||
|
||||
. = ALIGN(POINTER_ALIGN);
|
||||
__setup_start = .;
|
||||
*(.init.setup)
|
||||
__setup_end = .;
|
||||
|
||||
*(.init.data)
|
||||
*(.init.data.rel)
|
||||
*(.init.data.rel.*)
|
||||
@@ -178,11 +184,6 @@ SECTIONS
|
||||
__ctors_end = .;
|
||||
} :text
|
||||
. = ALIGN(32);
|
||||
.init.setup : {
|
||||
__setup_start = .;
|
||||
*(.init.setup)
|
||||
__setup_end = .;
|
||||
} :text
|
||||
.initcall.init : {
|
||||
__initcall_start = .;
|
||||
*(.initcallpresmp.init)
|
||||
|
||||
+3
-3
@@ -27,7 +27,7 @@ int tainted;
|
||||
xen_commandline_t saved_cmdline;
|
||||
|
||||
static void __init assign_integer_param(
|
||||
struct kernel_param *param, uint64_t val)
|
||||
const struct kernel_param *param, uint64_t val)
|
||||
{
|
||||
switch ( param->len )
|
||||
{
|
||||
@@ -52,7 +52,7 @@ void __init cmdline_parse(const char *cmdline)
|
||||
{
|
||||
char opt[100], *optval, *optkey, *q;
|
||||
const char *p = cmdline;
|
||||
struct kernel_param *param;
|
||||
const struct kernel_param *param;
|
||||
int bool_assert;
|
||||
|
||||
if ( cmdline == NULL )
|
||||
@@ -96,7 +96,7 @@ void __init cmdline_parse(const char *cmdline)
|
||||
if ( !bool_assert )
|
||||
optkey += 3;
|
||||
|
||||
for ( param = &__setup_start; param < &__setup_end; param++ )
|
||||
for ( param = __setup_start; param < __setup_end; param++ )
|
||||
{
|
||||
if ( strcmp(param->name, optkey) )
|
||||
{
|
||||
|
||||
@@ -86,10 +86,11 @@ struct kernel_param {
|
||||
void *var;
|
||||
};
|
||||
|
||||
extern struct kernel_param __setup_start, __setup_end;
|
||||
extern const struct kernel_param __setup_start[], __setup_end[];
|
||||
|
||||
#define __setup_str static __initdata __attribute__((__aligned__(1))) char
|
||||
#define __kparam static __initsetup \
|
||||
#define __setup_str static const __initconstrel \
|
||||
__attribute__((__aligned__(1))) char
|
||||
#define __kparam static const __initsetup \
|
||||
__attribute__((__aligned__(sizeof(void *)))) struct kernel_param
|
||||
|
||||
#define custom_param(_name, _var) \
|
||||
|
||||