On 09/25/13 19:16, Laszlo Ersek wrote:
> On 09/23/13 15:37, Olivier Martin wrote:

>> diff --git a/OvmfPkg/VirtioPciDeviceDxe/VirtioPciFunctions.c 
>> b/OvmfPkg/VirtioPciDeviceDxe/VirtioPciFunctions.c
>> new file mode 100644
>> index 0000000..15c4348
>> --- /dev/null
>> +++ b/OvmfPkg/VirtioPciDeviceDxe/VirtioPciFunctions.c
>> @@ -0,0 +1,288 @@
>> +/** @file
>> +
>> +  This driver produces Virtio Device Protocol instances for Virtio PCI 
>> devices.
>> +
>> +  Copyright (C) 2012, Red Hat, Inc.
>> +  Copyright (c) 2012, Intel Corporation. All rights reserved.<BR>
>> +  Copyright (C) 2013, ARM Ltd.
>> +
>> +  This program and the accompanying materials are licensed and made 
>> available
>> +  under the terms and conditions of the BSD License which accompanies this
>> +  distribution. The full text of the license may be found at
>> +  http://opensource.org/licenses/bsd-license.php
>> +
>> +  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 
>> WITHOUT
>> +  WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
>> +
>> +**/
>> +#include <Library/BaseMemoryLib.h>
>> +#include <Library/DebugLib.h>
>> +#include <Library/MemoryAllocationLib.h>
>> +#include <Library/UefiBootServicesTableLib.h>
>> +#include <Library/UefiLib.h>
>> +#include "VirtioPciDevice.h"
>> +
>> +#define VIRTIO_FEATURE_BITS_OFFSET              0
>> +#define VIRTIO_GUEST_FEATURE_BITS_OFFSET        4
>> +#define VIRTIO_QUEUE_ADDRESS_OFFSET             8
>> +#define VIRTIO_QUEUE_SIZE_OFFSET                12
>> +#define VIRTIO_QUEUE_SELECT_OFFSET              14
>> +#define VIRTIO_QUEUE_NOTIFY_OFFSET              16
>> +#define VIRTIO_QUEUE_DEVICE_STATUS_OFFSET       18
>> +#define VIRTIO_QUEUE_DEVICE_ISR_OFFSET          19
> 
> Seems precise, OK.

Actually, I missed one thing here:

I think these macro definitions should go into
"OvmfPkg/Include/IndustryStandard/Virtio.h", just above or below VIRTIO_HDR.

VIRTIO_HDR is going to be removed in patch #7. The offsets (both for
virtio-pci from this patch, and for virtio-mmio from patch #5) come
directly from the standard, and they take the place of VIRTIO_HDR. So
the offsets should go under Include/IndustryStandard too.

Thanks,
Laszlo

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to