Skip to content

Commit

Permalink
link: add section for storing commandline parameters
Browse files Browse the repository at this point in the history
This commit is adding a dedicated ".cmdline" section for storing commandline
parameters found during the compilation process. This is later used during
runtime to loop over this section and compare passed commandline parameters with
known ones.

Signed-off-by: Martin Mazein <[email protected]>
  • Loading branch information
MegaMaddin committed Aug 26, 2020
1 parent 54f2ced commit 67660ec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/x86/link.ld
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ SECTIONS
. = ALIGN(4K);
__start_data = .;
*(.data)
__start_cmdline = .;
*(.cmdline)
__end_cmdline = .;
. = ALIGN(4K);
__end_data = .;
} :kernel
Expand Down
2 changes: 2 additions & 0 deletions include/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@
#define __user_data __section(".data.user")
#define __user_bss __section(".bss.user")

#define __cmdline __section(".cmdline")

#define barrier() asm volatile("" ::: "memory")
#define ACCESS_ONCE(x) (*(volatile typeof(x) *) &(x))

Expand Down

0 comments on commit 67660ec

Please sign in to comment.