MOS Source Code
Loading...
Searching...
No Matches
kallsyms.c
Go to the documentation of this file.
1
// SPDX-License-Identifier: GPL-3.0-or-later
2
3
#include "
mos/misc/kallsyms.h
"
4
5
const
kallsyms_t
*
kallsyms_get_symbol
(
ptr_t
addr)
6
{
7
// kallsyms are sorted by address
8
const
kallsyms_t
*ks =
mos_kallsyms
;
9
const
kallsyms_t
*result =
NULL
;
10
11
while
(ks->
name
)
12
{
13
if
(ks->
address
> addr)
14
break
;
15
result = ks;
16
ks++;
17
}
18
19
return
result;
20
}
21
22
const
char
*
kallsyms_get_symbol_name
(
ptr_t
addr)
23
{
24
const
kallsyms_t
*ks =
kallsyms_get_symbol
(addr);
25
return
ks ? ks->
name
:
"<unknown>"
;
26
}
kallsyms_get_symbol
const kallsyms_t * kallsyms_get_symbol(ptr_t addr)
Definition
kallsyms.c:5
kallsyms_get_symbol_name
const char * kallsyms_get_symbol_name(ptr_t addr)
Definition
kallsyms.c:22
kallsyms.h
mos_kallsyms
const kallsyms_t mos_kallsyms[]
Definition
mos_limine.kallsyms.1.c:5
NULL
#define NULL
Definition
pb_syshdr.h:46
kallsyms_t
Definition
kallsyms.h:8
kallsyms_t::address
ptr_t address
Definition
kallsyms.h:9
kallsyms_t::name
const char * name
Definition
kallsyms.h:10
ptr_t
unsigned long ptr_t
Definition
types.h:25
kernel
misc
kallsyms.c
Generated on Sun Sep 1 2024 18:22:52 for MOS Source Code by
1.12.0