@@ -125,7 +125,15 @@ static void mem_load(hart_t *hart,
125
125
return ;
126
126
}
127
127
128
- if ((addr >> 28 ) == 0xF ) { /* MMIO at 0xF_______ */
128
+ /* TODO */
129
+ if (addr >= 0x100000 && addr <= 0x200000 ) {
130
+ printf ("!!!!!!!!!!!!!!!!!\n\n\n\n\n" );
131
+ }
132
+
133
+ if ((addr >> 28 ) == 0x2 ) { /* MMIO at 0x2_______ */
134
+ virtio_pci_read (hart , & data -> vsnd , addr , width , value );
135
+ return ;
136
+ } else if ((addr >> 28 ) == 0xF ) { /* MMIO at 0xF_______ */
129
137
/* 256 regions of 1MiB */
130
138
switch ((addr >> 20 ) & MASK (8 )) {
131
139
case 0x0 :
@@ -192,7 +200,15 @@ static void mem_store(hart_t *hart,
192
200
return ;
193
201
}
194
202
195
- if ((addr >> 28 ) == 0xF ) { /* MMIO at 0xF_______ */
203
+ /* TODO */
204
+ if (addr >= 0x100000 && addr <= 0x200000 ) {
205
+ printf ("!!!!!!!!!!!!!!!!!\n\n\n\n\n" );
206
+ }
207
+
208
+ if ((addr >> 28 ) == 0x2 ) { /* MMIO at 0x2_______ */
209
+ virtio_pci_write (hart , & data -> vsnd , addr , width , value );
210
+ return ;
211
+ } else if ((addr >> 28 ) == 0xF ) { /* MMIO at 0xF_______ */
196
212
/* 256 regions of 1MiB */
197
213
switch ((addr >> 20 ) & MASK (8 )) {
198
214
case 0x0 :
@@ -668,6 +684,9 @@ static int semu_init(emu_state_t *emu, int argc, char **argv)
668
684
/* Set up peripherals */
669
685
emu -> uart .in_fd = 0 , emu -> uart .out_fd = 1 ;
670
686
capture_keyboard_input (); /* set up uart */
687
+ #if SEMU_HAS (VIRTIOPCI )
688
+ virtio_pci_init (& (emu -> vpci ));
689
+ #endif
671
690
#if SEMU_HAS (VIRTIONET )
672
691
if (!virtio_net_init (& (emu -> vnet ), netdev ))
673
692
fprintf (stderr , "No virtio-net functioned\n" );
0 commit comments