Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


added forgotten files...
[palacios.git] / palacios / src / devices / i440fx.c
1 /* 
2  * This file is part of the Palacios Virtual Machine Monitor developed
3  * by the V3VEE Project with funding from the United States National 
4  * Science Foundation and the Department of Energy.  
5  *
6  * The V3VEE Project is a joint project between Northwestern University
7  * and the University of New Mexico.  You can find out more at 
8  * http://www.v3vee.org
9  *
10  * Copyright (c) 2008, Jack Lange <jarusl@cs.northwestern.edu> 
11  * Copyright (c) 2008, The V3VEE Project <http://www.v3vee.org> 
12  * All rights reserved.
13  *
14  * Author: Jack Lange <jarusl@cs.northwestern.edu>
15  *
16  * This is free software.  You are permitted to use,
17  * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
18  */
19
20 #include <palacios/vmm.h>
21 #include <devices/i440fx.h>
22
23 struct i440_state {
24     int foo;
25 };
26
27
28 static int io_read(ushort_t port, void * dst, uint_t length, struct vm_device * dev) {
29     PrintError("Unhandled read on port %x\n", port);
30     return -1;
31 }
32
33 static int io_write(ushort_t port, void * src, uint_t length, struct vm_device * dev) {
34     PrintError("Unhandled write on port %x\n", port);
35     return -1;
36 }
37
38
39 static int i440_init(struct vm_device * dev) {
40     // struct i440_state * state = (struct i440_state *)(dev->private_data);
41
42    
43     v3_dev_hook_io(dev, 0x00b2, 
44                    &io_read, &io_write);
45     v3_dev_hook_io(dev, 0x00b3, 
46                    &io_read, &io_write);
47
48
49     v3_dev_hook_io(dev, 0x0cf8, 
50                    &io_read, &io_write);
51
52
53
54     v3_dev_hook_io(dev, 0x0cf9, 
55                    &io_read, &io_write);
56
57
58
59     return 0;
60 }
61
62
63 static int i440_deinit(struct vm_device * dev) {
64     return 0;
65 }
66
67 static struct vm_device_ops dev_ops = {
68     .init = i440_init, 
69     .deinit = i440_deinit,
70     .reset = NULL,
71     .start = NULL,
72     .stop = NULL,
73 };
74
75
76
77 struct vm_device * v3_create_i440fx(struct vm_device * pci) {
78
79     struct i440_state * state = NULL;
80
81
82     state = (struct i440_state *)V3_Malloc(sizeof(struct i440_state));
83         
84     struct vm_device * i440_dev = v3_create_device("i440FX", &dev_ops, state);
85
86     return i440_dev;
87
88 }