[edk2-devel] [PATCH 4/6] MdePkg: Add gEfiCpu2ProtocolGuid and header file

Gao, Zhichao posted 6 patches 6 years, 8 months ago
There is a newer version of this series
[edk2-devel] [PATCH 4/6] MdePkg: Add gEfiCpu2ProtocolGuid and header file
Posted by Gao, Zhichao 6 years, 8 months ago
From: Sean Brogan <sean.brogan@microsoft.com>

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1400

Add gEfiCpu2ProtocolGuid to MdePkg.dec.
Add the header file of Cpu2 protocol: it has one interface
to enable interrupt and put cpu to sleep to wait for an
interrupt.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
---
 MdePkg/Include/Protocol/Cpu2.h | 43 ++++++++++++++++++++++++++++++++++
 MdePkg/MdePkg.dec              |  3 +++
 2 files changed, 46 insertions(+)
 create mode 100644 MdePkg/Include/Protocol/Cpu2.h

diff --git a/MdePkg/Include/Protocol/Cpu2.h b/MdePkg/Include/Protocol/Cpu2.h
new file mode 100644
index 0000000000..cacd948140
--- /dev/null
+++ b/MdePkg/Include/Protocol/Cpu2.h
@@ -0,0 +1,43 @@
+/** @file
+  CPU2 Protocol
+
+  This code abstracts the DXE core from processor implementation details.
+
+  Copyright (c) 2006 - 2018, Microsoft Corporation. All rights reserved.<BR>
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef __PROTOCOL_CPU2_H__
+#define __PROTOCOL_CPU2_H__
+
+#include <Uefi.h>
+
+typedef struct _EFI_CPU2_PROTOCOL   EFI_CPU2_PROTOCOL;
+
+
+/**
+  This function enables CPU interrupts and then waits for an interrupt to arrive.
+
+  @param  This                  The EFI_CPU2_PROTOCOL instance.
+
+  @retval EFI_SUCCESS           Interrupts are enabled on the processor.
+  @retval EFI_DEVICE_ERROR      Interrupts could not be enabled on the processor.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_CPU_ENABLE_AND_WAIT_FOR_INTERRUPT)(
+  IN EFI_CPU2_PROTOCOL              *This
+  );
+
+//
+// The EFI_CPU2_PROTOCOL is used to abstract processor-specific functions from the DXE
+// Foundation.
+//
+struct _EFI_CPU2_PROTOCOL {
+  EFI_CPU_ENABLE_AND_WAIT_FOR_INTERRUPT            EnableAndWaitForInterrupt;
+};
+
+#endif
diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
index 6c563375ee..e8c6939849 100644
--- a/MdePkg/MdePkg.dec
+++ b/MdePkg/MdePkg.dec
@@ -1803,6 +1803,9 @@
   ## Include/Protocol/ShellDynamicCommand.h
   gEfiShellDynamicCommandProtocolGuid  = { 0x3c7200e9, 0x005f, 0x4ea4, {0x87, 0xde, 0xa3, 0xdf, 0xac, 0x8a, 0x27, 0xc3 }}
 
+  ## Include/Protocol/Cpu2.h
+  gEfiCpu2ProtocolGuid                 = { 0x55198405, 0x26C0, 0x4765, {0x8B, 0x7D, 0xBE, 0x1D, 0xF5, 0xF9, 0x97, 0x12 }}
+
 #
 # [Error.gEfiMdePkgTokenSpaceGuid]
 #   0x80000001 | Invalid value provided.
-- 
2.21.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#41306): https://edk2.groups.io/g/devel/message/41306
Mute This Topic: https://groups.io/mt/31741731/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH 4/6] MdePkg: Add gEfiCpu2ProtocolGuid and header file
Posted by Liming Gao 6 years, 8 months ago
Zhichao:
  Which spec defines Cpu2 protocol?

Thanks
Liming
>-----Original Message-----
>From: Gao, Zhichao
>Sent: Friday, May 24, 2019 1:05 PM
>To: devel@edk2.groups.io
>Cc: Sean Brogan <sean.brogan@microsoft.com>; Kinney, Michael D
><michael.d.kinney@intel.com>; Gao, Liming <liming.gao@intel.com>; Michael
>Turner <Michael.Turner@microsoft.com>; Bret Barkelew
><Bret.Barkelew@microsoft.com>
>Subject: [PATCH 4/6] MdePkg: Add gEfiCpu2ProtocolGuid and header file
>
>From: Sean Brogan <sean.brogan@microsoft.com>
>
>REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1400
>
>Add gEfiCpu2ProtocolGuid to MdePkg.dec.
>Add the header file of Cpu2 protocol: it has one interface
>to enable interrupt and put cpu to sleep to wait for an
>interrupt.
>
>Cc: Michael D Kinney <michael.d.kinney@intel.com>
>Cc: Liming Gao <liming.gao@intel.com>
>Cc: Sean Brogan <sean.brogan@microsoft.com>
>Cc: Michael Turner <Michael.Turner@microsoft.com>
>Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
>Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
>---
> MdePkg/Include/Protocol/Cpu2.h | 43
>++++++++++++++++++++++++++++++++++
> MdePkg/MdePkg.dec              |  3 +++
> 2 files changed, 46 insertions(+)
> create mode 100644 MdePkg/Include/Protocol/Cpu2.h
>
>diff --git a/MdePkg/Include/Protocol/Cpu2.h
>b/MdePkg/Include/Protocol/Cpu2.h
>new file mode 100644
>index 0000000000..cacd948140
>--- /dev/null
>+++ b/MdePkg/Include/Protocol/Cpu2.h
>@@ -0,0 +1,43 @@
>+/** @file
>+  CPU2 Protocol
>+
>+  This code abstracts the DXE core from processor implementation details.
>+
>+  Copyright (c) 2006 - 2018, Microsoft Corporation. All rights reserved.<BR>
>+
>+  SPDX-License-Identifier: BSD-2-Clause-Patent
>+
>+**/
>+
>+#ifndef __PROTOCOL_CPU2_H__
>+#define __PROTOCOL_CPU2_H__
>+
>+#include <Uefi.h>
>+
>+typedef struct _EFI_CPU2_PROTOCOL   EFI_CPU2_PROTOCOL;
>+
>+
>+/**
>+  This function enables CPU interrupts and then waits for an interrupt to
>arrive.
>+
>+  @param  This                  The EFI_CPU2_PROTOCOL instance.
>+
>+  @retval EFI_SUCCESS           Interrupts are enabled on the processor.
>+  @retval EFI_DEVICE_ERROR      Interrupts could not be enabled on the
>processor.
>+
>+**/
>+typedef
>+EFI_STATUS
>+(EFIAPI *EFI_CPU_ENABLE_AND_WAIT_FOR_INTERRUPT)(
>+  IN EFI_CPU2_PROTOCOL              *This
>+  );
>+
>+//
>+// The EFI_CPU2_PROTOCOL is used to abstract processor-specific functions
>from the DXE
>+// Foundation.
>+//
>+struct _EFI_CPU2_PROTOCOL {
>+  EFI_CPU_ENABLE_AND_WAIT_FOR_INTERRUPT
>EnableAndWaitForInterrupt;
>+};
>+
>+#endif
>diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
>index 6c563375ee..e8c6939849 100644
>--- a/MdePkg/MdePkg.dec
>+++ b/MdePkg/MdePkg.dec
>@@ -1803,6 +1803,9 @@
>   ## Include/Protocol/ShellDynamicCommand.h
>   gEfiShellDynamicCommandProtocolGuid  = { 0x3c7200e9, 0x005f, 0x4ea4,
>{0x87, 0xde, 0xa3, 0xdf, 0xac, 0x8a, 0x27, 0xc3 }}
>
>+  ## Include/Protocol/Cpu2.h
>+  gEfiCpu2ProtocolGuid                 = { 0x55198405, 0x26C0, 0x4765, {0x8B, 0x7D,
>0xBE, 0x1D, 0xF5, 0xF9, 0x97, 0x12 }}
>+
> #
> # [Error.gEfiMdePkgTokenSpaceGuid]
> #   0x80000001 | Invalid value provided.
>--
>2.21.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#41310): https://edk2.groups.io/g/devel/message/41310
Mute This Topic: https://groups.io/mt/31741731/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH 4/6] MdePkg: Add gEfiCpu2ProtocolGuid and header file
Posted by Gao, Zhichao 6 years, 8 months ago
I have found it in UEFP spec and PI spec. It is not defined in these specs.
So I think maybe no spec has already defined it.

