Commit Graph

14927 Commits

Author SHA1 Message Date
Star Zeng 6ebffb67c8 MdeModulePkg/SecurityPkg Variable: Add boundary check for while (IsValidVariableHeader (Variable)).
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16280 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-31 10:26:54 +00:00
Star Zeng a75cf433d1 MdePkg/IntelFrameworkPkg HobLib: Update BuildResourceDescriptorWithOwnerHob()
to align the behavior of BuildResourceDescriptorHob().

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16279 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-31 07:20:26 +00:00
Fu Siyuan 3f103c08ba Fix a bug introuduced by r16104, not all NIC device implement both memory and IO bar.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-By: Ye, Ting (ting.ye@intel.com)
Reviewed-By: Wu, Jiaxin <jiaxin.wu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16278 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-31 00:38:39 +00:00
lhauch b176333801 Update edksetup.bat to support Microsoft Visual Studio 2013 when building the Nt32Pkg emulation platform (enabled using the --nt32 flag).
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: lhauch <larry.hauch@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16277 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-30 17:09:25 +00:00
Olivier Martin 0e565888ee StdLib: Fix GCC warnings/errors caused by variables being set but not used.
Removed variables that had no effect on code behavior.

Fifo.c::FIFO_Dequeue: Replaced instances of "Self->ElementSize" with preexisting variable "SizeOfElement".

IIOutilities.c::IIO_GetInChar: Fixed variable of wrong, but compatible, type and made updating of housekeeping variables dependent upon successful completion of reading from the buffer.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
Reviewed by: Daryl McDaniel <daryl.mcdaniel@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16276 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-30 01:05:22 +00:00
Olivier Martin b07ae3d607 ArmPlatformPkg/Documentation: Removed BaseTools-Pending-Patches.patch
All the required pending BaseTools patches have been merged.
This patch is not required anymore.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>



git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16275 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-29 18:55:29 +00:00
Anthony PERARD 5de8a35c62 OvmfPkg/XenPvBlkDxe: Add BlockIo.
Implement the BlockIo protocol.

Change in V4:
- Replace the license by the commonly used file header text.

Change in V3:
- assert(Media->BlockSize % 512 == 0)
- Use Sector instead of Offset to issue IOs.

Change in V2:
- Remove blockIo2 headers.
- Fix few comment.
- file header, copyright
- Rewrite few comment and error messages
- No more callback
- Improving block read/write, increase to the max size in one request
  (instead of only 8pages)
- Fix lastblock when it's a cdrom
- Do uninitialisation when fail to install fail
- few comment
- Licenses

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@16274 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-29 06:52:13 +00:00
Samuel Thibault 5cce852404 OvmfPkg/XenPvBlkDxe: Add BlockFront client.
This is the code that will do the actual communication between OVMF and
a PV block backend, where the block device lives. The protocol used is
describe in the blkif.h header.

This implementation originally comes from Mini-OS, a part of the Xen
Project.

Change in V4:
- add file header to BlockFront.h (license, copyright, brief desc)

Change in V3:
- Improve comment of XenBusReadUint64.
- Moving blkif.h to this patch
  with the necessary #pragma pack(4) applied for Ia32.
- Add a note about the license in the commit message
- Add "The protocol used is describe in the blkif.h header." in the
  commit message
- Have a mandatory sector-size multiple of 512 or fail to initialize.
- use Sector instead of Offset for IO request.
  with Sector been 512-byte unit.
- print something if EventChannelNotify return an error.

Change in V2:
- trigger CoW is probably not needed on OVMF (as opposed to Mini-OS),
  removed the test.
- comments
- renamed XenbusReadInteger to XenBusReadUint64
- remove callback from IoData, use simple status instead
- return a status from the synchronus io
- Close protocol if blockfront init fail.
- fix few debug print
- Rename XenbusIo to XenBusIo
- XenPvBlkWaitForBackendState will return an error if the new backend
  states is not the expected state.
- Add the license

