root / Whitix / branches / hybrid / include / vmm.h

Revision 229, 2.2 kB (checked in by mwhitworth, 6 months ago)

Update pci.h to remove out-of-date header.

Line 
1/*  This file is part of Whitix.
2 *
3 *  Whitix is free software; you can redistribute it and/or modify
4 *  it under the terms of the GNU General Public License as published by
5 *  the Free Software Foundation; either version 2 of the License, or
6 *  (at your option) any later version.
7 *
8 *  Whitix is distributed in the hope that it will be useful,
9 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
10 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 *  GNU General Public License for more details.
12 *
13 *  You should have received a copy of the GNU General Public License
14 *  along with Whitix; if not, write to the Free Software
15 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
16 *
17 */
18
19/* FIXME: Rework VmAreaOps struct and design. */
20
21#ifndef VMM_H
22#define VMM_H
23
24#include <typedefs.h>
25#include <task.h>
26#include <wait.h>
27
28struct File;
29struct VmAreaOps;
30
31struct VMArea
32{
33        DWORD start,length,offset;
34        int flags;
35        int protection;
36        struct VNode* vNode;
37        struct VmAreaOps* areaOps;
38        struct ListHead list;
39        struct Process* process;
40};
41
42struct VMMapPage
43{
44        DWORD offset;
45        int flags;
46        struct ListHead list;
47        struct PhysPage* page;
48};
49
50/* Will be useful in paging. */
51struct VmAreaOps
52{
53        int (*handleNoPage)(struct VMArea* area, DWORD address, DWORD offset);
54        int (*addPage)(struct VMArea* area, DWORD address);
55};
56
57DWORD MMapDo(struct Process* process,struct VNode* vNode,DWORD address,DWORD length,int protection,DWORD offset,int flags, struct VmAreaOps* ops);
58int MmapHandleFault(struct Process* process,DWORD address,int error);
59void MmapProcessRemove(struct Process* process);
60struct VMArea* VmLookupAddress(struct Process* process,DWORD address);
61DWORD MMapFindAddress(struct Process* process,DWORD length);
62int MMapInit();
63
64/* General page fault errors */
65
66#define VM_PROTECTION 0x00000001
67#define VM_WRITE          0x00000002
68#define VM_USER           0x00000004
69
70/* MMapDo flags */
71#define MMAP_PRIVATE    0x00000000
72#define MMAP_SHARED             0x00000001
73#define MMAP_FIXED              0x00000002
74#define MMAP_GROWDOWN   0x00000004
75
76#define MPAGE_BUSY 0x00000001
77
78/* General mmap defines */
79#define MMAP_BASE       (0x800000)
80#define MMAP_END        (0xC0000000)
81
82#endif
Note: See TracBrowser for help on using the browser.