Thanks,
Zhichao

> -----Original Message-----
> From: Gao, Liming
> Sent: Friday, May 24, 2019 1:20 PM
> To: Gao, Zhichao <zhichao.gao@intel.com>; devel@edk2.groups.io
> Cc: Sean Brogan <sean.brogan@microsoft.com>; Kinney, Michael D
> <michael.d.kinney@intel.com>; Michael Turner
> <Michael.Turner@microsoft.com>; Bret Barkelew
> <Bret.Barkelew@microsoft.com>
> Subject: RE: [PATCH 4/6] MdePkg: Add gEfiCpu2ProtocolGuid and header file
> 
> Zhichao:
>   Which spec defines Cpu2 protocol?
> 
> Thanks
> Liming
> >-----Original Message-----
> >From: Gao, Zhichao
> >Sent: Friday, May 24, 2019 1:05 PM
> >To: devel@edk2.groups.io
> >Cc: Sean Brogan <sean.brogan@microsoft.com>; Kinney, Michael D
> ><michael.d.kinney@intel.com>; Gao, Liming <liming.gao@intel.com>;
> >Michael Turner <Michael.Turner@microsoft.com>; Bret Barkelew
> ><Bret.Barkelew@microsoft.com>
> >Subject: [PATCH 4/6] MdePkg: Add gEfiCpu2ProtocolGuid and header file
> >
> >From: Sean Brogan <sean.brogan@microsoft.com>
> >
> >REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1400
> >
> >Add gEfiCpu2ProtocolGuid to MdePkg.dec.
> >Add the header file of Cpu2 protocol: it has one interface to enable
> >interrupt and put cpu to sleep to wait for an interrupt.
> >
> >Cc: Michael D Kinney <michael.d.kinney@intel.com>
> >Cc: Liming Gao <liming.gao@intel.com>
> >Cc: Sean Brogan <sean.brogan@microsoft.com>
> >Cc: Michael Turner <Michael.Turner@microsoft.com>
> >Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
> >Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
> >---
> > MdePkg/Include/Protocol/Cpu2.h | 43
> >++++++++++++++++++++++++++++++++++
> > MdePkg/MdePkg.dec              |  3 +++
> > 2 files changed, 46 insertions(+)
> > create mode 100644 MdePkg/Include/Protocol/Cpu2.h
> >
> >diff --git a/MdePkg/Include/Protocol/Cpu2.h
> >b/MdePkg/Include/Protocol/Cpu2.h new file mode 100644 index
> >0000000000..cacd948140
> >--- /dev/null
> >+++ b/MdePkg/Include/Protocol/Cpu2.h
> >@@ -0,0 +1,43 @@
> >+/** @file
> >+  CPU2 Protocol
> >+
> >+  This code abstracts the DXE core from processor implementation details.
> >+
> >+  Copyright (c) 2006 - 2018, Microsoft Corporation. All rights
> >+ reserved.<BR>
> >+
> >+  SPDX-License-Identifier: BSD-2-Clause-Patent
> >+
> >+**/
> >+
> >+#ifndef __PROTOCOL_CPU2_H__
> >+#define __PROTOCOL_CPU2_H__
> >+
> >+#include <Uefi.h>
> >+
> >+typedef struct _EFI_CPU2_PROTOCOL   EFI_CPU2_PROTOCOL;
> >+
> >+
> >+/**
> >+  This function enables CPU interrupts and then waits for an interrupt
> >+to
> >arrive.
> >+
> >+  @param  This                  The EFI_CPU2_PROTOCOL instance.
> >+
> >+  @retval EFI_SUCCESS           Interrupts are enabled on the processor.
> >+  @retval EFI_DEVICE_ERROR      Interrupts could not be enabled on the
> >processor.
> >+
> >+**/
> >+typedef
> >+EFI_STATUS
> >+(EFIAPI *EFI_CPU_ENABLE_AND_WAIT_FOR_INTERRUPT)(
> >+  IN EFI_CPU2_PROTOCOL              *This
> >+  );
> >+
> >+//
> >+// The EFI_CPU2_PROTOCOL is used to abstract processor-specific
> >+functions
> >from the DXE
> >+// Foundation.
> >+//
> >+struct _EFI_CPU2_PROTOCOL {
> >+  EFI_CPU_ENABLE_AND_WAIT_FOR_INTERRUPT
> >EnableAndWaitForInterrupt;
> >+};
> >+
> >+#endif
> >diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index
> >6c563375ee..e8c6939849 100644
> >--- a/MdePkg/MdePkg.dec
> >+++ b/MdePkg/MdePkg.dec
> >@@ -1803,6 +1803,9 @@
> >   ## Include/Protocol/ShellDynamicCommand.h
> >   gEfiShellDynamicCommandProtocolGuid  = { 0x3c7200e9, 0x005f, 0x4ea4,
> >{0x87, 0xde, 0xa3, 0xdf, 0xac, 0x8a, 0x27, 0xc3 }}
> >
> >+  ## Include/Protocol/Cpu2.h
> >+  gEfiCpu2ProtocolGuid                 = { 0x55198405, 0x26C0, 0x4765, {0x8B,
> 0x7D,
> >0xBE, 0x1D, 0xF5, 0xF9, 0x97, 0x12 }}
> >+
> > #
> > # [Error.gEfiMdePkgTokenSpaceGuid]
> > #   0x80000001 | Invalid value provided.
> >--
> >2.21.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#41312): https://edk2.groups.io/g/devel/message/41312
Mute This Topic: https://groups.io/mt/31741731/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH 4/6] MdePkg: Add gEfiCpu2ProtocolGuid and header file
Posted by Yao, Jiewen 6 years, 8 months ago
EFI_CPU_IO2_PROCOL is defined in PI spec Volume 5 Chapter 15 CPU I/O Protocol.

