vm: fix potential null deref
[minix.git] / commands / swifi / extra.h
blob89e40743c0229807627540b1724239e5ce8f449c
1 /*
2 Compatibility with the linux kernel environment
3 */
5 #include <nlist.h>
6 #include <errno.h>
7 #include <string.h>
8 #include <sys/types.h>
10 #if 0
11 struct module
13 struct module *next;
14 char *name;
16 extern struct module *module_list;
17 #endif
19 struct thread
21 unsigned long esp;
24 struct task_struct
26 struct thread thread;
27 struct task_struct *next;
30 unsigned long __get_free_page(int type);
31 void *kmalloc(size_t size, int type);
32 #define GFP_KERNEL 1
33 void free_page(unsigned long page);
34 void kfree(void *mem);
35 void vfree(void *mem);
37 size_t strncpy_from_user(char *addr, const char *user_name, size_t size);
39 void lock_kernel(void);
40 void unlock_kernel(void);
42 /* void __asm__(char *str); */
44 #define for_each_task(t) for(t= task_list; t; t=t->next)
45 extern struct task_struct *task_list;
47 typedef struct { int foo; } pgprot_t;
48 extern void *__vmalloc(unsigned long size, int gfp_mask, pgprot_t prot);
50 #define ElfW(type) Elf_ ## type
51 typedef unsigned long Elf_Addr;
52 typedef unsigned long Elf_Word;
54 void kallsyms_sections(void *infop,
55 int (*fp)(void *token, const char *modname, const char *secname,
56 ElfW(Addr) secstart, ElfW(Addr) secend, ElfW(Word) secflags));
58 unsigned long __generic_copy_to_user(void *, const void *, unsigned long);
59 unsigned long __generic_copy_from_user(void *, const void *, unsigned long);
61 struct lock { int dummy; };
62 extern struct lock tasklist_lock;
63 void read_lock(struct lock *lock);
64 void read_unlock(struct lock *lock);
66 void udelay(unsigned long usecs);
68 int copy_to_user(void * result_record, void *res, size_t size);
70 void panic(char *str);
72 #define PAGE_SIZE (0x1000)
73 #define PAGE_MASK (0x0fff)
74 #define PAGE_OFFSET 0 /* What does this do? */
75 #define TASK_SIZE 0 /* What does this do? */
77 void printk(char *fmt, ...);
79 #include "ddb.h"
80 #include "db_machdep.h"
81 int kallsyms_address_to_symbol(db_expr_t off,
82 const char * *mod_name, unsigned long *mod_start, unsigned long *mod_end,
83 const char * *sec_name, unsigned long *sec_start, unsigned long *sec_end,
84 const char * *sym_name, unsigned long *sym_start, unsigned long *sym_end);
86 int read_nlist(const char *filenamer, struct nlist **nlist_table);
88 unsigned long text_read_ul(void *addr);
89 unsigned char text_read_ub(void *addr);
90 void text_write_ul(void *addr, unsigned long value);
91 void text_write_ub(void *addr, unsigned char value);
93 extern pid_t victim_pid;
94 extern char *victim_exe;
96 void load_nlist(char *exe_name, unsigned long *btextp, unsigned long *etextp);