License: This patch adds some files which are under the MIT license.
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
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@16273 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-29 06:51:58 +00:00
Anthony PERARD de671da8e4 OvmfPkg/XenPvBlkDxe: Xen PV Block device, initial skeleton
A ParaVirtualize block driver.

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:
- Add minimal support for controller name
- Remove stuff about BlockIo2
- Little cleanup
- Licenses and file headers
- Rename XenbusIo into XenBusIo

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@16272 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-29 06:51:42 +00:00
Anthony PERARD e86895d9e4 OvmfPkg/XenBusDxe: Add Event Channel into XenBus protocol.
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
2014-10-29 06:51:26 +00:00
Anthony PERARD 86d968e05e OvmfPkg/XenBusDxe: Introduce XenBus support itself.
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
2014-10-29 06:51:18 +00:00
Anthony PERARD c23c037fb3 OvmfPkg/XenBusDxe: Add XenStore function into the XenBus protocol
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
2014-10-29 06:51:04 +00:00
Anthony PERARD 02a6bcff71 OvmfPkg/XenBusDxe: Add an helper AsciiStrDup.
.. 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
2014-10-29 06:50:57 +00:00
Anthony PERARD a9090a94bb OvmfPkg/XenBusDxe: Add XenStore client implementation
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
2014-10-29 06:50:50 +00:00
Anthony PERARD 6342f1fea8 OvmfPkg/XenBusDxe: Add TestAndClearBit.
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
2014-10-29 06:50:35 +00:00
Anthony PERARD f1259bba36 OvmfPkg/XenBusDxe: Add Event Channel Notify.
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
2014-10-29 06:50:24 +00:00
Steven Smith 0fd142464f OvmfPkg/XenBusDxe: Add Grant Table functions.
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
2014-10-29 06:50:14 +00:00
Anthony PERARD bba9d16231 OvmfPkg/XenBusDxe: Add InterlockedCompareExchange16.
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
2014-10-29 06:49:55 +00:00
Anthony PERARD 12a16f2d1c OvmfPkg: Introduce XenBus Protocol.
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
2014-10-29 06:49:38 +00:00
Anthony PERARD 956622c4c9 OvmfPkg/XenBusDxe: Open PciIo protocol.
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
2014-10-29 06:49:22 +00:00
Anthony PERARD abcbbb14a4 OvmfPkg/XenBusDxe: Add support to make Xen Hypercalls.
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
2014-10-29 06:49:10 +00:00
Anthony PERARD a154f42014 OvmfPkg/XenBusDxe: Add device state struct and create an ExitBoot services 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
2014-10-29 06:48:59 +00:00
Anthony PERARD e65e8802e5 OvmfPkg: Add basic skeleton for the XenBus bus driver.
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
2014-10-29 06:48:50 +00:00
Anthony PERARD 6b621f9581 OvmfPkg: Add public headers from Xen Project.
This patch imports publics headers in order to use features from Xen
like XenStore, PV Block... There is only the necessary header files and
there are only a few modifications in order to facilitate future merge of
more recent header (that would be necessary to access new features).

There is little modification compared to the original files:
- Removed most of the unused part of the headers
- Use of ZeroMem() instead of memset()
- using #pragma pack(4) for IA32 compilation.
- Replace types to be more UEFI compliant using a script.

OVMF, when built for IA32 arch, uses the gcc switch -malign-double. This
change the alignment of fields in some struct compare to what is
espected by Xen and any backends. To fix the alignment, the #pragma pack(4)
directive is used around the struct that need it.

Command to run to change types:
find OvmfPkg/Include/IndustryStandard/Xen -type f -name '*.h' -exec sed
  --regexp-extended --file=fix_type_in_xen_includes.sed --in-place {} \;

Avoid changing the 'long' that is not a type (with the first line).
$ cat fix_type_in_xen_includes.sed
/as long as/b

s/([^a-zA-Z0-9_]|^)uint8_t([^a-zA-Z0-9_]|$)/\1UINT8\2/g
s/([^a-zA-Z0-9_]|^)uint16_t([^a-zA-Z0-9_]|$)/\1UINT16\2/g
s/([^a-zA-Z0-9_]|^)uint32_t([^a-zA-Z0-9_]|$)/\1UINT32\2/g
s/([^a-zA-Z0-9_]|^)uint64_t([^a-zA-Z0-9_]|$)/\1UINT64\2/g