Thank you
Yao jiewen

> -----Original Message-----
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> Gao, Zhichao
> Sent: Thursday, May 23, 2019 10:28 PM
> To: Gao, Liming <liming.gao@intel.com>; devel@edk2.groups.io
> Cc: Sean Brogan <sean.brogan@microsoft.com>; Kinney, Michael D
> <michael.d.kinney@intel.com>; Michael Turner
> <Michael.Turner@microsoft.com>; Bret Barkelew
> <Bret.Barkelew@microsoft.com>
> Subject: Re: [edk2-devel] [PATCH 4/6] MdePkg: Add gEfiCpu2ProtocolGuid
> and header file
> 
> I have found it in UEFP spec and PI spec. It is not defined in these specs.
> So I think maybe no spec has already defined it.
> 
> Thanks,
> Zhichao
> 
> > -----Original Message-----
> > From: Gao, Liming
> > Sent: Friday, May 24, 2019 1:20 PM
> > To: Gao, Zhichao <zhichao.gao@intel.com>; devel@edk2.groups.io
> > Cc: Sean Brogan <sean.brogan@microsoft.com>; Kinney, Michael D
> > <michael.d.kinney@intel.com>; Michael Turner
> > <Michael.Turner@microsoft.com>; Bret Barkelew
> > <Bret.Barkelew@microsoft.com>
> > Subject: RE: [PATCH 4/6] MdePkg: Add gEfiCpu2ProtocolGuid and header
> file
> >
> > Zhichao:
> >   Which spec defines Cpu2 protocol?
> >
> > Thanks
> > Liming
> > >-----Original Message-----
> > >From: Gao, Zhichao
> > >Sent: Friday, May 24, 2019 1:05 PM
> > >To: devel@edk2.groups.io
> > >Cc: Sean Brogan <sean.brogan@microsoft.com>; Kinney, Michael D
> > ><michael.d.kinney@intel.com>; Gao, Liming <liming.gao@intel.com>;
> > >Michael Turner <Michael.Turner@microsoft.com>; Bret Barkelew
> > ><Bret.Barkelew@microsoft.com>
> > >Subject: [PATCH 4/6] MdePkg: Add gEfiCpu2ProtocolGuid and header file
> > >
> > >From: Sean Brogan <sean.brogan@microsoft.com>
> > >
> > >REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1400
> > >
> > >Add gEfiCpu2ProtocolGuid to MdePkg.dec.
> > >Add the header file of Cpu2 protocol: it has one interface to enable
> > >interrupt and put cpu to sleep to wait for an interrupt.
> > >
> > >Cc: Michael D Kinney <michael.d.kinney@intel.com>
> > >Cc: Liming Gao <liming.gao@intel.com>
> > >Cc: Sean Brogan <sean.brogan@microsoft.com>
> > >Cc: Michael Turner <Michael.Turner@microsoft.com>
> > >Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
> > >Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
> > >---
> > > MdePkg/Include/Protocol/Cpu2.h | 43
> > >++++++++++++++++++++++++++++++++++
> > > MdePkg/MdePkg.dec              |  3 +++
> > > 2 files changed, 46 insertions(+)
> > > create mode 100644 MdePkg/Include/Protocol/Cpu2.h
> > >
> > >diff --git a/MdePkg/Include/Protocol/Cpu2.h
> > >b/MdePkg/Include/Protocol/Cpu2.h new file mode 100644 index
> > >0000000000..cacd948140
> > >--- /dev/null
> > >+++ b/MdePkg/Include/Protocol/Cpu2.h
> > >@@ -0,0 +1,43 @@
> > >+/** @file
> > >+  CPU2 Protocol
> > >+
> > >+  This code abstracts the DXE core from processor implementation
> details.
> > >+
> > >+  Copyright (c) 2006 - 2018, Microsoft Corporation. All rights
> > >+ reserved.<BR>
> > >+
> > >+  SPDX-License-Identifier: BSD-2-Clause-Patent
> > >+
> > >+**/
> > >+
> > >+#ifndef __PROTOCOL_CPU2_H__
> > >+#define __PROTOCOL_CPU2_H__
> > >+
> > >+#include <Uefi.h>
> > >+
> > >+typedef struct _EFI_CPU2_PROTOCOL   EFI_CPU2_PROTOCOL;
> > >+
> > >+
> > >+/**
> > >+  This function enables CPU interrupts and then waits for an interrupt
> > >+to
> > >arrive.
> > >+
> > >+  @param  This                  The EFI_CPU2_PROTOCOL
> instance.
> > >+
> > >+  @retval EFI_SUCCESS           Interrupts are enabled on the
> processor.
> > >+  @retval EFI_DEVICE_ERROR      Interrupts could not be enabled
> on the
> > >processor.
> > >+
> > >+**/
> > >+typedef
> > >+EFI_STATUS
> > >+(EFIAPI *EFI_CPU_ENABLE_AND_WAIT_FOR_INTERRUPT)(
> > >+  IN EFI_CPU2_PROTOCOL              *This
> > >+  );
> > >+
> > >+//
> > >+// The EFI_CPU2_PROTOCOL is used to abstract processor-specific
> > >+functions
> > >from the DXE
> > >+// Foundation.
> > >+//
> > >+struct _EFI_CPU2_PROTOCOL {
> > >+  EFI_CPU_ENABLE_AND_WAIT_FOR_INTERRUPT
> > >EnableAndWaitForInterrupt;
> > >+};
> > >+
> > >+#endif
> > >diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index
> > >6c563375ee..e8c6939849 100644
> > >--- a/MdePkg/MdePkg.dec
> > >+++ b/MdePkg/MdePkg.dec
> > >@@ -1803,6 +1803,9 @@
> > >   ## Include/Protocol/ShellDynamicCommand.h
> > >   gEfiShellDynamicCommandProtocolGuid  = { 0x3c7200e9, 0x005f,
> 0x4ea4,
> > >{0x87, 0xde, 0xa3, 0xdf, 0xac, 0x8a, 0x27, 0xc3 }}
> > >
> > >+  ## Include/Protocol/Cpu2.h
> > >+  gEfiCpu2ProtocolGuid                 = { 0x55198405, 0x26C0,
> 0x4765, {0x8B,
> > 0x7D,
> > >0xBE, 0x1D, 0xF5, 0xF9, 0x97, 0x12 }}
> > >+
> > > #
> > > # [Error.gEfiMdePkgTokenSpaceGuid]
> > > #   0x80000001 | Invalid value provided.
> > >--
> > >2.21.0.windows.1
> 
> 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#41314): https://edk2.groups.io/g/devel/message/41314
Mute This Topic: https://groups.io/mt/31741731/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH 4/6] MdePkg: Add gEfiCpu2ProtocolGuid and header file
Posted by Liming Gao 6 years, 8 months ago
If no spec defines it, it belongs to edk2 implementation. It should be placed into other placement and name be with Edkii prefix instead of Uefi.

