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
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
23{
24 const kallsyms_t *ks = kallsyms_get_symbol(addr);
25 return ks ? ks->name : "<unknown>";
26}
const kallsyms_t * kallsyms_get_symbol(ptr_t addr)
Definition kallsyms.c:5
const char * kallsyms_get_symbol_name(ptr_t addr)
Definition kallsyms.c:22
const kallsyms_t mos_kallsyms[]
#define NULL
Definition pb_syshdr.h:46
ptr_t address
Definition kallsyms.h:9
const char * name
Definition kallsyms.h:10
unsigned long ptr_t
Definition types.h:25