This source file includes following definitions.
- oom
1 #ifndef _MM_H
2 #define _MM_H
3
4 #define PAGE_SIZE 4096
5
6 #include <linux/fs.h>
7 #include <linux/kernel.h>
8 #include <signal.h>
9
10 extern unsigned int swap_device;
11 extern struct inode * swap_file;
12
13 extern void rw_swap_page(int rw, unsigned int nr, char * buf);
14
15 #define read_swap_page(nr,buf) \
16 rw_swap_page(READ,(nr),(buf))
17 #define write_swap_page(nr,buf) \
18 rw_swap_page(WRITE,(nr),(buf))
19
20 extern unsigned long get_free_page(void);
21 extern unsigned long put_dirty_page(unsigned long page,unsigned long address);
22 extern void free_page(unsigned long addr);
23 void swap_free(int page_nr);
24 void swap_in(unsigned long *table_ptr);
25
26 extern inline volatile void oom(void)
27 {
28 printk("out of memory\n\r");
29 do_exit(SIGSEGV);
30 }
31
32 #define invalidate() \
33 __asm__("movl %%eax,%%cr3"::"a" (0))
34
35
36 #define LOW_MEM 0x100000
37 extern unsigned long HIGH_MEMORY;
38 #define PAGING_MEMORY (15*1024*1024)
39 #define PAGING_PAGES (PAGING_MEMORY>>12)
40 #define MAP_NR(addr) (((addr)-LOW_MEM)>>12)
41 #define USED 100
42
43 extern unsigned char mem_map [ PAGING_PAGES ];
44
45 #define PAGE_DIRTY 0x40
46 #define PAGE_ACCESSED 0x20
47 #define PAGE_USER 0x04
48 #define PAGE_RW 0x02
49 #define PAGE_PRESENT 0x01
50
51 #endif