forked from Stichting-MINIX-Research-Foundation/minix
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathextra.h
More file actions
96 lines (72 loc) · 2.42 KB
/
Copy pathextra.h
File metadata and controls
96 lines (72 loc) · 2.42 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*
Compatibility with the linux kernel environment
*/
#include <nlist.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#if 0
struct module
{
struct module *next;
char *name;
};
extern struct module *module_list;
#endif
struct thread
{
unsigned long esp;
};
struct task_struct
{
struct thread thread;
struct task_struct *next;
};
unsigned long __get_free_page(int type);
void *kmalloc(size_t size, int type);
#define GFP_KERNEL 1
void free_page(unsigned long page);
void kfree(void *mem);
void vfree(void *mem);
size_t strncpy_from_user(char *addr, const char *user_name, size_t size);
void lock_kernel(void);
void unlock_kernel(void);
/* void __asm__(char *str); */
#define for_each_task(t) for(t= task_list; t; t=t->next)
extern struct task_struct *task_list;
typedef struct { int foo; } pgprot_t;
extern void *__vmalloc(unsigned long size, int gfp_mask, pgprot_t prot);
#define ElfW(type) Elf_ ## type
typedef unsigned long Elf_Addr;
typedef unsigned long Elf_Word;
void kallsyms_sections(void *infop,
int (*fp)(void *token, const char *modname, const char *secname,
ElfW(Addr) secstart, ElfW(Addr) secend, ElfW(Word) secflags));
unsigned long __generic_copy_to_user(void *, const void *, unsigned long);
unsigned long __generic_copy_from_user(void *, const void *, unsigned long);
struct lock { int dummy; };
extern struct lock tasklist_lock;
void read_lock(struct lock *lock);
void read_unlock(struct lock *lock);
void udelay(unsigned long usecs);
int copy_to_user(void * result_record, void *res, size_t size);
void panic(char *str);
#define PAGE_SIZE (0x1000)
#define PAGE_MASK (0x0fff)
#define PAGE_OFFSET 0 /* What does this do? */
#define TASK_SIZE 0 /* What does this do? */
void printk(char *fmt, ...);
#include "ddb.h"
#include "db_machdep.h"
int kallsyms_address_to_symbol(db_expr_t off,
const char * *mod_name, unsigned long *mod_start, unsigned long *mod_end,
const char * *sec_name, unsigned long *sec_start, unsigned long *sec_end,
const char * *sym_name, unsigned long *sym_start, unsigned long *sym_end);
int read_nlist(const char *filenamer, struct nlist **nlist_table);
unsigned long text_read_ul(void *addr);
unsigned char text_read_ub(void *addr);
void text_write_ul(void *addr, unsigned long value);
void text_write_ub(void *addr, unsigned char value);
extern pid_t victim_pid;
extern char *victim_exe;
void load_nlist(char *exe_name, unsigned long *btextp, unsigned long *etextp);