-
Notifications
You must be signed in to change notification settings - Fork 0
/
kernel.c
42 lines (36 loc) · 888 Bytes
/
kernel.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <stdio.h>
#include "kernel.h"
#include "common.h"
/* FIXME */
unsigned long kernel_pgd[NR_CPUS];
extern struct mach_table *kcoreinfo;
/*
* For processors with "traditional" kernel/user address space distinction.
*/
int generic_is_kvaddr(unsigned long addr)
{
return (addr >= (unsigned long)(kcoreinfo->kvbase));
}
/*
* NOTE: Perhaps even this generic version should tighten up requirements
* by calling uvtop()?
*/
int generic_is_uvaddr(unsigned long addr, struct task_context *tc)
{
return (addr < (unsigned long)(kcoreinfo->kvbase));
}
/*
* vmlinux: including kernel symbol;
* modules.order:
* System.map: complied address and symbol name;
* compile_commands.json: .c file and deps files;
*
* these files can help KREAD to find func fastly.
*/
char *KERNEL_FILE[] = {
"vmlinux",
"Module.symvers",
"System.map",
"compile_commands.json",
NULL
};