>-----Original Message-----
>From: Gao, Zhichao
>Sent: Friday, May 24, 2019 1:28 PM
>To: Gao, Liming <liming.gao@intel.com>; devel@edk2.groups.io
>Cc: Sean Brogan <sean.brogan@microsoft.com>; Kinney, Michael D
><michael.d.kinney@intel.com>; Michael Turner
><Michael.Turner@microsoft.com>; Bret Barkelew
><Bret.Barkelew@microsoft.com>
>Subject: RE: [PATCH 4/6] MdePkg: Add gEfiCpu2ProtocolGuid and header file
>
>I have found it in UEFP spec and PI spec. It is not defined in these specs.
>So I think maybe no spec has already defined it.
>
>Thanks,
>Zhichao
>
>> -----Original Message-----
>> From: Gao, Liming
>> Sent: Friday, May 24, 2019 1:20 PM
>> To: Gao, Zhichao <zhichao.gao@intel.com>; devel@edk2.groups.io
>> Cc: Sean Brogan <sean.brogan@microsoft.com>; Kinney, Michael D
>> <michael.d.kinney@intel.com>; Michael Turner
>> <Michael.Turner@microsoft.com>; Bret Barkelew
>> <Bret.Barkelew@microsoft.com>
>> Subject: RE: [PATCH 4/6] MdePkg: Add gEfiCpu2ProtocolGuid and header
>file
>>
>> Zhichao:
>>   Which spec defines Cpu2 protocol?
>>
>> Thanks
>> Liming
>> >-----Original Message-----
>> >From: Gao, Zhichao
>> >Sent: Friday, May 24, 2019 1:05 PM
>> >To: devel@edk2.groups.io
>> >Cc: Sean Brogan <sean.brogan@microsoft.com>; Kinney, Michael D
>> ><michael.d.kinney@intel.com>; Gao, Liming <liming.gao@intel.com>;
>> >Michael Turner <Michael.Turner@microsoft.com>; Bret Barkelew
>> ><Bret.Barkelew@microsoft.com>
>> >Subject: [PATCH 4/6] MdePkg: Add gEfiCpu2ProtocolGuid and header file
>> >
>> >From: Sean Brogan <sean.brogan@microsoft.com>
>> >
>> >REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1400
>> >
>> >Add gEfiCpu2ProtocolGuid to MdePkg.dec.
>> >Add the header file of Cpu2 protocol: it has one interface to enable
>> >interrupt and put cpu to sleep to wait for an interrupt.
>> >
>> >Cc: Michael D Kinney <michael.d.kinney@intel.com>
>> >Cc: Liming Gao <liming.gao@intel.com>
>> >Cc: Sean Brogan <sean.brogan@microsoft.com>
>> >Cc: Michael Turner <Michael.Turner@microsoft.com>
>> >Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
>> >Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
>> >---
>> > MdePkg/Include/Protocol/Cpu2.h | 43
>> >++++++++++++++++++++++++++++++++++
>> > MdePkg/MdePkg.dec              |  3 +++
>> > 2 files changed, 46 insertions(+)
>> > create mode 100644 MdePkg/Include/Protocol/Cpu2.h
>> >
>> >diff --git a/MdePkg/Include/Protocol/Cpu2.h
>> >b/MdePkg/Include/Protocol/Cpu2.h new file mode 100644 index
>> >0000000000..cacd948140
>> >--- /dev/null
>> >+++ b/MdePkg/Include/Protocol/Cpu2.h
>> >@@ -0,0 +1,43 @@
>> >+/** @file
>> >+  CPU2 Protocol
>> >+
>> >+  This code abstracts the DXE core from processor implementation details.
>> >+
>> >+  Copyright (c) 2006 - 2018, Microsoft Corporation. All rights
>> >+ reserved.<BR>
>> >+
>> >+  SPDX-License-Identifier: BSD-2-Clause-Patent
>> >+
>> >+**/
>> >+
>> >+#ifndef __PROTOCOL_CPU2_H__
>> >+#define __PROTOCOL_CPU2_H__
>> >+
>> >+#include <Uefi.h>
>> >+
>> >+typedef struct _EFI_CPU2_PROTOCOL   EFI_CPU2_PROTOCOL;
>> >+
>> >+
>> >+/**
>> >+  This function enables CPU interrupts and then waits for an interrupt
>> >+to
>> >arrive.
>> >+
>> >+  @param  This                  The EFI_CPU2_PROTOCOL instance.
>> >+
>> >+  @retval EFI_SUCCESS           Interrupts are enabled on the processor.
>> >+  @retval EFI_DEVICE_ERROR      Interrupts could not be enabled on the
>> >processor.
>> >+
>> >+**/
>> >+typedef
>> >+EFI_STATUS
>> >+(EFIAPI *EFI_CPU_ENABLE_AND_WAIT_FOR_INTERRUPT)(
>> >+  IN EFI_CPU2_PROTOCOL              *This
>> >+  );
>> >+
>> >+//
>> >+// The EFI_CPU2_PROTOCOL is used to abstract processor-specific
>> >+functions
>> >from the DXE
>> >+// Foundation.
>> >+//
>> >+struct _EFI_CPU2_PROTOCOL {
>> >+  EFI_CPU_ENABLE_AND_WAIT_FOR_INTERRUPT
>> >EnableAndWaitForInterrupt;
>> >+};
>> >+
>> >+#endif
>> >diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index
>> >6c563375ee..e8c6939849 100644
>> >--- a/MdePkg/MdePkg.dec
>> >+++ b/MdePkg/MdePkg.dec
>> >@@ -1803,6 +1803,9 @@
>> >   ## Include/Protocol/ShellDynamicCommand.h
>> >   gEfiShellDynamicCommandProtocolGuid  = { 0x3c7200e9, 0x005f, 0x4ea4,
>> >{0x87, 0xde, 0xa3, 0xdf, 0xac, 0x8a, 0x27, 0xc3 }}
>> >
>> >+  ## Include/Protocol/Cpu2.h
>> >+  gEfiCpu2ProtocolGuid                 = { 0x55198405, 0x26C0, 0x4765, {0x8B,
>> 0x7D,
>> >0xBE, 0x1D, 0xF5, 0xF9, 0x97, 0x12 }}
>> >+
>> > #
>> > # [Error.gEfiMdePkgTokenSpaceGuid]
>> > #   0x80000001 | Invalid value provided.
>> >--
>> >2.21.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#41316): https://edk2.groups.io/g/devel/message/41316
Mute This Topic: https://groups.io/mt/31741731/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH 4/6] MdePkg: Add gEfiCpu2ProtocolGuid and header file
Posted by Gao, Zhichao 6 years, 8 months ago
I would move the definition to MdeModulePkg and change the prefix.