s/([^a-zA-Z0-9_]|^)int8_t([^a-zA-Z0-9_]|$)/\1INT8\2/g
s/([^a-zA-Z0-9_]|^)int16_t([^a-zA-Z0-9_]|$)/\1INT16\2/g
s/([^a-zA-Z0-9_]|^)int32_t([^a-zA-Z0-9_]|$)/\1INT32\2/g
s/([^a-zA-Z0-9_]|^)int64_t([^a-zA-Z0-9_]|$)/\1INT64\2/g

s/([^a-zA-Z0-9_]|^)void([^a-zA-Z0-9_]|$)/\1VOID\2/g
s/([^a-zA-Z0-9_]|^)unsigned int([^a-zA-Z0-9_]|$)/\1UINT32\2/g
s/([^a-zA-Z0-9_]|^)int([^a-zA-Z0-9_]|$)/\1INT32\2/g
s/([^a-zA-Z0-9_]|^)unsigned char([^a-zA-Z0-9_]|$)/\1UINT8\2/g
s/([^a-zA-Z0-9_]|^)char([^a-zA-Z0-9_]|$)/\1CHAR8\2/g
s/([^a-zA-Z0-9_]|^)unsigned long([^a-zA-Z0-9_]|$)/\1UINTN\2/g
s/([^a-zA-Z0-9_]|^)long([^a-zA-Z0-9_]|$)/\1INTN\2/g

Change in V4:
- Add a README in Xen headers directory to explain what have been done
  to it. It is mostly a copy/past from the commit description with some
  rewording.
- replace unsigned char by UINT8 as there is no unsigned char in UEFI
  types.

Change in V3:
- Remove unused header sched.h
- moving xs_wire.h in a later patch, where it's first needed
- moving io/blkif.h in a later patch (XenPvBlkDxe: Add BlockFront client)
- moving event_channel.h in a later patch (XenBusDxe: Add Event Channel Notify)
- using #pragma pack(4) for IA32
- headers trimed down, removed most of the unused struct/define/...

License: This patch adds many files 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@16257 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-29 06:48:29 +00:00
Anthony PERARD 08dfaee2f2 OvmfPkg: Add the MIT license to License.txt.
The MIT license will be used for several source files that are necessary
for the Xen PV drivers. So this patch makes it explicit by adding the
license with a note about which directory will have source files under
this license.

Change in V3:
  New patch

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@16256 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-29 06:48:15 +00:00
Star Zeng 4888d15e74 MdeModulePkg/IntelFrameworkModulePkg FwVol:
Move the check of FV Header signature and file system to
  GetFwVolHeader() to avoid reading the whole unexpected FvHeader.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16255 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-29 03:31:46 +00:00
Daryl McDaniel 24903bc48a StdLib: Some deployed versions of the Simple Text Input Protocol randomly return either NUL characters or Scan Codes when just typing normal text. These changes filter out NUL characters and make Scan Code and error handling more robust.
StdLibPrivateInternalFiles/Include/Device/Console.h: Change UnGetKey, in the ConInstance structure, from an EFI_INPUT_KEY structure to a CHAR16 variable.

Include/sys/termios.h: Add CHAR_SUB and CHAR_ESC for translation of '^Z' and the Escape Scan Code into the EOF and ESC characters, respectively.

LibC/Uefi/Devices/Console/daConsole.c:  Add da_ConRawRead() function to simplify the read logic. Discard NUL characters from the input stream.  In Blocking mode, retry until a non-NUL character is received.  In NonBlocking mode, a NUL causes an EAGAIN error to be returned.  Translate the Escape Scan Code into an ESC character.  If Scan Codes are ignored, retry if in Blocking mode else return an EAGAIN error.  UnGetKey becomes a single wide character instead of a structure.
    Change da_Poll() to use da_ConRawRead().

LibC/Uefi/InteractiveIO/IIOutilities.c:  BUG fix.  Return the processed input character instead of the raw character.  Allows EOF propagation.

LibC/Uefi/InteractiveIO/CanonRead.c:  Enable EOF propagation.

