X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=qemu%2Froms%2FSLOF%2Fboard-qemu%2Fslof%2Fvirtio.fs;fp=qemu%2Froms%2FSLOF%2Fboard-qemu%2Fslof%2Fvirtio.fs;h=818c1320ebe1ba5d48f980b1d7d27cea7fa4b384;hb=e44e3482bdb4d0ebde2d8b41830ac2cdb07948fb;hp=0000000000000000000000000000000000000000;hpb=9ca8dbcc65cfc63d6f5ef3312a33184e1d726e00;p=kvmfornfv.git diff --git a/qemu/roms/SLOF/board-qemu/slof/virtio.fs b/qemu/roms/SLOF/board-qemu/slof/virtio.fs new file mode 100644 index 000000000..818c1320e --- /dev/null +++ b/qemu/roms/SLOF/board-qemu/slof/virtio.fs @@ -0,0 +1,35 @@ +\ ***************************************************************************** +\ * Copyright (c) 2011 IBM Corporation +\ * All rights reserved. +\ * This program and the accompanying materials +\ * are made available under the terms of the BSD License +\ * which accompanies this distribution, and is available at +\ * http://www.opensource.org/licenses/bsd-license.php +\ * +\ * Contributors: +\ * IBM Corporation - initial implementation +\ ****************************************************************************/ + +\ This struct must match "struct virtio_device" in virtio.h! +STRUCT + /n FIELD vd>base + /l FIELD vd>type +CONSTANT /vd-len + + +\ Initialize virtiodev structure for the current node +: virtio-setup-vd ( vdstruct -- ) + >r + \ Does it have a "class-code" property? If yes, assume we're a PCI device + s" class-code" get-node get-property 0= IF + \ Set up for PCI device interface + 2drop + s" 10 config-l@ translate-my-address 3 not AND" evaluate + ( io-base ) r@ vd>base ! + 0 r@ vd>type l! + ELSE + ." unsupported virtio interface!" cr + 1 r@ vd>type l! + THEN + r> drop +;