Thanks,
Zhichao

> -----Original Message-----
> From: Gao, Liming
> Sent: Friday, May 24, 2019 2:02 PM
> To: Gao, Zhichao <zhichao.gao@intel.com>; devel@edk2.groups.io
> Cc: Sean Brogan <sean.brogan@microsoft.com>; Kinney, Michael D
> <michael.d.kinney@intel.com>; Michael Turner
> <Michael.Turner@microsoft.com>; Bret Barkelew
> <Bret.Barkelew@microsoft.com>
> Subject: RE: [PATCH 4/6] MdePkg: Add gEfiCpu2ProtocolGuid and header file
> 
> If no spec defines it, it belongs to edk2 implementation. It should be placed
> into other placement and name be with Edkii prefix instead of Uefi.
> 
> >-----Original Message-----
> >From: Gao, Zhichao
> >Sent: Friday, May 24, 2019 1:28 PM
> >To: Gao, Liming <liming.gao@intel.com>; devel@edk2.groups.io
> >Cc: Sean Brogan <sean.brogan@microsoft.com>; Kinney, Michael D
> ><michael.d.kinney@intel.com>; Michael Turner
> ><Michael.Turner@microsoft.com>; Bret Barkelew
> ><Bret.Barkelew@microsoft.com>
> >Subject: RE: [PATCH 4/6] MdePkg: Add gEfiCpu2ProtocolGuid and header
> >file
> >
> >I have found it in UEFP spec and PI spec. It is not defined in these specs.
> >So I think maybe no spec has already defined it.
> >
> >Thanks,
> >Zhichao
> >
> >> -----Original Message-----
> >> From: Gao, Liming
> >> Sent: Friday, May 24, 2019 1:20 PM
> >> To: Gao, Zhichao <zhichao.gao@intel.com>; devel@edk2.groups.io
> >> Cc: Sean Brogan <sean.brogan@microsoft.com>; Kinney, Michael D
> >> <michael.d.kinney@intel.com>; Michael Turner
> >> <Michael.Turner@microsoft.com>; Bret Barkelew
> >> <Bret.Barkelew@microsoft.com>
> >> Subject: RE: [PATCH 4/6] MdePkg: Add gEfiCpu2ProtocolGuid and header
> >file
> >>
> >> Zhichao:
> >>   Which spec defines Cpu2 protocol?
> >>
> >> Thanks
> >> Liming
> >> >-----Original Message-----
> >> >From: Gao, Zhichao
> >> >Sent: Friday, May 24, 2019 1:05 PM
> >> >To: devel@edk2.groups.io
> >> >Cc: Sean Brogan <sean.brogan@microsoft.com>; Kinney, Michael D
> >> ><michael.d.kinney@intel.com>; Gao, Liming <liming.gao@intel.com>;
> >> >Michael Turner <Michael.Turner@microsoft.com>; Bret Barkelew
> >> ><Bret.Barkelew@microsoft.com>
> >> >Subject: [PATCH 4/6] MdePkg: Add gEfiCpu2ProtocolGuid and header
> >> >file
> >> >
> >> >From: Sean Brogan <sean.brogan@microsoft.com>
> >> >
> >> >REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1400
> >> >
> >> >Add gEfiCpu2ProtocolGuid to MdePkg.dec.
> >> >Add the header file of Cpu2 protocol: it has one interface to enable
> >> >interrupt and put cpu to sleep to wait for an interrupt.
> >> >
> >> >Cc: Michael D Kinney <michael.d.kinney@intel.com>
> >> >Cc: Liming Gao <liming.gao@intel.com>
> >> >Cc: Sean Brogan <sean.brogan@microsoft.com>
> >> >Cc: Michael Turner <Michael.Turner@microsoft.com>
> >> >Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
> >> >Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
> >> >---
> >> > MdePkg/Include/Protocol/Cpu2.h | 43
> >> >++++++++++++++++++++++++++++++++++
> >> > MdePkg/MdePkg.dec              |  3 +++
> >> > 2 files changed, 46 insertions(+)
> >> > create mode 100644 MdePkg/Include/Protocol/Cpu2.h
> >> >
> >> >diff --git a/MdePkg/Include/Protocol/Cpu2.h
> >> >b/MdePkg/Include/Protocol/Cpu2.h new file mode 100644 index
> >> >0000000000..cacd948140
> >> >--- /dev/null
> >> >+++ b/MdePkg/Include/Protocol/Cpu2.h
> >> >@@ -0,0 +1,43 @@
> >> >+/** @file
> >> >+  CPU2 Protocol
> >> >+
> >> >+  This code abstracts the DXE core from processor implementation
> details.
> >> >+
> >> >+  Copyright (c) 2006 - 2018, Microsoft Corporation. All rights
> >> >+ reserved.<BR>
> >> >+
> >> >+  SPDX-License-Identifier: BSD-2-Clause-Patent
> >> >+
> >> >+**/
> >> >+
> >> >+#ifndef __PROTOCOL_CPU2_H__
> >> >+#define __PROTOCOL_CPU2_H__
> >> >+
> >> >+#include <Uefi.h>
> >> >+
> >> >+typedef struct _EFI_CPU2_PROTOCOL   EFI_CPU2_PROTOCOL;
> >> >+
> >> >+
> >> >+/**
> >> >+  This function enables CPU interrupts and then waits for an
> >> >+interrupt to
> >> >arrive.
> >> >+
> >> >+  @param  This                  The EFI_CPU2_PROTOCOL instance.
> >> >+
> >> >+  @retval EFI_SUCCESS           Interrupts are enabled on the processor.
> >> >+  @retval EFI_DEVICE_ERROR      Interrupts could not be enabled on the
> >> >processor.
> >> >+
> >> >+**/
> >> >+typedef
> >> >+EFI_STATUS
> >> >+(EFIAPI *EFI_CPU_ENABLE_AND_WAIT_FOR_INTERRUPT)(
> >> >+  IN EFI_CPU2_PROTOCOL              *This
> >> >+  );
> >> >+
> >> >+//
> >> >+// The EFI_CPU2_PROTOCOL is used to abstract processor-specific
> >> >+functions
> >> >from the DXE
> >> >+// Foundation.
> >> >+//
> >> >+struct _EFI_CPU2_PROTOCOL {
> >> >+  EFI_CPU_ENABLE_AND_WAIT_FOR_INTERRUPT
> >> >EnableAndWaitForInterrupt;
> >> >+};
> >> >+
> >> >+#endif
> >> >diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index
> >> >6c563375ee..e8c6939849 100644
> >> >--- a/MdePkg/MdePkg.dec
> >> >+++ b/MdePkg/MdePkg.dec
> >> >@@ -1803,6 +1803,9 @@
> >> >   ## Include/Protocol/ShellDynamicCommand.h
> >> >   gEfiShellDynamicCommandProtocolGuid  = { 0x3c7200e9, 0x005f,
> >> >0x4ea4, {0x87, 0xde, 0xa3, 0xdf, 0xac, 0x8a, 0x27, 0xc3 }}
> >> >
> >> >+  ## Include/Protocol/Cpu2.h
> >> >+  gEfiCpu2ProtocolGuid                 = { 0x55198405, 0x26C0, 0x4765, {0x8B,
> >> 0x7D,
> >> >0xBE, 0x1D, 0xF5, 0xF9, 0x97, 0x12 }}
> >> >+
> >> > #
> >> > # [Error.gEfiMdePkgTokenSpaceGuid]
> >> > #   0x80000001 | Invalid value provided.
> >> >--
> >> >2.21.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#41318): https://edk2.groups.io/g/devel/message/41318
Mute This Topic: https://groups.io/mt/31741731/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-