summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/XenBusDxe
Commit message (Collapse)AuthorAgeFilesLines
* OvmfPkg/XenBusDxe: Fix initialisation of gXenBusDevicePathTemplateAnthony PERARD2014-10-311-7/+13
| | | | | | | | | | .. to avoid the use .member = value syntax as VS does not support it. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16296 6f19259b-4bc3-4df7-8a09-765794883524
* OvmfPkg/XenBusDxe: Fix initialisation of gXenBusPrivateDataAnthony PERARD2014-10-311-24/+29
| | | | | | | | | | .. to avoid the use .member = value syntax as VS does not support it. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16295 6f19259b-4bc3-4df7-8a09-765794883524
* OvmfPkg/Xen*: Pass struct XENSTORE_TRANSACTION argument as a pointerAnthony PERARD2014-10-313-31/+35
| | | | | | | | | | As EDK II does not allow calls with a struct. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16294 6f19259b-4bc3-4df7-8a09-765794883524
* OvmfPkg/XenBusDxe: Add Event Channel into XenBus protocol.Anthony PERARD2014-10-293-0/+110
| | | | | | | | | | | | | | | | | | | | | | | | This patch adds three event channel related functions: - EventChannelAllocate: Allocate an event channel port that can be bind from a specified domain. - EventChannelNotify: Send an event to the remote end of a channel. - EventChannelClose: Close a local event channel port. Change in V3: - eventchannel, update protocol to return error code. - expand patch description - Add comments in the XenBus Protocol header. Change in V2: - coding style - adding comment to functions - Rename Xenbus to XenBus. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16271 6f19259b-4bc3-4df7-8a09-765794883524
* OvmfPkg/XenBusDxe: Introduce XenBus support itself.Anthony PERARD2014-10-295-0/+504
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a bus-like on top of XenStore. It will look for advertised ParaVirtualized devices and initialize them by producing XenBus protocol. Change in V4: - Replace the license by the commonly used file header text. - Clean XenBus.h header (remove copyright that does not belong to the file anymore; and rewrite the brief description of the file) - Fix description on the function Change in V3: - Insert to ChildList later, once populated. - Remove XENBUS_XENSTORE_NODE macro. - add comment to XenBusAddDevice and XenBusEnumerateBus about concurrency calls. - Add a description to the introduced member to the protocol. Change in V2: - comment, file header - Fix comment style - Error handling in the main init function - coding style - Fix error path in add device. Origin: FreeBSD 10.0 License: This patch adds XenBus.c which is under the MIT licence. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Acked-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16270 6f19259b-4bc3-4df7-8a09-765794883524
* OvmfPkg/XenBusDxe: Add XenStore function into the XenBus protocolAnthony PERARD2014-10-292-0/+251
| | | | | | | | | | | | | | Change in V3: - Have XenStoreWaitWatch/XenBusWaitForWatch return a XENSTORE_STATUS instead of VOID. - Add description of the introducted member of the protocol. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Acked-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16269 6f19259b-4bc3-4df7-8a09-765794883524
* OvmfPkg/XenBusDxe: Add an helper AsciiStrDup.Anthony PERARD2014-10-292-0/+14
| | | | | | | | | | | | .. because we need it in the patch titled: "OvmfPkg/XenBusDxe: Introduce XenBus support itself." Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16268 6f19259b-4bc3-4df7-8a09-765794883524
* OvmfPkg/XenBusDxe: Add XenStore client implementationAnthony PERARD2014-10-294-0/+1685
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | XenStore is a key/value database, which is running on another virtual machine. It can be accessed through shared memory. This is a client implementation. Change in V3: - moving xs_wire.h from patch #1 to this patch - fix return value of XenStoreListDirectory - Use a timeout to print a debug message if the other side of the xenstore ring does not notify through the event channel. This is done with the new XenStoreWaitForEvent function. - Have XenStoreReadReply check status of XenStoreProcessMessage and return an error if needed. - Have XenStoreTalkv return the status of XenStoreReadReply. - Have a loop to check for the quiescent of the response ring in the XenStoreInitComms function. (with a timeout of 5 seconds) - use the recently introduced XenStore 'closing' feature. Change in V2: - Change comment style, from freebsd to ovmf - Fix type of EventChannel - Fix debug print, no more cast - Implement XenStoreDeinit. - Clean up comments - Fix few codding style issue - Add FAIL xenstore status value. Origin: FreeBSD 10.0 License: This patch adds several files under the MIT licence. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Acked-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16267 6f19259b-4bc3-4df7-8a09-765794883524
* OvmfPkg/XenBusDxe: Add TestAndClearBit.Anthony PERARD2014-10-296-0/+81
| | | | | | | | | | | | | | | | | | | This atomically test's and clear's a bit. Change in V3: - adding IA32 support. (not yet reviewed) both XenBusDxe/Ia32/TestAndClearBit.{S,asm} are new Change in V2: - Adding .asm version - Comment the function Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16266 6f19259b-4bc3-4df7-8a09-765794883524
* OvmfPkg/XenBusDxe: Add Event Channel Notify.Anthony PERARD2014-10-293-0/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | This first function is used to notify the other side that there is something to do. The other side is another Xen domain. Change in V4: - Replace the license by the commonly used file header text. Change in V3: - Return error code from hypercall instead of ASSERT for XenEventChannelNotify - moving event_channel.h to this patch. Change in V2: - file header - coding style - adding comment to functions - Licenses License: This patch adds event_channel.h which is under MIT licence. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Acked-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16265 6f19259b-4bc3-4df7-8a09-765794883524
* OvmfPkg/XenBusDxe: Add Grant Table functions.Steven Smith2014-10-294-0/+316
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There are used to grant access of pages to other Xen domains. This code originaly comes from the Xen Project, and more precisely from MiniOS. Change in V4: - Add license to GrantTable.h Change in V3: - Add a comment about the use of the BAR of the device. Change in V2: - Adding locks - Redo the file header - Add functions comment - Add license Signed-off-by: Steven Smith <sos22@cam.ac.uk> Signed-off-by: Grzegorz Milos <gm281@cam.ac.uk> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Acked-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16264 6f19259b-4bc3-4df7-8a09-765794883524
* OvmfPkg/XenBusDxe: Add InterlockedCompareExchange16.Anthony PERARD2014-10-297-0/+191
| | | | | | | | | | | | | | | | | | | | | | This patch is inspired by InterlockedCompareExchange32 from the BaseSynchronizationLib. The function will be used in the "OvmfPkg/XenBusDxe: Add Grant Table functions" patch. Change in V3: - Implement both .S and .asm, to get rid of GCC specific asm. - Implement 32bit part of the assembly Change in V2: - Add intel compilation code MSFT code is not compied over because I don't know how it works. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16263 6f19259b-4bc3-4df7-8a09-765794883524
* OvmfPkg: Introduce XenBus Protocol.Anthony PERARD2014-10-292-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | This protocol will be used for communication between a PV driver (like a PV block driver) and the XenBus/XenStore. Change in V5: - Replace the license by the commonly used file header text. Change in V3: - Add disclaimer about the volatile nature of the protocol. - Add a description on the two introduced members to the protocol. Change in V2: - Comment, file header - Protocol License - Declare xen interface version earlier - Rename protocol from Xenbus to XenBus Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16262 6f19259b-4bc3-4df7-8a09-765794883524
* OvmfPkg/XenBusDxe: Open PciIo protocol.Anthony PERARD2014-10-292-0/+20
| | | | | | | | | | | | | | | | | | | The PciIo interface will be used in "OvmfPkg/XenBusDxe: Add Grant Table functions" to get the memory address of the BAR 1 and use the space to map shared memory. Change in V3: - add a commit description. Change in V2: - Coding style - Error handler Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16261 6f19259b-4bc3-4df7-8a09-765794883524
* OvmfPkg/XenBusDxe: Add support to make Xen Hypercalls.Anthony PERARD2014-10-299-0/+362
| | | | | | | | | | | | | | | | | | | | | | | | | | | Change in V4: - Replace the license by the commonly used file header text. - add file header to XenHypercall.h (license, copyright, brief desc) Change in V3: - adding IA32 support. (not reviewed yet) both XenBusDxe/Ia32/hypercall.{S,asm} file are new Change in V2: - file header, copyright - Add License - Add push/pop instruction. - fix types - Comment of exported functions - Improve coding style - Add error handling in the main init function (of the drivers) - Comment assembly Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16260 6f19259b-4bc3-4df7-8a09-765794883524
* OvmfPkg/XenBusDxe: Add device state struct and create an ExitBoot services ↵Anthony PERARD2014-10-292-2/+65
| | | | | | | | | | | | | | | | | | event. The ExitBoot event is used to disconnect from the device before the next operating system start using them. Change in V3: - use the variable mMyDevice to prevent the driver from starting twice (if there is two different PCI devices). - free(dev) on exit Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16259 6f19259b-4bc3-4df7-8a09-765794883524
* OvmfPkg: Add basic skeleton for the XenBus bus driver.Anthony PERARD2014-10-296-0/+833
This includes Component Name and Driver Binding. Change in V4: - Replace the license by the commonly used file header text. - Add brief description for the driver. Change in V3: - enable compilation for Ia32 and Ia32X64 - fix version (driver binding) Change in V2: - Simple support of controller name. - Cleaning up comments, files header. - Add Licenses - Rename XenbusDxe to XenBusDxe. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16258 6f19259b-4bc3-4df7-8a09-765794883524