LibC/Uefi/InteractiveIO/IIOechoCtrl.h:  Use symbols defined in termios.h instead of hard-coded constant numbers.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by:  Daryl McDaniel  <daryl.mcdaniel@intel.com>
Reviewed-by:  Jaben Carsey <Jaben.carsey@intel.com>
Reviewed-by:  Erik Bjorge <erik.c.bjorge@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16254 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-28 19:20:48 +00:00
Olivier Martin 8dd618d211 ArmPkg/ArmLib: Removed duplicated invalidate TLB function
ArmInvalidateInstructionAndDataTlb() was doing the same thing as
ArmInvalidateTlb().
Both invalidate Data and Instruction TLBs.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>



git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16253 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-27 15:38:55 +00:00
Ronald Cron d2e7e385fc EmbeddedPkg: Clarify the declaration of SerialPortGetControl()
Rework the PL011UartGetControl() function removing a TODO by the way.
Update of the header comment blocks of (PL011Uart|SerialPort)GetControl() functions.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
Reviewed-By: Olivier Martin <olivier.martin@arm.com>



git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16252 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-27 15:38:20 +00:00
Ronald Cron ab71619108 EmbeddedPkg: Clarify the declaration of SerialPortSetControl()
Rework of PL011UartSetControl() as a consequence as well as update of
function header comment blocks.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
Reviewed-By: Olivier Martin <olivier.martin@arm.com>



git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16251 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-27 15:37:37 +00:00
Ronald Cron 5f81a62094 EmbeddedPkg: Add scope of SerialPortExtLib.h
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
Reviewed-By: Olivier Martin <olivier.martin@arm.com>



git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16250 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-27 15:36:58 +00:00
Olivier Martin 9f38945fea ArmPlatformPkg/ArmJunoPkg: Added Juno development board support
ARM 64bit development platform.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>



git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16249 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-27 15:28:07 +00:00
Harry Liebel cfdab71f92 ArmPlatformPkg/ArmShellCmdRunAxf: Added 'runaxf' cmd to shell (..cont)
Added missing file from the previous commit.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Harry Liebel <Harry.Liebel@arm.com>
Reviewed-By: Olivier Martin <olivier.martin@arm.com>



git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16248 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-27 11:13:26 +00:00
Harry Liebel ced216f8b9 ArmPlatformPkg/ArmShellCmdRunAxf: Added 'runaxf' cmd to shell
Use the command to load and start a ARM Executable File from mass storage.
This is basically just an ELF file. The program is copied to memory and
the Entrypoint is called. Control is not expected to return back to the
Shell. This has only been tested on AArch64 with a limited set of AXF
binaries.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Harry Liebel <Harry.Liebel@arm.com>
Reviewed-By: Olivier Martin <olivier.martin@arm.com>



git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16247 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-27 10:52:11 +00:00
Olivier Martin 53ae06f50d ArmPlatformPkg/ArmVExpressDxe: Fixed duplicated GUID
ArmFvpDxe.inf was using the same file guid as ArmHwDxe.inf.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
Reported-By: Leif Lindholm <leif.lindholm@linaro.org>



git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16246 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-27 10:46:16 +00:00
Ronald Cron 9db0a77946 EmbeddedPkg: Remove unused TemplateSerialPortLib
MdePkg/Library/BaseSerialPortLibNull can be used instead as a template.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
Reviewed-By: Olivier Martin <olivier.martin@arm.com>



git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16245 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-27 10:44:30 +00:00
Ronald Cron daefd574f9 ArmPkg/SemihostFs: Implement SetInfo() and handle seeking past the end of a file
Implement the resizing of the file with SetInfo().
Implement the renaming of a file with SetInfo().
Allow to seek past the end of a file.

The support of file resizing implies a rework of the read, write
and close functions. So does the support of seeking past the end
of a file. That why those two changes are done in the same patch.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
Reviewed-By: Olivier Martin <olivier.martin@arm.com>



git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16244 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-27 10:42:51 +00:00
Ronald Cron 11bbc25789 EmbeddedPkg/Lan9118Dxe: Rework filter init, enabling and disabling
Correct the setting of the hardware filters according to what it asked
to the driver through the ReceiveFilters() interface function.

Keep track of the hardware settings in the "ReceiveFilterSetting" field of
 the EFI_SIMPLE_NETWORK_MODE structure.

