Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NuttX RTOS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
f4grx
NuttX RTOS
Commits
917dbc85
Commit
917dbc85
authored
9 years ago
by
Gregory Nutt
Browse files
Options
Downloads
Patches
Plain Diff
modules: Add more information to registry just for procfs
parent
795ddd7e
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
sched/module/mod_insmod.c
+7
-1
7 additions, 1 deletion
sched/module/mod_insmod.c
sched/module/mod_procfs.c
+6
-3
6 additions, 3 deletions
sched/module/mod_procfs.c
sched/module/mod_rmmod.c
+7
-1
7 additions, 1 deletion
sched/module/mod_rmmod.c
sched/module/module.h
+7
-1
7 additions, 1 deletion
sched/module/module.h
with
27 additions
and
6 deletions
sched/module/mod_insmod.c
+
7
−
1
View file @
917dbc85
...
...
@@ -249,11 +249,17 @@ int insmod(FAR const char *filename, FAR const char *modulename,
/* Return the load information */
modp
->
alloc
=
(
FAR
void
*
)
loadinfo
.
textalloc
;
modp
->
size
=
loadinfo
.
textsize
+
loadinfo
.
datasize
;
#if defined(CONFIG_FS_PROCFS) && !defined(CONFIG_FS_PROCFS_EXCLUDE_MODULE)
modp
->
textsize
=
loadinfo
.
textsize
;
modp
->
datasize
=
loadinfo
.
datasize
;
#endif
/* Get the module initializer entry point */
initializer
=
(
mod_initializer_t
)(
loadinfo
.
textalloc
+
loadinfo
.
ehdr
.
e_entry
);
#if defined(CONFIG_FS_PROCFS) && !defined(CONFIG_FS_PROCFS_EXCLUDE_MODULE)
modp
->
initializer
=
initializer
;
#endif
mod_dumpinitializer
(
initializer
,
&
loadinfo
);
/* Call the module initializer */
...
...
This diff is collapsed.
Click to expand it.
sched/module/mod_procfs.c
+
6
−
3
View file @
917dbc85
...
...
@@ -152,9 +152,12 @@ static int modprocfs_callback(FAR struct module_s *modp, FAR void *arg)
DEBUGASSERT
(
modp
!=
NULL
&&
arg
!=
NULL
);
priv
=
(
FAR
struct
modprocfs_file_s
*
)
arg
;
linesize
=
snprintf
(
priv
->
line
,
MOD_LINELEN
,
"%s,%p,%p,%p,%lu
\n
"
,
modp
->
modulename
,
modp
->
uninitializer
,
modp
->
arg
,
modp
->
alloc
,
(
unsigned
long
)
modp
->
size
);
linesize
=
snprintf
(
priv
->
line
,
MOD_LINELEN
,
"%s,%p,%p,%p,%p,%lu,%p,%lu
\n
"
,
modp
->
modulename
,
modp
->
initializer
,
modp
->
uninitializer
,
modp
->
arg
,
modp
->
alloc
,
(
unsigned
long
)
modp
->
textsize
,
(
FAR
uint8_t
*
)
modp
->
alloc
+
modp
->
textsize
,
(
unsigned
long
)
modp
->
datasize
);
copysize
=
procfs_memcpy
(
priv
->
line
,
linesize
,
priv
->
buffer
,
priv
->
remaining
,
&
priv
->
offset
);
priv
->
totalsize
+=
copysize
;
...
...
This diff is collapsed.
Click to expand it.
sched/module/mod_rmmod.c
+
7
−
1
View file @
917dbc85
...
...
@@ -111,6 +111,9 @@ int rmmod(FAR const char *modulename)
/* Nullify so that the uninitializer cannot be called again */
#if defined(CONFIG_FS_PROCFS) && !defined(CONFIG_FS_PROCFS_EXCLUDE_MODULE)
modp
->
initializer
=
NULL
;
#endif
modp
->
uninitializer
=
NULL
;
modp
->
arg
=
NULL
;
}
...
...
@@ -126,7 +129,10 @@ int rmmod(FAR const char *modulename)
/* Nullify so that the memory cannot be freed again */
modp
->
alloc
=
NULL
;
modp
->
size
=
0
;
#if defined(CONFIG_FS_PROCFS) && !defined(CONFIG_FS_PROCFS_EXCLUDE_MODULE)
modp
->
textsize
=
0
;
modp
->
datasize
=
0
;
#endif
}
/* Remove the module from the registry */
...
...
This diff is collapsed.
Click to expand it.
sched/module/module.h
+
7
−
1
View file @
917dbc85
...
...
@@ -59,10 +59,16 @@ struct module_s
{
FAR
struct
module_s
*
flink
;
/* Supports a singly linked list */
FAR
char
modulename
[
MODULENAME_MAX
];
/* Module name */
#if defined(CONFIG_FS_PROCFS) && !defined(CONFIG_FS_PROCFS_EXCLUDE_MODULE)
mod_initializer_t
initializer
;
/* Module initializer function */
#endif
mod_uninitializer_t
uninitializer
;
/* Module uninitializer function */
FAR
void
*
arg
;
/* Uninitializer argument */
FAR
void
*
alloc
;
/* Allocated kernel memory */
size_t
size
;
/* Size of the kernel memory allocation */
#if defined(CONFIG_FS_PROCFS) && !defined(CONFIG_FS_PROCFS_EXCLUDE_MODULE)
size_t
textsize
;
/* Size of the kernel .text memory allocation */
size_t
datasize
;
/* Size of the kernel .bss/.data memory allocation */
#endif
};
/* This struct provides a description of the currently loaded instantiation
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment