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