From now, after initialization, all filters are disabled and thus no packet
received.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
Reviewed-By: Olivier Martin <olivier.martin@arm.com>



git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16243 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-27 10:42:13 +00:00
Ronald Cron e52aee5d31 EmbeddedPkg/Lan9118Dxe: Fix interrupt's mask returned by GetStatus
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
Reviewed-By: Olivier Martin <olivier.martin@arm.com>



git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16242 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-27 10:41:29 +00:00
Ronald Cron fdd12bd569 ArmPkg/SemihostFs: Fix open file issues revealed by SCT
Fix return codes in case of errors.
Fix translation from EFI open mode to semi-hosting open mode to avoid the
truncate to zero length of an already existing file opened in read/write
or read/write/create mode.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
Reviewed-By: Olivier Martin <olivier.martin@arm.com>



git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16241 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-27 10:40:33 +00:00
Ronald Cron 0f0a6fe907 EmbeddedPkg/Lan9118Dxe: Switch back the driver in stopped state after shutdown
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
Reviewed-By: Olivier Martin <olivier.martin@arm.com>



git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16240 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-27 10:39:52 +00:00
Ronald Cron 0150e14dba EmbeddedPkg/Lan9118Dxe: Add or fix input parameter checks
Add or fix checking of the input parameters of the functions that constitute
the EFI_SIMPLE_NETWORK_PROTOCOL interface provided by the LAN9118 driver.
In case of invalid calls, the returned error codes are now compliant with the
UEFI specificationi and the SCT tests checking for those error codes do not
fail anymore.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
Reviewed-By: Olivier Martin <olivier.martin@arm.com>



git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16239 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-27 10:39:12 +00:00
Ronald Cron 5521b5cc73 ArmPkg/SemihostLib: Add library functions
Add library functions to rename a file and get a temporary name
for a file through the semi-hosting interface.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
Reviewed-By: Olivier Martin <olivier.martin@arm.com>



git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16238 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-27 10:38:18 +00:00
Ronald Cron c20f8ec661 ArmPkg/Semihostlib: Rename semi-hosting open option
Change mnemonic SEMIHOST_FILE_MODE_CREATE with mnemonic SEMIHOST_FILE_MODE_UPDATE.
The bit referred to by this mnemonic is for the semi-hosting open mode code the
equivalent of the + in the ISO C fopen mode terminology. This allows to select the
so called update mode for which both read and write are allowed on the open file.
The mnemonic SEMIHOST_FILE_MODE_UPDATE is more in line with the ISO C fopen mode
terminology. A description of the ISO C fopen modes can be found here :
http://pubs.opengroup.org/onlinepubs/009695399/functions/fopen.html.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
Reviewed-By: Olivier Martin <olivier.martin@arm.com>



git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16237 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-27 10:37:20 +00:00
Olivier Martin a537c71726 EmbeddedPkg/Lan9118Dxe: Fixed dereferencing optional NULL pointer
TxBuff argument is optional in SNP.GetStatus(). This argument can be NULL.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>



git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16236 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-27 10:35:57 +00:00
Ronald Cron c9263c7dd2 EmbeddedPkg: Fix crash when retrieving LAN9118 network statistics
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
Reviewed-By: Olivier Martin <olivier.martin@arm.com>



git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16235 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-27 10:34:56 +00:00
Olivier Martin 5f81082e38 ArmPkg/ArmGic: Added GicV3 support to ArmGicDxe
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>



git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16234 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-27 10:30:53 +00:00
Olivier Martin d71338597e ArmPkg/ArmGic: Added GicV3 support to ArmGicLib
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>



git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16233 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-27 10:29:50 +00:00
Olivier Martin 5f525769b9 ArmPkg/ArmGic: Added GicV3 detection
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
Signed-off-by: Harry Liebel <Harry.Liebel@arm.com>



git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16232 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-27 10:28:44 +00:00
Olivier Martin d5c6b7fca3 ArmPkg/ArmGic: Introduced ArmGicGetSupportedArchRevision()
This function returns the revision of the GIC Architecture.
Some GICv3 controllers can work in GICv2 mode. Switching to an
older GIC revision is driven by the higher level exception level.
This function allows code to support any GIC revision at runtime.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>



git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16231 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-27 10:27:27 +00:00