forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
module: Move kdb module related code out of main kdb code
No functional change. This patch migrates the kdb 'lsmod' command support out of main kdb code into its own file under kernel/module. In addition to the above, a minor style warning i.e. missing a blank line after declarations, was resolved too. The new file was added to MAINTAINERS. Finally we remove linux/module.h as it is entirely redundant. Reviewed-by: Daniel Thompson <[email protected]> Acked-by: Daniel Thompson <[email protected]> Signed-off-by: Aaron Tomlin <[email protected]> Signed-off-by: Luis Chamberlain <[email protected]>
- Loading branch information
Showing
10 changed files
with
59 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10907,6 +10907,7 @@ F: drivers/tty/serial/kgdboc.c | |
F: include/linux/kdb.h | ||
F: include/linux/kgdb.h | ||
F: kernel/debug/ | ||
F: kernel/module/kdb.c | ||
|
||
KHADAS MCU MFD DRIVER | ||
M: Neil Armstrong <[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
/* | ||
* Module kdb support | ||
* | ||
* Copyright (C) 2010 Jason Wessel | ||
*/ | ||
|
||
#include <linux/module.h> | ||
#include <linux/kdb.h> | ||
#include "internal.h" | ||
|
||
/* | ||
* kdb_lsmod - This function implements the 'lsmod' command. Lists | ||
* currently loaded kernel modules. | ||
* Mostly taken from userland lsmod. | ||
*/ | ||
int kdb_lsmod(int argc, const char **argv) | ||
{ | ||
struct module *mod; | ||
|
||
if (argc != 0) | ||
return KDB_ARGCOUNT; | ||
|
||
kdb_printf("Module Size modstruct Used by\n"); | ||
list_for_each_entry(mod, &modules, list) { | ||
if (mod->state == MODULE_STATE_UNFORMED) | ||
continue; | ||
|
||
kdb_printf("%-20s%8u 0x%px ", mod->name, | ||
mod->core_layout.size, (void *)mod); | ||
#ifdef CONFIG_MODULE_UNLOAD | ||
kdb_printf("%4d ", module_refcount(mod)); | ||
#endif | ||
if (mod->state == MODULE_STATE_GOING) | ||
kdb_printf(" (Unloading)"); | ||
else if (mod->state == MODULE_STATE_COMING) | ||
kdb_printf(" (Loading)"); | ||
else | ||
kdb_printf(" (Live)"); | ||
kdb_printf(" 0x%px", mod->core_layout.base); | ||
|
||
#ifdef CONFIG_MODULE_UNLOAD | ||
{ | ||
struct module_use *use; | ||
|
||
kdb_printf(" [ "); | ||
list_for_each_entry(use, &mod->source_list, | ||
source_list) | ||
kdb_printf("%s ", use->target->name); | ||
kdb_printf("]\n"); | ||
} | ||
#endif | ||
} | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters