@@ -125,7 +125,15 @@ static void mem_load(hart_t *hart,
125125 return ;
126126 }
127127
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_______ */
129137 /* 256 regions of 1MiB */
130138 switch ((addr >> 20 ) & MASK (8 )) {
131139 case 0x0 :
@@ -192,7 +200,15 @@ static void mem_store(hart_t *hart,
192200 return ;
193201 }
194202
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_______ */
196212 /* 256 regions of 1MiB */
197213 switch ((addr >> 20 ) & MASK (8 )) {
198214 case 0x0 :
@@ -668,6 +684,9 @@ static int semu_init(emu_state_t *emu, int argc, char **argv)
668684 /* Set up peripherals */
669685 emu -> uart .in_fd = 0 , emu -> uart .out_fd = 1 ;
670686 capture_keyboard_input (); /* set up uart */
687+ #if SEMU_HAS (VIRTIOPCI )
688+ virtio_pci_init (& (emu -> vpci ));
689+ #endif
671690#if SEMU_HAS (VIRTIONET )
672691 if (!virtio_net_init (& (emu -> vnet ), netdev ))
673692 fprintf (stderr , "No virtio-net functioned\n" );
0 commit comments