Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: Move to github pull request workflow

2024-09-04 Thread Jayaprakash, N
Hi Rebecca,

Below suggestion from Mike also seems reasonable.

Could you review and approve the patch?

Regards,
JP

-Original Message-
From: Kinney, Michael D  
Sent: Wednesday, September 4, 2024 9:34 PM
To: Rebecca Cran ; devel@edk2.groups.io; 
Jayaprakash, N 
Cc: Rebecca Cran ; Kinney, Michael D 

Subject: RE: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: Move to github pull 
request workflow

I prefer to keep all the repos aligned so we do not have to do any changes if 
reviewers are added in the future.

Mike

> -Original Message-
> From: Rebecca Cran 
> Sent: Wednesday, September 4, 2024 8:33 AM
> To: devel@edk2.groups.io; Jayaprakash, N 
> Cc: Rebecca Cran ; Kinney, Michael D 
> 
> Subject: Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: Move to 
> github pull request workflow
> 
> We don't need AssignReviewers.yaml since there are no reviewers only 
> maintainers.
> 
> Otherwise it looks good.
> 
> 
> --
> 
> Rebecca
> 
> 
> On 9/4/2024 9:20 AM, Jayaprakash, N via groups.io wrote:
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4840
> >
> > Migrate data from Maintainers.txt to the GitHub standard CODEOWNERS 
> > and CONTRIBUTORS.md. The latter file contains mappings from name to 
> > email address and GitHub usernames, which will help people who want 
> > to email maintainers instead of using GitHub.
> >
> > Add .github/workflows/AssignReviewers.yml which adds reviewers to a 
> > Pull Request based on the content of the CODEOWNERS file.
> >
> > Cc: Rebecca Cran 
> > Cc: Michael D Kinney 
> > Cc: Jayaprakash N 
> > Signed-off-by: Jayaprakash N 
> > ---
> >   .github/workflows/AssignReviewers.yaml | 34 
> >   CODEOWNERS | 21 
> >   CONTRIBUTORS.md| 13 +
> >   Maintainers.txt| 71 
> --
> >   4 files changed, 68 insertions(+), 71 deletions(-)
> >   create mode 100644 .github/workflows/AssignReviewers.yaml
> >   create mode 100644 CODEOWNERS
> >   create mode 100644 CONTRIBUTORS.md
> >   delete mode 100644 Maintainers.txt
> >
> > diff --git a/.github/workflows/AssignReviewers.yaml
> b/.github/workflows/AssignReviewers.yaml
> > new file mode 100644
> > index 000..4d0779e
> > --- /dev/null
> > +++ b/.github/workflows/AssignReviewers.yaml
> > @@ -0,0 +1,34 @@
> > +## @file
> > +# Assign reviewers from a REVIEWERS file using CODEOWNERS syntax # 
> > +# Copyright (c) 2024, Intel Corporation. All rights reserved. # 
> > +SPDX-License-Identifier: BSD-2-Clause-Patent ##
> > +
> > +name: Assign reviewers from a REVIEWERS file using CODEOWNERS 
> > +syntax
> > +
> > +on:
> > +  pull_request_target:
> > +types: [opened, synchronize, reopened, ready_for_review]
> > +branches:
> > +  - master
> > +
> > +jobs:
> > +  assign_reviewers:
> > +if: github.event.pull_request.draft == false
> > +runs-on: ubuntu-latest
> > +permissions:
> > +  pull-requests: write
> > +steps:
> > +  - name: Generate Token
> > +id: generate-token
> > +uses: actions/create-github-app-token@v1
> > +with:
> > +  app-id: ${{
> secrets.TIANOCORE_ASSIGN_REVIEWERS_APPLICATION_ID }}
> > +  private-key: ${{
> secrets.TIANOCORE_ASSIGN_REVIEWERS_APPLICATION_PRIVATE_KEY }}
> > +  - name: Checkout Pull Request Target
> > +uses: actions/checkout@v2
> > +  - name: Assign Reviewers
> > +uses: mdkinney/github-action-assign-reviewers@main
> > +with:
> > +  token: ${{ steps.generate-token.outputs.token }}
> > \ No newline at end of file
> > diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 
> > 000..f171244
> > --- /dev/null
> > +++ b/CODEOWNERS
> > @@ -0,0 +1,21 @@
> > +## @file
> > +# This file contains the code owners of edk2-libc repo # # 
> > +Copyright (c) 2024, Intel Corporation. All rights reserved. # 
> > +SPDX-License-Identifier: BSD-2-Clause-Patent ##
> > +
> > +# This file contains the list of maintainers (i.e. people who own 
> > +the # areas and can commit changes) for various parts of edk2-libc.
> > +
> > +# EDK II Platforms maintainers
> > +# 
> > +
> > +* @mdkinney @bcran @jpshivakavi
> > +
> > +# AppPkg owners
> > +AppPkg/** @mdkinney @jpshivakavi @bcran
> > +
> > +# StdLib and StdLibPrivateInternalFiles owners
> > +StdLib/** @mdkinn

Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: Move to github pull request workflow

2024-09-04 Thread Jayaprakash, N
Thanks Rebecca.
I shall make that change and submit the patch for review.

Regards,
JP

-Original Message-
From: Rebecca Cran  
Sent: Wednesday, September 4, 2024 9:03 PM
To: devel@edk2.groups.io; Jayaprakash, N 
Cc: Rebecca Cran ; Kinney, Michael D 

Subject: Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: Move to github pull 
request workflow

We don't need AssignReviewers.yaml since there are no reviewers only 
maintainers.

Otherwise it looks good.


--

Rebecca


On 9/4/2024 9:20 AM, Jayaprakash, N via groups.io wrote:
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4840
>
> Migrate data from Maintainers.txt to the GitHub standard CODEOWNERS 
> and CONTRIBUTORS.md. The latter file contains mappings from name to 
> email address and GitHub usernames, which will help people who want to 
> email maintainers instead of using GitHub.
>
> Add .github/workflows/AssignReviewers.yml which adds reviewers to a 
> Pull Request based on the content of the CODEOWNERS file.
>
> Cc: Rebecca Cran 
> Cc: Michael D Kinney 
> Cc: Jayaprakash N 
> Signed-off-by: Jayaprakash N 
> ---
>   .github/workflows/AssignReviewers.yaml | 34 
>   CODEOWNERS | 21 
>   CONTRIBUTORS.md| 13 +
>   Maintainers.txt| 71 --
>   4 files changed, 68 insertions(+), 71 deletions(-)
>   create mode 100644 .github/workflows/AssignReviewers.yaml
>   create mode 100644 CODEOWNERS
>   create mode 100644 CONTRIBUTORS.md
>   delete mode 100644 Maintainers.txt
>
> diff --git a/.github/workflows/AssignReviewers.yaml 
> b/.github/workflows/AssignReviewers.yaml
> new file mode 100644
> index 000..4d0779e
> --- /dev/null
> +++ b/.github/workflows/AssignReviewers.yaml
> @@ -0,0 +1,34 @@
> +## @file
> +# Assign reviewers from a REVIEWERS file using CODEOWNERS syntax # # 
> +Copyright (c) 2024, Intel Corporation. All rights reserved. # 
> +SPDX-License-Identifier: BSD-2-Clause-Patent ##
> +
> +name: Assign reviewers from a REVIEWERS file using CODEOWNERS syntax
> +
> +on:
> +  pull_request_target:
> +types: [opened, synchronize, reopened, ready_for_review]
> +branches:
> +  - master
> +
> +jobs:
> +  assign_reviewers:
> +if: github.event.pull_request.draft == false
> +runs-on: ubuntu-latest
> +permissions:
> +  pull-requests: write
> +steps:
> +  - name: Generate Token
> +id: generate-token
> +uses: actions/create-github-app-token@v1
> +with:
> +  app-id: ${{ secrets.TIANOCORE_ASSIGN_REVIEWERS_APPLICATION_ID }}
> +  private-key: ${{ 
> secrets.TIANOCORE_ASSIGN_REVIEWERS_APPLICATION_PRIVATE_KEY }}
> +  - name: Checkout Pull Request Target
> +uses: actions/checkout@v2
> +  - name: Assign Reviewers
> +uses: mdkinney/github-action-assign-reviewers@main
> +with:
> +  token: ${{ steps.generate-token.outputs.token }}
> \ No newline at end of file
> diff --git a/CODEOWNERS b/CODEOWNERS
> new file mode 100644
> index 000..f171244
> --- /dev/null
> +++ b/CODEOWNERS
> @@ -0,0 +1,21 @@
> +## @file
> +# This file contains the code owners of edk2-libc repo # # Copyright 
> +(c) 2024, Intel Corporation. All rights reserved. # 
> +SPDX-License-Identifier: BSD-2-Clause-Patent ##
> +
> +# This file contains the list of maintainers (i.e. people who own the 
> +# areas and can commit changes) for various parts of edk2-libc.
> +
> +# EDK II Platforms maintainers
> +# 
> +
> +* @mdkinney @bcran @jpshivakavi
> +
> +# AppPkg owners
> +AppPkg/** @mdkinney @jpshivakavi @bcran
> +
> +# StdLib and StdLibPrivateInternalFiles owners
> +StdLib/** @mdkinney @jpshivakavi @bcran
> +StdLibPrivateInternalFiles/** @mdkinney @jpshivakavi @bcran
> diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md new file mode 100644 
> index 000..5173898
> --- /dev/null
> +++ b/CONTRIBUTORS.md
> @@ -0,0 +1,13 @@
> +EDK II Libc Maintainers and Reviewers 
> +==
> +
> +This file is intended to provide an easy way to look up people's names and 
> email addresses given their GitHub usernames from the CODEOWNERS / REVIEWERS 
> files.
> +
> +Since it's an extra file to remember to update when changing maintainers or 
> reviewers, it will likely become out-of-sync with CODEOWNERS and/or REVIEWERS 
> over time and need an occasional refresh.
> +
> +
> +| Name | e-mail address| Githubusername  
> |
> +|--|---|-

Re: [edk2-devel] Migrating edk2-libc to use GitHub PR review process

2024-09-04 Thread Jayaprakash, N
Hi Rebecca,

I went through this patch and made changes to edk2-libc repo to migrate the 
review process to Github PR workflow.
I have sent the email path for your review. 

Please review and let me know if anything else needed.

Regards,
JP

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Jayaprakash, N
Sent: Wednesday, August 7, 2024 2:41 PM
To: devel@edk2.groups.io; rebe...@bsdio.com
Cc: Kinney, Michael D 
Subject: Re: [edk2-devel] Migrating edk2-libc to use GitHub PR review process

Thanks Rebecca.

I am going through this and get back to you for any help soon.

Regards,
JP

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Rebecca Cran
Sent: Tuesday, August 6, 2024 4:16 PM
To: Jayaprakash, N ; devel@edk2.groups.io
Cc: Kinney, Michael D 
Subject: Re: [edk2-devel] Migrating edk2-libc to use GitHub PR review process

On 8/6/2024 3:10 AM, Jayaprakash, N wrote:
>
> Hi Rebecca,
>
> Mike suggested me to talk to you to see the possibility of getting 
> edk2-libc repo to the GitHub PR review process.
>
> It’s a relatively small repo with few contributors.
>
> Would like to understand what it takes to migrate to the new process? 
> Would you be able to help in this migration?
>
I'd be happy to help! We just need to move Maintainers.txt to CODEOWNERS and 
create a CONTRIBUTORS.md file (there aren't any reviewers, so we don't need a 
REVIEWERS file) and we can start using pull requests.


See the patch I sent out for edk2-platforms for an example: 
https://edk2.groups.io/g/devel/message/120195


--
Rebecca













-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#120500): https://edk2.groups.io/g/devel/message/120500
Mute This Topic: https://groups.io/mt/107747994/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-libc Patch 1/1] edk2-libc: Move to github pull request workflow

2024-09-04 Thread Jayaprakash, N
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4840

Migrate data from Maintainers.txt to the GitHub standard CODEOWNERS
and CONTRIBUTORS.md. The latter file contains mappings from name to
email address and GitHub usernames, which will help people who want
to email maintainers instead of using GitHub.

Add .github/workflows/AssignReviewers.yml which adds reviewers to a
Pull Request based on the content of the CODEOWNERS file.

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Cc: Jayaprakash N 
Signed-off-by: Jayaprakash N 
---
 .github/workflows/AssignReviewers.yaml | 34 
 CODEOWNERS | 21 
 CONTRIBUTORS.md| 13 +
 Maintainers.txt| 71 --
 4 files changed, 68 insertions(+), 71 deletions(-)
 create mode 100644 .github/workflows/AssignReviewers.yaml
 create mode 100644 CODEOWNERS
 create mode 100644 CONTRIBUTORS.md
 delete mode 100644 Maintainers.txt

diff --git a/.github/workflows/AssignReviewers.yaml 
b/.github/workflows/AssignReviewers.yaml
new file mode 100644
index 000..4d0779e
--- /dev/null
+++ b/.github/workflows/AssignReviewers.yaml
@@ -0,0 +1,34 @@
+## @file
+# Assign reviewers from a REVIEWERS file using CODEOWNERS syntax
+#
+# Copyright (c) 2024, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+##
+
+name: Assign reviewers from a REVIEWERS file using CODEOWNERS syntax
+
+on:
+  pull_request_target:
+types: [opened, synchronize, reopened, ready_for_review]
+branches:
+  - master
+
+jobs:
+  assign_reviewers:
+if: github.event.pull_request.draft == false
+runs-on: ubuntu-latest
+permissions:
+  pull-requests: write
+steps:
+  - name: Generate Token
+id: generate-token
+uses: actions/create-github-app-token@v1
+with:
+  app-id: ${{ secrets.TIANOCORE_ASSIGN_REVIEWERS_APPLICATION_ID }}
+  private-key: ${{ 
secrets.TIANOCORE_ASSIGN_REVIEWERS_APPLICATION_PRIVATE_KEY }}
+  - name: Checkout Pull Request Target
+uses: actions/checkout@v2
+  - name: Assign Reviewers
+uses: mdkinney/github-action-assign-reviewers@main
+with:
+  token: ${{ steps.generate-token.outputs.token }}
\ No newline at end of file
diff --git a/CODEOWNERS b/CODEOWNERS
new file mode 100644
index 000..f171244
--- /dev/null
+++ b/CODEOWNERS
@@ -0,0 +1,21 @@
+## @file
+# This file contains the code owners of edk2-libc repo
+#
+# Copyright (c) 2024, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+##
+
+# This file contains the list of maintainers (i.e. people who own the
+# areas and can commit changes) for various parts of edk2-libc.
+
+# EDK II Platforms maintainers
+# 
+
+* @mdkinney @bcran @jpshivakavi
+
+# AppPkg owners
+AppPkg/** @mdkinney @jpshivakavi @bcran
+
+# StdLib and StdLibPrivateInternalFiles owners
+StdLib/** @mdkinney @jpshivakavi @bcran
+StdLibPrivateInternalFiles/** @mdkinney @jpshivakavi @bcran
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
new file mode 100644
index 000..5173898
--- /dev/null
+++ b/CONTRIBUTORS.md
@@ -0,0 +1,13 @@
+EDK II Libc Maintainers and Reviewers
+==
+
+This file is intended to provide an easy way to look up people's names and 
email addresses given their GitHub usernames from the CODEOWNERS / REVIEWERS 
files.
+
+Since it's an extra file to remember to update when changing maintainers or 
reviewers, it will likely become out-of-sync with CODEOWNERS and/or REVIEWERS 
over time and need an occasional refresh.
+
+
+| Name | e-mail address| Githubusername
  |
+|--|---|-|
+| Rebecca Cran | rebe...@bsdio.com | 
[@bcran](https://github.com/bcran)  |
+| Michael D Kinney | michael.d.kin...@intel.com| 
[@mdkinney](https://github.com/mdkinney)|
+| Jayaprakash Nevara   | n.jayaprak...@intel.com   | 
[@jpshivakavi](https://github.com/jpshivakavi)  |
diff --git a/Maintainers.txt b/Maintainers.txt
deleted file mode 100644
index 8a98987..000
--- a/Maintainers.txt
+++ /dev/null
@@ -1,71 +0,0 @@
-EDK II LIBC Project Maintainers
-===
-
-This file provides information about the primary maintainers for the EDK II 
LIBC
-Project.  This repository was exported from the edk2 repository and depends
-on the edk2 repository.  The following are the links to the edk2 repository:
-
-https://github.com/tianocore/edk2
-https://github.com/tianocore/edk2/blob/master/Readme.md
-https://github.com/tianocore/edk2/blob/master/Maintainers.txt
-
-In general, you should not privately email the maintainer. You should
-email the edk2-devel list, and Cc the package maintainers and
-reviewers.

[edk2-devel] [edk2-libc Patch 0/1] Migrate to github pull request workflow

2024-09-04 Thread Jayaprakash, N
Migrate data from Maintainers.txt to the GitHub standard CODEOWNERS
and CONTRIBUTORS.md. The latter file contains mappings from name to
email address and GitHub usernames, which will help people who want
to email maintainers instead of using GitHub.

Add .github/workflows/AssignReviewers.yml which adds reviewers to a
Pull Request based on the content of the REVIEWERS file.

Jayaprakash N (1):
  edk2-libc: Move to github pull request workflow

 .github/workflows/AssignReviewers.yaml | 34 
 CODEOWNERS | 21 
 CONTRIBUTORS.md| 13 +
 Maintainers.txt| 71 --
 4 files changed, 68 insertions(+), 71 deletions(-)
 create mode 100644 .github/workflows/AssignReviewers.yaml
 create mode 100644 CODEOWNERS
 create mode 100644 CONTRIBUTORS.md
 delete mode 100644 Maintainers.txt

-- 
2.46.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#120498): https://edk2.groups.io/g/devel/message/120498
Mute This Topic: https://groups.io/mt/108267101/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-libc Patch v2 1/1] edk2-libc: BKM document to build Python UEFI using Visual Studio Tools

2024-08-25 Thread Jayaprakash, N
Hi Rebecca,

This address your comment. 
Please review and approve the same.

Regards,
JP

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Jayaprakash, N
Sent: Wednesday, August 21, 2024 11:12 AM
To: devel@edk2.groups.io
Cc: Jayaprakash, N ; Rebecca Cran ; 
Kinney, Michael D 
Subject: [edk2-devel] [edk2-libc Patch v2 1/1] edk2-libc: BKM document to build 
Python UEFI using Visual Studio Tools

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

There is a BKM document which provides detailed step by step instructions to 
build Python UEFI interpreter using GCC tool chain from Ubuntu Linux OS. But 
there is no complete BKM document providing the similar details to build on 
Windows using VS2019/VS2022 tool chains. This commit adds a new BKM document 
providing the step by step instructions to build Python UEFI interpreter using 
Visual Studio tool chains such as VS2019/VS2022.

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Cc: Jayaprakash N 
Signed-off-by: Jayaprakash N 
---
 .../Python/Python-3.6.8/VSCompilationBKMs.md  | 126 ++
 1 file changed, 126 insertions(+)
 create mode 100644 AppPkg/Applications/Python/Python-3.6.8/VSCompilationBKMs.md

diff --git a/AppPkg/Applications/Python/Python-3.6.8/VSCompilationBKMs.md 
b/AppPkg/Applications/Python/Python-3.6.8/VSCompilationBKMs.md
new file mode 100644
index 000..87a5d7a
--- /dev/null
+++ b/AppPkg/Applications/Python/Python-3.6.8/VSCompilationBKMs.md
@@ -0,0 +1,126 @@
+# Building Python UEFI Interpreter uisng Visual Studio Tool Chain(s)
+
+## 1. Introduction
+This is a Best-Known Methods document capturing the details of build 
environment setup for compiling the Python UEFI interpreter version 3.6.8 using 
Microsoft Visual Studio Tool chains on Windows 11 systems. These BKMs have been 
tested on Windows 11 with VS2019 and VS2022 tool chains.
+
+## 2. Pre-requisites
+a. Install the Microsoft Visual Studio tool chain VS2022 community version by 
downloading it from [here](https://visualstudio.microsoft.com/downloads/). You 
could also use VS2019 for building Python UEFI interpreter.
+
+b. Install the latest version of NASM assembler for X64 bit platforms by 
downloading it from 
[here](https://www.nasm.us/pub/nasm/releasebuilds/2.16.03/win64/nasm-2.16.03-installer-x64.exe).
+
+c. Install the ASL tools by downloading it from [Intel's 
website](https://www.intel.com/content/www/us/en/download/774881/acpi-component-architecture-downloads-windows-binary-tools.html).
 Unzip the iasl-win-*.zip folder, create a folder with name ASL in `C:\` drive 
as `C:\ASL\`, then copy all the contents from the unzipped folder to `C:\ASL\`.
+
+d. Install the latest version of Python by downloading it from 
[here](https://www.python.org/ftp/python/3.12.5/python-3.12.5-amd64.exe). While 
installing Python, click on customize installation, click next, check the Add 
Python to environment variables, modify the installation path to 
`c:\python312\`, then click install.
+
+e. Install git bash or any other git source code management tools you are 
comfortable with. You may download the git bash for windows from [this 
website](https://github.com/git-for-windows/git/releases/download/v2.46.0.windows.1/Git-2.46.0-64-bit.exe).
+
+
+## 3. Setup Edk2 Build Environment
+a. Open a windows command prompt (not PowerShell) and create a folder with 
name `src` and change your working folder to the newly created folder using the 
commands provided below:
+```cmd
+   mkdir src
+   cd src
+```
+
+b. Clone the `edk2` repo and initialize all the submodule within it using the 
commands provided below:
+```cmd
+   git clone https://github.com/tianocore/edk2.git
+   cd edk2
+   git submodule update --init
+```
+
+c. Run the below command to build the BaseTools:
+```cmd
+   python -m pip install -r pip-requirements.txt --upgrade
+   python BaseTools\Edk2ToolsBuild.py -t VS2022 ```
+
+## 4. Setup Build Environment to Build Python UEFI Interpreter a. 
+Change your working directory to `src` folder using the following command:
+```cmd
+   cd ..
+```
+
+b. Clone `edk2-libc` repo using the following command:
+```cmd
+   git clone https://github.com/tianocore/edk2-libc.git
+```
+
+c. Set the PACKAGES_PATH and EDK2_LIBC_PATH using the commands below:
+```cmd
+   set PACKAGES_PATH=%cd%\edk2;%cd%\edk2-libc
+   set EDK2_LIBC_PATH=%cd%\edk2-libc
+```
+
+
+## 5. Build Python UEFI Interpreter with VS2022 compiler You may use 
+the commands provided below to build the Python UEFI interpreter using Visual 
Studio 2022 compiler tool chain.
+```cmd
+   cd edk2
+   edksetup.bat
+   cd ..
+   cd edk2-libc\AppPkg\Applications\Python\Python-3.6.8\
+   python srcprep.py
+   cd ..\..\..\..\..\edk2
+```
+
+Use one of the below command to build Python UEFI interpreter ```cmd
+   build -t VS2022 -a X64 -p ../edk2-libc/AppPkg/AppPkg.dsc -m 
+../edk2-libc/AppPkg/Applications/Python/Python-3.6.8/Python368.inf  -b RELEASE 
-D BUILD_PYTH

Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: BKM document to build Python UEFI using Visual Studio Tools

2024-08-20 Thread Jayaprakash, N
I have addressed your comment and sent an updated version of the patch V2 for 
the review.
Please do the needful.

Regards,
JP

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Rebecca Cran
Sent: Tuesday, August 20, 2024 10:22 PM
To: devel@edk2.groups.io; Jayaprakash, N 
Cc: Kinney, Michael D 
Subject: Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: BKM document to 
build Python UEFI using Visual Studio Tools

Not that I know of, except that it's the 'new' way.


-- 

Rebecca


On 8/20/24 10:24 AM, Jayaprakash, N wrote:
> Hi Rebecca,
>
> Thanks for your suggestion.
>
> Would like to know if there are any advantages of calling this Python script 
> over calling edksetup.bat directly.
>
> Regards,
> JP
> -Original Message-
> From: Rebecca Cran 
> Sent: Tuesday, August 20, 2024 9:43 PM
> To: devel@edk2.groups.io; Jayaprakash, N 
> Cc: Kinney, Michael D 
> Subject: Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: BKM document to 
> build Python UEFI using Visual Studio Tools
>
>
> On 8/20/24 9:57 AM, Jayaprakash, N wrote:
>> +c. Run the below command to setup the tool chain environment variables and 
>> build the BaseTools:
>> +```cmd
>> +   edksetup.bat
>> +   edksetup.bat Rebuild VS2022
> Should we suggest people use Edk2ToolsBuild.py instead?
>
>







-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#120385): https://edk2.groups.io/g/devel/message/120385
Mute This Topic: https://groups.io/mt/108003139/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-libc Patch v2 1/1] edk2-libc: BKM document to build Python UEFI using Visual Studio Tools

2024-08-20 Thread Jayaprakash, N
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4810

There is a BKM document which provides detailed step by step
instructions to build Python UEFI interpreter using GCC tool
chain from Ubuntu Linux OS. But there is no complete BKM document
providing the similar details to build on Windows using VS2019/VS2022
tool chains. This commit adds a new BKM document providing the step
by step instructions to build Python UEFI interpreter using Visual
Studio tool chains such as VS2019/VS2022.

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Cc: Jayaprakash N 
Signed-off-by: Jayaprakash N 
---
 .../Python/Python-3.6.8/VSCompilationBKMs.md  | 126 ++
 1 file changed, 126 insertions(+)
 create mode 100644 AppPkg/Applications/Python/Python-3.6.8/VSCompilationBKMs.md

diff --git a/AppPkg/Applications/Python/Python-3.6.8/VSCompilationBKMs.md 
b/AppPkg/Applications/Python/Python-3.6.8/VSCompilationBKMs.md
new file mode 100644
index 000..87a5d7a
--- /dev/null
+++ b/AppPkg/Applications/Python/Python-3.6.8/VSCompilationBKMs.md
@@ -0,0 +1,126 @@
+# Building Python UEFI Interpreter uisng Visual Studio Tool Chain(s)
+
+## 1. Introduction
+This is a Best-Known Methods document capturing the details of build 
environment setup for compiling the Python UEFI interpreter version 3.6.8 using 
Microsoft Visual Studio Tool chains on Windows 11 systems. These BKMs have been 
tested on Windows 11 with VS2019 and VS2022 tool chains.
+
+## 2. Pre-requisites
+a. Install the Microsoft Visual Studio tool chain VS2022 community version by 
downloading it from [here](https://visualstudio.microsoft.com/downloads/). You 
could also use VS2019 for building Python UEFI interpreter.
+
+b. Install the latest version of NASM assembler for X64 bit platforms by 
downloading it from 
[here](https://www.nasm.us/pub/nasm/releasebuilds/2.16.03/win64/nasm-2.16.03-installer-x64.exe).
+
+c. Install the ASL tools by downloading it from [Intel's 
website](https://www.intel.com/content/www/us/en/download/774881/acpi-component-architecture-downloads-windows-binary-tools.html).
 Unzip the iasl-win-*.zip folder, create a folder with name ASL in `C:\` drive 
as `C:\ASL\`, then copy all the contents from the unzipped folder to `C:\ASL\`.
+
+d. Install the latest version of Python by downloading it from 
[here](https://www.python.org/ftp/python/3.12.5/python-3.12.5-amd64.exe). While 
installing Python, click on customize installation, click next, check the Add 
Python to environment variables, modify the installation path to 
`c:\python312\`, then click install.
+
+e. Install git bash or any other git source code management tools you are 
comfortable with. You may download the git bash for windows from [this 
website](https://github.com/git-for-windows/git/releases/download/v2.46.0.windows.1/Git-2.46.0-64-bit.exe).
+
+
+## 3. Setup Edk2 Build Environment
+a. Open a windows command prompt (not PowerShell) and create a folder with 
name `src` and change your working folder to the newly created folder using the 
commands provided below:
+```cmd
+   mkdir src
+   cd src
+```
+
+b. Clone the `edk2` repo and initialize all the submodule within it using the 
commands provided below:
+```cmd
+   git clone https://github.com/tianocore/edk2.git
+   cd edk2
+   git submodule update --init
+```
+
+c. Run the below command to build the BaseTools:
+```cmd
+   python -m pip install -r pip-requirements.txt --upgrade
+   python BaseTools\Edk2ToolsBuild.py -t VS2022
+```
+
+## 4. Setup Build Environment to Build Python UEFI Interpreter
+a. Change your working directory to `src` folder using the following command:
+```cmd
+   cd ..
+```
+
+b. Clone `edk2-libc` repo using the following command:
+```cmd
+   git clone https://github.com/tianocore/edk2-libc.git
+```
+
+c. Set the PACKAGES_PATH and EDK2_LIBC_PATH using the commands below:
+```cmd
+   set PACKAGES_PATH=%cd%\edk2;%cd%\edk2-libc
+   set EDK2_LIBC_PATH=%cd%\edk2-libc
+```
+
+
+## 5. Build Python UEFI Interpreter with VS2022 compiler
+You may use the commands provided below to build the Python UEFI interpreter 
using Visual Studio 2022 compiler tool chain.
+```cmd
+   cd edk2
+   edksetup.bat
+   cd ..
+   cd edk2-libc\AppPkg\Applications\Python\Python-3.6.8\
+   python srcprep.py
+   cd ..\..\..\..\..\edk2
+```
+
+Use one of the below command to build Python UEFI interpreter
+```cmd
+   build -t VS2022 -a X64 -p ../edk2-libc/AppPkg/AppPkg.dsc -m 
../edk2-libc/AppPkg/Applications/Python/Python-3.6.8/Python368.inf  -b RELEASE 
-D BUILD_PYTHON368
+```
+ or
+
+```cmd
+   build -t VS2022 -a X64 -b RELEASE -p ../edk2-libc/AppPkg/AppPkg.dsc -D 
BUILD_PYTHON368
+```
+
+
+## 6. Create a Deployable Python UEFI package
+To create a usable Python UEFI package with all the dependencies from the 
build environment, you can use the batch (.bat) create_python_pkg.bat script 
available under edk2-libc/AppPkg/Applications/Python/Python-3.6.8 folder.
+
+Ensure

[edk2-devel] [edk2-libc Patch v2 0/1] Add BKM document to build Python UEFI using VS Tools

2024-08-20 Thread Jayaprakash, N
There is a BKM document which provides detailed step by step
instructions to build Python UEFI interpreter using GCC tool
chain from Ubuntu Linux OS. But there is no complete BKM document
providing the similar details to build on Windows using VS2019/VS2022
tool chains. 

This patch adds a new BKM document providing the step by step
instructions to build Python UEFI interpreter using Visual Studio
tool chains such as VS2019/VS2022. This v2 patch also addresses the
review comments.


Jayaprakash N (1):
  edk2-libc: BKM document to build Python UEFI using Visual Studio Tools

 .../Python/Python-3.6.8/VSCompilationBKMs.md  | 126 ++
 1 file changed, 126 insertions(+)
 create mode 100644 AppPkg/Applications/Python/Python-3.6.8/VSCompilationBKMs.md

-- 
2.46.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#120383): https://edk2.groups.io/g/devel/message/120383
Mute This Topic: https://groups.io/mt/108014908/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: BKM document to build Python UEFI using Visual Studio Tools

2024-08-20 Thread Jayaprakash, N
Hi Rebecca,

Thanks for your suggestion.

Would like to know if there are any advantages of calling this Python script 
over calling edksetup.bat directly. 

Regards,
JP
-Original Message-
From: Rebecca Cran  
Sent: Tuesday, August 20, 2024 9:43 PM
To: devel@edk2.groups.io; Jayaprakash, N 
Cc: Kinney, Michael D 
Subject: Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: BKM document to 
build Python UEFI using Visual Studio Tools


On 8/20/24 9:57 AM, Jayaprakash, N wrote:
> +c. Run the below command to setup the tool chain environment variables and 
> build the BaseTools:
> +```cmd
> +   edksetup.bat
> +   edksetup.bat Rebuild VS2022

Should we suggest people use Edk2ToolsBuild.py instead?


-- 
Rebecca



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#120378): https://edk2.groups.io/g/devel/message/120378
Mute This Topic: https://groups.io/mt/108003139/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-libc Patch 1/1] edk2-libc: BKM document to build Python UEFI using Visual Studio Tools

2024-08-20 Thread Jayaprakash, N
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4810

There is a BKM document which provides detailed step by step
instructions to build Python UEFI interpreter using GCC tool
chain from Ubuntu Linux OS. But there is no complete BKM document
providing the similar details to build on Windows using VS2019/VS2022
tool chains. This commit adds a new BKM document providing the step
by step instructions to build Python UEFI interpreter using Visual
Studio tool chains such as VS2019/VS2022.

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Cc: Jayaprakash N 
Signed-off-by: Jayaprakash N 
---
 .../Python/Python-3.6.8/VSCompilationBKMs.md  | 120 ++
 1 file changed, 120 insertions(+)
 create mode 100644 AppPkg/Applications/Python/Python-3.6.8/VSCompilationBKMs.md

diff --git a/AppPkg/Applications/Python/Python-3.6.8/VSCompilationBKMs.md 
b/AppPkg/Applications/Python/Python-3.6.8/VSCompilationBKMs.md
new file mode 100644
index 000..aaf689a
--- /dev/null
+++ b/AppPkg/Applications/Python/Python-3.6.8/VSCompilationBKMs.md
@@ -0,0 +1,120 @@
+# Building Python UEFI Interpreter uisng Visual Studio Tool Chain(s)
+
+## 1. Introduction
+This is a Best-Known Methods document capturing the details of build 
environment setup for compiling the Python UEFI interpreter version 3.6.8 using 
Microsoft Visual Studio Tool chains on Windows 11 systems. These BKMs have been 
tested on Windows 11 with VS2019 and VS2022 tool chains.
+
+## 2. Pre-requisites
+a. Install the Microsoft Visual Studio tool chain VS2022 community version by 
downloading it from [here](https://visualstudio.microsoft.com/downloads/). You 
could also use VS2019 for building Python UEFI interpreter.
+
+b. Install the latest version of NASM assembler for X64 bit platforms by 
downloading it from 
[here](https://www.nasm.us/pub/nasm/releasebuilds/2.16.03/win64/nasm-2.16.03-installer-x64.exe).
+
+c. Install the ASL tools by downloading it from [Intel's 
website](https://www.intel.com/content/www/us/en/download/774881/acpi-component-architecture-downloads-windows-binary-tools.html).
 Unzip the iasl-win-*.zip folder, create a folder with name ASL in `C:\` drive 
as `C:\ASL\`, then copy all the contents from the unzipped folder to `C:\ASL\`.
+
+d. Install the latest version of Python by downloading it from 
[here](https://www.python.org/ftp/python/3.12.5/python-3.12.5-amd64.exe). While 
installing Python, click on customize installation, click next, check the Add 
Python to environment variables, modify the installation path to 
`c:\python312\`, then click install.
+
+e. Install git bash or any other git source code management tools you are 
comfortable with. You may download the git bash for windows from [this 
website](https://github.com/git-for-windows/git/releases/download/v2.46.0.windows.1/Git-2.46.0-64-bit.exe).
+
+## 3. Setup Edk2 Build Environment
+a. Open a windows command prompt (not PowerShell) and create a folder with 
name `src` and change your working folder to the newly created folder using the 
commands provided below:
+```cmd
+   mkdir src
+   cd src
+```
+
+b. Clone the `edk2` repo and initialize all the submodule within it using the 
commands provided below:
+```cmd
+   git clone https://github.com/tianocore/edk2.git
+   cd edk2
+   git submodule update --init
+```
+
+c. Run the below command to setup the tool chain environment variables and 
build the BaseTools:
+```cmd
+   edksetup.bat
+   edksetup.bat Rebuild VS2022
+```
+
+## 4. Setup Build Environment to Build Python UEFI Interpreter
+a. Change your working directory to `src` folder using the following command:
+```cmd
+   cd ..
+```
+
+b. Clone `edk2-libc` repo using the following command:
+```cmd
+   git clone https://github.com/tianocore/edk2-libc.git
+```
+
+c. Set the PACKAGES_PATH and EDK2_LIBC_PATH using the commands below:
+```cmd
+   set PACKAGES_PATH=%cd%\edk2;%cd%\edk2-libc
+   set EDK2_LIBC_PATH=%cd%\edk2-libc
+```
+
+
+## 5. Build Python UEFI Interpreter with VS2022 compiler
+You may use the commands provided below to build the Python UEFI interpreter 
using Visual Studio 2022 compiler tool chain.
+```cmd
+   cd edk2-libc\AppPkg\Applications\Python\Python-3.6.8\
+   python srcprep.py
+   cd ..\..\..\..\..\edk2
+```
+```cmd
+   build -t VS2022 -a X64 -b RELEASE -p ../edk2-libc/AppPkg/AppPkg.dsc \
+ -m ../edk2-libc/AppPkg/Applications/Python/Python-3.6.8/Python368.inf 
-D BUILD_PYTHON368
+```
+   or
+```cmd
+   build -t VS2022 -a X64 -b RELEASE -p ../edk2-libc/AppPkg/AppPkg.dsc -D 
BUILD_PYTHON368
+```
+
+
+## 6. Create a Deployable Python UEFI package
+To create a usable Python UEFI package with all the dependencies from the 
build environment, you can use the batch (.bat) create_python_pkg.bat script 
available under edk2-libc/AppPkg/Applications/Python/Python-3.6.8 folder.
+
+Ensure that EDK2_LIBC_PATH environment variable set to edk2-libc folder path 
using the below command:
+
+```cmd
+   echo %EDK2_LIBC_PATH%
+```
+
+Then use the commands provided bel

[edk2-devel] [edk2-libc Patch 0/1] Add BKM document to build Python UEFI using VS Tools

2024-08-20 Thread Jayaprakash, N
There is a BKM document which provides detailed step by step
instructions to build Python UEFI interpreter using GCC tool
chain from Ubuntu Linux OS. But there is no complete BKM document
providing the similar details to build on Windows using VS2019/VS2022
tool chains. 

This patch adds a new BKM document providing the step
by step instructions to build Python UEFI interpreter using Visual
Studio tool chains such as VS2019/VS2022.

Jayaprakash N (1):
  edk2-libc: BKM document to build Python UEFI using Visual Studio Tools

 .../Python/Python-3.6.8/VSCompilationBKMs.md  | 120 ++
 1 file changed, 120 insertions(+)
 create mode 100644 AppPkg/Applications/Python/Python-3.6.8/VSCompilationBKMs.md

-- 
2.46.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#120375): https://edk2.groups.io/g/devel/message/120375
Mute This Topic: https://groups.io/mt/108003138/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] Migrating edk2-libc to use GitHub PR review process

2024-08-07 Thread Jayaprakash, N
Thanks Rebecca.

I am going through this and get back to you for any help soon.

Regards,
JP

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Rebecca Cran
Sent: Tuesday, August 6, 2024 4:16 PM
To: Jayaprakash, N ; devel@edk2.groups.io
Cc: Kinney, Michael D 
Subject: Re: [edk2-devel] Migrating edk2-libc to use GitHub PR review process

On 8/6/2024 3:10 AM, Jayaprakash, N wrote:
>
> Hi Rebecca,
>
> Mike suggested me to talk to you to see the possibility of getting 
> edk2-libc repo to the GitHub PR review process.
>
> It’s a relatively small repo with few contributors.
>
> Would like to understand what it takes to migrate to the new process? 
> Would you be able to help in this migration?
>
I'd be happy to help! We just need to move Maintainers.txt to CODEOWNERS and 
create a CONTRIBUTORS.md file (there aren't any reviewers, so we don't need a 
REVIEWERS file) and we can start using pull requests.


See the patch I sent out for edk2-platforms for an example: 
https://edk2.groups.io/g/devel/message/120195


--
Rebecca








-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#120269): https://edk2.groups.io/g/devel/message/120269
Mute This Topic: https://groups.io/mt/107747994/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] Migrating edk2-libc to use GitHub PR review process

2024-08-06 Thread Jayaprakash, N
Hi Rebecca,

Mike suggested me to talk to you to see the possibility of getting edk2-libc 
repo to the GitHub PR review process.
It's a relatively small repo with few contributors.
Would like to understand what it takes to migrate to the new process? Would you 
be able to help in this migration?

Regards,
Jayaprakash Nevara,
System Software Architect
CCG-CPE-C4S-India
PyUEFI - Tianocore 
Project;
 Yammer 
Group
CCG Python Academy
[cid:image001.png@01DAE80E.A1666740]Rust Programming - Yammer 
Group



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#120249): https://edk2.groups.io/g/devel/message/120249
Mute This Topic: https://groups.io/mt/107747994/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: remove gitmodules file added through accidental commit

2024-07-30 Thread Jayaprakash, N
Thanks Rebecca for your quick response.

Regards,
JP

-Original Message-
From: Rebecca Cran  
Sent: Tuesday, July 30, 2024 10:03 PM
To: Jayaprakash, N ; devel@edk2.groups.io
Cc: Kinney, Michael D 
Subject: Re: [edk2-libc Patch 1/1] edk2-libc: remove gitmodules file added 
through accidental commit

Reviewed-by: Rebecca Cran 


On 7/30/24 10:17 AM, Jayaprakash N wrote:
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4822
>
> Due to an accidental commit went into edk2-libc while experimenting 
> with some inner-source repos lead to the addition of gitmodules file 
> and a submodule. This commit is undoing this change by removing the 
> gitmodules file and the submodule.
>
> Cc: Rebecca Cran 
> Cc: Michael D Kinney 
> Cc: Jayaprakash N 
> Signed-off-by: Jayaprakash N 
> ---
>   .gitmodules  | 3 ---
>   AppPkg/CommonCode/SetupFiles | 1 -
>   2 files changed, 4 deletions(-)
>   delete mode 100644 .gitmodules
>   delete mode 16 AppPkg/CommonCode/SetupFiles
>
> diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 
> 04db1ef..000
> --- a/.gitmodules
> +++ /dev/null
> @@ -1,3 +0,0 @@
> -[submodule "AppPkg/CommonCode/SetupFiles"]
> - path = AppPkg/CommonCode/SetupFiles
> - url = 
> https://github.com/intel-innersource/applications.validation.advancedsystemtools.products.setup-files.git
> diff --git a/AppPkg/CommonCode/SetupFiles 
> b/AppPkg/CommonCode/SetupFiles deleted file mode 16 index 
> 8fa0030..000
> --- a/AppPkg/CommonCode/SetupFiles
> +++ /dev/null
> @@ -1 +0,0 @@
> -Subproject commit 8fa00308a6e22df94094c47dc4d650b0466e78ea


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#120130): https://edk2.groups.io/g/devel/message/120130
Mute This Topic: https://groups.io/mt/107630356/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-libc Patch 1/1] edk2-libc: remove gitmodules file added through accidental commit

2024-07-30 Thread Jayaprakash, N
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4822

Due to an accidental commit went into edk2-libc while
experimenting with some inner-source repos lead to the addition
of gitmodules file and a submodule. This commit is undoing
this change by removing the gitmodules file and the submodule.

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Cc: Jayaprakash N 
Signed-off-by: Jayaprakash N 
---
 .gitmodules  | 3 ---
 AppPkg/CommonCode/SetupFiles | 1 -
 2 files changed, 4 deletions(-)
 delete mode 100644 .gitmodules
 delete mode 16 AppPkg/CommonCode/SetupFiles

diff --git a/.gitmodules b/.gitmodules
deleted file mode 100644
index 04db1ef..000
--- a/.gitmodules
+++ /dev/null
@@ -1,3 +0,0 @@
-[submodule "AppPkg/CommonCode/SetupFiles"]
-   path = AppPkg/CommonCode/SetupFiles
-   url = 
https://github.com/intel-innersource/applications.validation.advancedsystemtools.products.setup-files.git
diff --git a/AppPkg/CommonCode/SetupFiles b/AppPkg/CommonCode/SetupFiles
deleted file mode 16
index 8fa0030..000
--- a/AppPkg/CommonCode/SetupFiles
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 8fa00308a6e22df94094c47dc4d650b0466e78ea
-- 
2.45.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#120124): https://edk2.groups.io/g/devel/message/120124
Mute This Topic: https://groups.io/mt/107630356/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-libc Patch 0/1] remove gitmodules added through accidental commit

2024-07-30 Thread Jayaprakash, N
This patch removes the gitmodules file and the submodule added
accidentally to the edk2-libc repo.

Jayaprakash N (1):
  edk2-libc: remove gitmodules file added through accidental commit

 .gitmodules  | 3 ---
 AppPkg/CommonCode/SetupFiles | 1 -
 2 files changed, 4 deletions(-)
 delete mode 100644 .gitmodules
 delete mode 16 AppPkg/CommonCode/SetupFiles

-- 
2.45.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#120123): https://edk2.groups.io/g/devel/message/120123
Mute This Topic: https://groups.io/mt/107630354/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: add github workflow to build python uefi with VS2022

2024-07-22 Thread Jayaprakash, N
I verified that edksetup performs the necessary compiler environment setup and 
hence removed steps related to that from the workflow file and sent an updated 
patch v2 for review.

Regards,
JP
-Original Message-
From: Jayaprakash, N 
Sent: Tuesday, July 23, 2024 7:52 AM
To: Kinney, Michael D ; devel@edk2.groups.io
Cc: Rebecca Cran 
Subject: RE: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: add github workflow 
to build python uefi with VS2022

Thanks Mike.

I have always been running the build commands from the x86 / x64 native visual 
studio command line.
So, created the workflow accordingly. 

Let me check and make any changes if required.

Regards,
JP

-Original Message-
From: Kinney, Michael D  
Sent: Monday, July 22, 2024 11:26 PM
To: devel@edk2.groups.io; Jayaprakash, N 
Cc: Rebecca Cran ; Kinney, Michael D 

Subject: RE: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: add github workflow 
to build python uefi with VS2022



> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of 
> Jayaprakash, N
> Sent: Monday, July 22, 2024 12:09 AM
> To: devel@edk2.groups.io
> Cc: Jayaprakash, N ; Rebecca Cran 
> ; Kinney, Michael D 
> Subject: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: add github 
> workflow to build python uefi with VS2022
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4815
> 
> edk2-libc has already been enabled to compile with VS2022 tool chain.
> This commit adds a new workflow file to enable building python uefi 
> with VS2022 compiler tool chain.
> 
> Cc: Rebecca Cran 
> Cc: Michael D Kinney 
> Cc: Jayaprakash N 
> Signed-off-by: Jayaprakash N 
> ---
>  .../workflows/build-python-uefi-vs2022.yaml   | 84 +++
>  1 file changed, 84 insertions(+)
>  create mode 100644 .github/workflows/build-python-uefi-vs2022.yaml
> 
> diff --git a/.github/workflows/build-python-uefi-vs2022.yaml
> b/.github/workflows/build-python-uefi-vs2022.yaml
> new file mode 100644
> index 000..4e36f09
> --- /dev/null
> +++ b/.github/workflows/build-python-uefi-vs2022.yaml
> @@ -0,0 +1,84 @@
> +# GitHub actions workflow to build python uefi using VS2022 # # 
> +Copyright (c) 2023 - 2024, Intel Corporation. All rights reserved.
> +# SPDX-License-Identifier: BSD-2-Clause-Patent #
> +
> +name: Build Python Interpreter for UEFI using VS2022
> +
> +on: [push, pull_request]
> +
> +jobs:
> +  build:
> +runs-on: windows-latest
> +env:
> +  NASM_PREFIX: "C:\\Program Files\\NASM\\"
> +defaults:
> +  run:
> +shell: cmd
> +
> +steps:
> +- name: Checkout repository
> +  uses: actions/checkout@v4
> +
> +- name: Setup Python
> +  uses: actions/setup-python@v5
> +  with:
> +python-version: '3.10'
> +
> +- name: Install NASM
> +  run: choco install nasm
> +
> +- name: VSWhere
> +  run: |
> +"C:\Program Files (x86)\Microsoft Visual
> Studio\Installer\vswhere.exe" -products * -latest -requires 
> Microsoft.Component.MSBuild -property installationPath
> +
> +- name: Setup environment for Visual Studio 2022 Build Tools
> +  run: |
> +"C:\Program Files\Microsoft Visual
> Studio\2022\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x86
> +set
> +

I though edksetup performs these steps above???

> +- name: Clone EDK2
> +  run: |
> +git clone https://github.com/tianocore/edk2.git
> +cd edk2
> +git submodule update --init
> +
> +- name: Build EDK2 Base Tools
> +  run: |
> +cd edk2
> +dir
> +edksetup.bat ForceRebuild
> +
> +- name: Run srcprep.py
> +  run: |
> +echo switching to AppPkg\Applications\Python\Python-3.6.8\
> +cd AppPkg\Applications\Python\Python-3.6.8\
> +dir
> +echo run srcprep.py file
> +python srcprep.py
> +
> +- name: Build Python UEFI
> +  run: |
> +set PACKAGES_PATH=%CD%\edk2;%CD%;
> +set EDK2_LIBC_PATH=%CD%
> +cd edk2
> +call edksetup.bat
> +build -t VS2022 -a X64 -b RELEASE -p
> %EDK2_LIBC_PATH%\AppPkg\AppPkg.dsc -D BUILD_PYTHON368
> +
> +- name: Create Python UEFI package
> +  run: |
> +set WORKSPACE=%CD%\edk2
> +set EDK2_LIBC_PATH=%CD%
> +dir
> +call 
> + AppPkg\Applications\Python\Python-3.6.8\create_python_pkg.bat
> VS2022 RELEASE X64 myUEFIPy
> +
> +- name: List build artifacts
> +  run: |
> +dir /S edk2\myUEFIPy
> +
> +- name: Upload build output as artifact
> +  uses: actions/upload-artifact@v4
> +  with:
> +name: myUEFIPy-build

[edk2-devel] [edk2-libc Patch v2 1/1] edk2-libc: add github workflow to build python uefi with VS2022

2024-07-22 Thread Jayaprakash, N
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4815

edk2-libc has already been enabled to compile with VS2022 tool chain.
This commit adds a new GitHub workflow to enable building python uefi
with VS2022 compiler tool chain.

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Cc: Jayaprakash N 
Signed-off-by: Jayaprakash N 
---
 .../workflows/build-python-uefi-vs2022.yaml   | 75 +++
 1 file changed, 75 insertions(+)
 create mode 100644 .github/workflows/build-python-uefi-vs2022.yaml

diff --git a/.github/workflows/build-python-uefi-vs2022.yaml 
b/.github/workflows/build-python-uefi-vs2022.yaml
new file mode 100644
index 000..ee1499c
--- /dev/null
+++ b/.github/workflows/build-python-uefi-vs2022.yaml
@@ -0,0 +1,75 @@
+# GitHub actions workflow to build python uefi using VS2022
+#
+# Copyright (c) 2023 - 2024, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+
+name: Build Python Interpreter for UEFI using VS2022
+
+on: [push, pull_request]
+
+jobs:
+  build:
+runs-on: windows-latest
+env:
+  NASM_PREFIX: "C:\\Program Files\\NASM\\"
+defaults:
+  run:
+shell: cmd
+
+steps:
+- name: Checkout repository
+  uses: actions/checkout@v4
+
+- name: Setup Python
+  uses: actions/setup-python@v5
+  with:
+python-version: '3.10'
+
+- name: Install NASM
+  run: choco install nasm
+
+- name: Clone EDK2
+  run: |
+git clone https://github.com/tianocore/edk2.git
+cd edk2
+git submodule update --init
+
+- name: Build EDK2 Base Tools
+  run: |
+cd edk2
+dir
+edksetup.bat ForceRebuild
+
+- name: Run srcprep.py
+  run: |
+echo switching to AppPkg\Applications\Python\Python-3.6.8\
+cd AppPkg\Applications\Python\Python-3.6.8\
+dir
+echo run srcprep.py file
+python srcprep.py
+
+- name: Build Python UEFI
+  run: |
+set PACKAGES_PATH=%CD%\edk2;%CD%;
+set EDK2_LIBC_PATH=%CD%
+cd edk2
+call edksetup.bat
+build -t VS2022 -a X64 -b RELEASE -p 
%EDK2_LIBC_PATH%\AppPkg\AppPkg.dsc -D BUILD_PYTHON368
+
+- name: Create Python UEFI package
+  run: |
+set WORKSPACE=%CD%\edk2
+set EDK2_LIBC_PATH=%CD%
+dir
+call AppPkg\Applications\Python\Python-3.6.8\create_python_pkg.bat 
VS2022 RELEASE X64 myUEFIPy
+
+- name: List build artifacts
+  run: |
+dir /S edk2\myUEFIPy
+
+- name: Upload build output as artifact
+  uses: actions/upload-artifact@v4
+  with:
+name: myUEFIPy-build-VS2022-output
+path: edk2\myUEFIPy\**\*
-- 
2.45.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#120012): https://edk2.groups.io/g/devel/message/120012
Mute This Topic: https://groups.io/mt/107500265/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-libc Patch v2 0/1] add github workflow to build python uefi with VS2022

2024-07-22 Thread Jayaprakash, N
This patch request adds support for building Python uefi interpreter
with VS2022 tool chain. A new workflow file has been added to build
python uefi interpreter using VS2022. The edk2-libc repo is already
enabled building with this tool chain.

Jayaprakash N (1):
  edk2-libc: add github workflow to build python uefi with VS2022

 .../workflows/build-python-uefi-vs2022.yaml   | 75 +++
 1 file changed, 75 insertions(+)
 create mode 100644 .github/workflows/build-python-uefi-vs2022.yaml

-- 
2.45.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#120011): https://edk2.groups.io/g/devel/message/120011
Mute This Topic: https://groups.io/mt/107500261/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: add github workflow to build python uefi with VS2022

2024-07-22 Thread Jayaprakash, N
Thanks Mike.

I have always been running the build commands from the x86 / x64 native visual 
studio command line.
So, created the workflow accordingly. 

Let me check and make any changes if required.

Regards,
JP

-Original Message-
From: Kinney, Michael D  
Sent: Monday, July 22, 2024 11:26 PM
To: devel@edk2.groups.io; Jayaprakash, N 
Cc: Rebecca Cran ; Kinney, Michael D 

Subject: RE: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: add github workflow 
to build python uefi with VS2022



> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of 
> Jayaprakash, N
> Sent: Monday, July 22, 2024 12:09 AM
> To: devel@edk2.groups.io
> Cc: Jayaprakash, N ; Rebecca Cran 
> ; Kinney, Michael D 
> Subject: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: add github 
> workflow to build python uefi with VS2022
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4815
> 
> edk2-libc has already been enabled to compile with VS2022 tool chain.
> This commit adds a new workflow file to enable building python uefi 
> with VS2022 compiler tool chain.
> 
> Cc: Rebecca Cran 
> Cc: Michael D Kinney 
> Cc: Jayaprakash N 
> Signed-off-by: Jayaprakash N 
> ---
>  .../workflows/build-python-uefi-vs2022.yaml   | 84 +++
>  1 file changed, 84 insertions(+)
>  create mode 100644 .github/workflows/build-python-uefi-vs2022.yaml
> 
> diff --git a/.github/workflows/build-python-uefi-vs2022.yaml
> b/.github/workflows/build-python-uefi-vs2022.yaml
> new file mode 100644
> index 000..4e36f09
> --- /dev/null
> +++ b/.github/workflows/build-python-uefi-vs2022.yaml
> @@ -0,0 +1,84 @@
> +# GitHub actions workflow to build python uefi using VS2022 # # 
> +Copyright (c) 2023 - 2024, Intel Corporation. All rights reserved.
> +# SPDX-License-Identifier: BSD-2-Clause-Patent #
> +
> +name: Build Python Interpreter for UEFI using VS2022
> +
> +on: [push, pull_request]
> +
> +jobs:
> +  build:
> +runs-on: windows-latest
> +env:
> +  NASM_PREFIX: "C:\\Program Files\\NASM\\"
> +defaults:
> +  run:
> +shell: cmd
> +
> +steps:
> +- name: Checkout repository
> +  uses: actions/checkout@v4
> +
> +- name: Setup Python
> +  uses: actions/setup-python@v5
> +  with:
> +python-version: '3.10'
> +
> +- name: Install NASM
> +  run: choco install nasm
> +
> +- name: VSWhere
> +  run: |
> +"C:\Program Files (x86)\Microsoft Visual
> Studio\Installer\vswhere.exe" -products * -latest -requires 
> Microsoft.Component.MSBuild -property installationPath
> +
> +- name: Setup environment for Visual Studio 2022 Build Tools
> +  run: |
> +"C:\Program Files\Microsoft Visual
> Studio\2022\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x86
> +set
> +

I though edksetup performs these steps above???

> +- name: Clone EDK2
> +  run: |
> +git clone https://github.com/tianocore/edk2.git
> +cd edk2
> +git submodule update --init
> +
> +- name: Build EDK2 Base Tools
> +  run: |
> +cd edk2
> +dir
> +edksetup.bat ForceRebuild
> +
> +- name: Run srcprep.py
> +  run: |
> +echo switching to AppPkg\Applications\Python\Python-3.6.8\
> +cd AppPkg\Applications\Python\Python-3.6.8\
> +dir
> +echo run srcprep.py file
> +python srcprep.py
> +
> +- name: Build Python UEFI
> +  run: |
> +set PACKAGES_PATH=%CD%\edk2;%CD%;
> +set EDK2_LIBC_PATH=%CD%
> +cd edk2
> +call edksetup.bat
> +build -t VS2022 -a X64 -b RELEASE -p
> %EDK2_LIBC_PATH%\AppPkg\AppPkg.dsc -D BUILD_PYTHON368
> +
> +- name: Create Python UEFI package
> +  run: |
> +set WORKSPACE=%CD%\edk2
> +set EDK2_LIBC_PATH=%CD%
> +dir
> +call 
> + AppPkg\Applications\Python\Python-3.6.8\create_python_pkg.bat
> VS2022 RELEASE X64 myUEFIPy
> +
> +- name: List build artifacts
> +  run: |
> +dir /S edk2\myUEFIPy
> +
> +- name: Upload build output as artifact
> +  uses: actions/upload-artifact@v4
> +  with:
> +name: myUEFIPy-build-VS2022-output
> +path: edk2\myUEFIPy\**\*
> --
> 2.45.1.windows.1
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#120010): https://edk2.groups.io/g/devel/message/120010
Mute This Topic: https://groups.io/mt/107481170/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-libc Patch 0/1] add github workflow to build python uefi with VS2022

2024-07-22 Thread Jayaprakash, N
This patch request adds support for building Python uefi interpreter
with VS2022 tool chain. A new workflow file has been added to build
python uefi interpreter using VS2022. The edk2-libc repo is already
enabled building with this tool chain.

Jayaprakash N (1):
  edk2-libc: add github workflow to build python uefi with VS2022

 .../workflows/build-python-uefi-vs2022.yaml   | 84 +++
 1 file changed, 84 insertions(+)
 create mode 100644 .github/workflows/build-python-uefi-vs2022.yaml

-- 
2.45.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#120002): https://edk2.groups.io/g/devel/message/120002
Mute This Topic: https://groups.io/mt/107481169/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-libc Patch 1/1] edk2-libc: add github workflow to build python uefi with VS2022

2024-07-22 Thread Jayaprakash, N
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4815

edk2-libc has already been enabled to compile with VS2022 tool chain.
This commit adds a new workflow file to enable building python uefi
with VS2022 compiler tool chain.

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Cc: Jayaprakash N 
Signed-off-by: Jayaprakash N 
---
 .../workflows/build-python-uefi-vs2022.yaml   | 84 +++
 1 file changed, 84 insertions(+)
 create mode 100644 .github/workflows/build-python-uefi-vs2022.yaml

diff --git a/.github/workflows/build-python-uefi-vs2022.yaml 
b/.github/workflows/build-python-uefi-vs2022.yaml
new file mode 100644
index 000..4e36f09
--- /dev/null
+++ b/.github/workflows/build-python-uefi-vs2022.yaml
@@ -0,0 +1,84 @@
+# GitHub actions workflow to build python uefi using VS2022
+#
+# Copyright (c) 2023 - 2024, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+
+name: Build Python Interpreter for UEFI using VS2022
+
+on: [push, pull_request]
+
+jobs:
+  build:
+runs-on: windows-latest
+env:
+  NASM_PREFIX: "C:\\Program Files\\NASM\\"
+defaults:
+  run:
+shell: cmd
+
+steps:
+- name: Checkout repository
+  uses: actions/checkout@v4
+
+- name: Setup Python
+  uses: actions/setup-python@v5
+  with:
+python-version: '3.10'
+
+- name: Install NASM
+  run: choco install nasm
+
+- name: VSWhere
+  run: |
+"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" 
-products * -latest -requires Microsoft.Component.MSBuild -property 
installationPath
+
+- name: Setup environment for Visual Studio 2022 Build Tools
+  run: |
+"C:\Program Files\Microsoft Visual 
Studio\2022\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x86
+set
+
+- name: Clone EDK2
+  run: |
+git clone https://github.com/tianocore/edk2.git
+cd edk2
+git submodule update --init
+
+- name: Build EDK2 Base Tools
+  run: |
+cd edk2
+dir
+edksetup.bat ForceRebuild
+
+- name: Run srcprep.py
+  run: |
+echo switching to AppPkg\Applications\Python\Python-3.6.8\
+cd AppPkg\Applications\Python\Python-3.6.8\
+dir
+echo run srcprep.py file
+python srcprep.py
+
+- name: Build Python UEFI
+  run: |
+set PACKAGES_PATH=%CD%\edk2;%CD%;
+set EDK2_LIBC_PATH=%CD%
+cd edk2
+call edksetup.bat
+build -t VS2022 -a X64 -b RELEASE -p 
%EDK2_LIBC_PATH%\AppPkg\AppPkg.dsc -D BUILD_PYTHON368
+
+- name: Create Python UEFI package
+  run: |
+set WORKSPACE=%CD%\edk2
+set EDK2_LIBC_PATH=%CD%
+dir
+call AppPkg\Applications\Python\Python-3.6.8\create_python_pkg.bat 
VS2022 RELEASE X64 myUEFIPy
+
+- name: List build artifacts
+  run: |
+dir /S edk2\myUEFIPy
+
+- name: Upload build output as artifact
+  uses: actions/upload-artifact@v4
+  with:
+name: myUEFIPy-build-VS2022-output
+path: edk2\myUEFIPy\**\*
-- 
2.45.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#120003): https://edk2.groups.io/g/devel/message/120003
Mute This Topic: https://groups.io/mt/107481170/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: Support for compiling Python UEFI interpreter with VS2022

2024-07-20 Thread Jayaprakash, N
Thanks Mike.
I have updated the summary into the commit message and sent patch v2 with the 
summary of the errors as suggested.

Regards,
JP

-Original Message-
From: Kinney, Michael D  
Sent: Thursday, July 18, 2024 9:14 PM
To: Jayaprakash, N ; devel@edk2.groups.io
Cc: Rebecca Cran ; Kinney, Michael D 

Subject: RE: [edk2-libc Patch 1/1] edk2-libc: Support for compiling Python UEFI 
interpreter with VS2022

Hi JP,

Thanks for adding details to the BZ.

For the commit message and PR description please add the Summary of the types 
of compiler warnings being addressed.

For example, I did not know why declaring a different named local variable 
resolved an issue.

Mike

> -Original Message-
> From: Jayaprakash, N 
> Sent: Wednesday, July 17, 2024 9:58 PM
> To: Kinney, Michael D ; 
> devel@edk2.groups.io
> Cc: Rebecca Cran 
> Subject: RE: [edk2-libc Patch 1/1] edk2-libc: Support for compiling 
> Python UEFI interpreter with VS2022
> 
> Hi Mike,
> 
> It's a big list of warnings treated as errors in VS2022.
> So, I have captured all these compilation issues in the BZ:
> https://bugzilla.tianocore.org/show_bug.cgi?id=4811
> 
> GitHub actions with VS2019 and GCC building successfully post these 
> fixes in my fork of edk2-libc.
> VS2019 Github action: https://github.com/jpshivakavi/edk2-libc-
> jp/actions/runs/9969663166
> GCC github action: https://github.com/jpshivakavi/edk2-libc-
> jp/actions/runs/9969663158
> 
> I have also verified the builds with VS2022  in my local workspace.
> 
> Regards,
> JP
> -Original Message-
> From: Kinney, Michael D 
> Sent: Wednesday, July 17, 2024 9:40 PM
> To: Jayaprakash, N ; devel@edk2.groups.io
> Cc: Rebecca Cran ; Kinney, Michael D 
> 
> Subject: RE: [edk2-libc Patch 1/1] edk2-libc: Support for compiling 
> Python UEFI interpreter with VS2022
> 
> Can you list the compiler errors that are being fixed by this patch?
> 
> Mike
> 
> > -Original Message-
> > From: Jayaprakash, N 
> > Sent: Tuesday, July 16, 2024 11:59 PM
> > To: devel@edk2.groups.io
> > Cc: Jayaprakash, N ; Rebecca Cran 
> > ; Kinney, Michael D 
> > Subject: [edk2-libc Patch 1/1] edk2-libc: Support for compiling 
> > Python UEFI interpreter with VS2022
> >
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4811
> >
> > This commit fixes the compilation issues observed with several 
> > components in the edk2-libc repo while trying to compile Python 
> > interpreter for UEFI.
> >
> > Cc: Rebecca Cran 
> > Cc: Michael D Kinney 
> > Cc: Jayaprakash N 
> > Signed-off-by: Jayaprakash N 
> > ---
> >  AppPkg/Applications/Enquire/Enquire.c | 48 +--
> >  .../OrderedCollectionTest.c   | 10 +--
> >  .../Sockets/DataSource/DataSource.c   | 10 +--
> >  AppPkg/Applications/Sockets/OobRx/OobRx.c |  4 +-
> >  .../Applications/Sockets/RawIp4Rx/RawIp4Rx.c  |  4 +-
> >  StdLib/BsdSocketLib/getnetbyht.c  |  9 ++-
> >  StdLib/BsdSocketLib/ns_print.c| 57 +++--
> >  StdLib/EfiSocketLib/Socket.c  | 80 +--
> >  8 files changed, 116 insertions(+), 106 deletions(-)
> >
> > diff --git a/AppPkg/Applications/Enquire/Enquire.c
> > b/AppPkg/Applications/Enquire/Enquire.c
> > index 1e1db69..5e34f48 100644
> > --- a/AppPkg/Applications/Enquire/Enquire.c
> > +++ b/AppPkg/Applications/Enquire/Enquire.c
> > @@ -5,7 +5,7 @@
> >  Steven Pemberton, CWI, Amsterdam; "steven.pember...@cwi.nl"
> >  Used with permission.
> >
> > -Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.
> > +Copyright (c) 2010 - 2024, Intel Corporation. All rights 
> > + reserved.
> >  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 @@ -918,15 +918,15 @@ memeq(  }
> >
> >  Void
> > -farewell(int bugs)
> > +farewell(int bugs_local)
> >  {
> > -  if (bugs == 0) exit(0);
> > +  if (bugs_local == 0) exit(0);
> >printf("\n%sFor hints on dealing with the ", co);
> > -  if (bugs == 1) printf("problem");
> > -  else printf("%d problems", bugs);
> > +  if (bugs_local == 1) printf("problem");  else printf("%d 
> > + problems", bugs_local);
> >printf(" above\n   see the section 'TROUBLESHOOTING' in the file ");
> >printf("%

[edk2-devel] [edk2-libc Patch v2 1/1] edk2-libc: Support for compiling Python UEFI interpreter with VS2022

2024-07-20 Thread Jayaprakash, N
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4811

While trying to compile Python UEFI 3.6.8 with VS2022, got several
compiler warnings from other components within the edk2-libc project.
These warnings were leading to compilation failure as they were
treated as errors. All these issues have been fixed througn this
commit. Besides this, updated the year in copy right of these file.

Summary of the issues is given below for reference:
1.AppPkg\Applications\Enquire\Enquire.c
  Warning C4459: Declaration of 'bugs' hides global declaration.
  Warning C4456: Multiple declarations of 'char_max' hide previous
 local declarations.
  Warning C4456: Declaration of 'char_min' hides previous local
 declaration.

2.AppPkg\Applications\OrderedCollectionTest\OrderedCollectionTest.c
  Warning C4476: Unknown type field character '$' in format
 specifier.
  Warning C4474: Too many arguments passed for format string.

3.StdLib\BsdSocketLib\getnetbyht.c
  Warning C4459: Declaration of 'net' hides global declaration.

4.StdLib\EfiSocketLib\Socket.c
  Warning C4459: Multiple declarations of 'errno' hide global
 declaration.

5.AppPkg\Applications\Sockets\DataSource\DataSource.c
  Warning C4459: Declaration of 'BytesSent' hides global declaration.

6.AppPkg\Applications\Sockets\OobRx\OobRx.c
  Warning C4475: Length modifier 'L' cannot be used with type field
 character 'd' in format specifier.

7.AppPkg\Applications\Sockets\RawIp4Rx\RawIp4Rx.c
  Warning C4475: Length modifier 'L' cannot be used with type field
 character 'd' in format specifier.

8.StdLib\BsdSocketLib\ns_print.c
  Warning C4456: Multiple declarations of 't' hide previous local
 declarations.
  Warning C4457: Declaration of 'type' hides function parameter.

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Cc: Jayaprakash N 
Signed-off-by: Jayaprakash N 
---
 AppPkg/Applications/Enquire/Enquire.c | 48 +--
 .../OrderedCollectionTest.c   | 10 +--
 .../Sockets/DataSource/DataSource.c   | 10 +--
 AppPkg/Applications/Sockets/OobRx/OobRx.c |  6 +-
 .../Applications/Sockets/RawIp4Rx/RawIp4Rx.c  |  4 +-
 StdLib/BsdSocketLib/getnetbyht.c  |  9 ++-
 StdLib/BsdSocketLib/ns_print.c| 57 +++--
 StdLib/EfiSocketLib/Socket.c  | 80 +--
 8 files changed, 117 insertions(+), 107 deletions(-)

diff --git a/AppPkg/Applications/Enquire/Enquire.c 
b/AppPkg/Applications/Enquire/Enquire.c
index 1e1db69..5e34f48 100644
--- a/AppPkg/Applications/Enquire/Enquire.c
+++ b/AppPkg/Applications/Enquire/Enquire.c
@@ -5,7 +5,7 @@
 Steven Pemberton, CWI, Amsterdam; "steven.pember...@cwi.nl"
 Used with permission.
 
-Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.
+Copyright (c) 2010 - 2024, Intel Corporation. All rights reserved.
 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
@@ -918,15 +918,15 @@ memeq(
 }
 
 Void
-farewell(int bugs)
+farewell(int bugs_local)
 {
-  if (bugs == 0) exit(0);
+  if (bugs_local == 0) exit(0);
   printf("\n%sFor hints on dealing with the ", co);
-  if (bugs == 1) printf("problem");
-  else printf("%d problems", bugs);
+  if (bugs_local == 1) printf("problem");
+  else printf("%d problems", bugs_local);
   printf(" above\n   see the section 'TROUBLESHOOTING' in the file ");
   printf("%s%s\n", FILENAME, oc);
-  exit(bugs);
+  exit(bugs_local);
 }
 
 /* The program has received a signal where it wasn't expecting one */
@@ -1927,51 +1927,51 @@ int cprop( void )
 
 if (c_signed) {
 #ifndef NO_UC
-/* Syntax error? Define NO_UC */ Volatile unsigned char c1, char_max;
-  c1=0; char_max=0;
+/* Syntax error? Define NO_UC */ Volatile unsigned char c1, char_max_local;
+  c1=0; char_max_local=0;
   c1++;
-  if (setjmp(lab)==0) { /* Yields char_max */
-while (c1>char_max) {
-  char_max=c1;
+  if (setjmp(lab)==0) { /* Yields char_max_local */
+while (c1>char_max_local) {
+  char_max_local=c1;
   c1++;
 }
   }
   Unexpected(4);
   if (sizeof(char) == sizeof(int)) {
 u_define(D_UCHAR_MAX, "", "UCHAR", "_MAX",
-   (ulong) char_max,
+   (ulong) char_max_local,
(ulong) UCHAR_MAX, "");
   } else {
 i_define(D_UCHAR_MAX, "", "UCHAR", "_MAX",
-   (long) char_max, 0L,
+   (long) char_max_local, 0L,
(lon

[edk2-devel] [edk2-libc Patch v2 0/1] Support for compiling Python UEFI interpreter with VS2022

2024-07-20 Thread Jayaprakash, N
This patch fixes the compilation errors seen in edk2-libc components
while compiling Python UEFI. Below is summary of fixes done through
this patch request.

1.AppPkg\Applications\Enquire\Enquire.c
  Warning C4459: Declaration of 'bugs' hides global declaration.
  Warning C4456: Multiple declarations of 'char_max' hide previous
 local declarations.
  Warning C4456: Declaration of 'char_min' hides previous local
 declaration.

2.AppPkg\Applications\OrderedCollectionTest\OrderedCollectionTest.c
  Warning C4476: Unknown type field character '$' in format
 specifier.
  Warning C4474: Too many arguments passed for format string.

3.StdLib\BsdSocketLib\getnetbyht.c
  Warning C4459: Declaration of 'net' hides global declaration.

4.StdLib\EfiSocketLib\Socket.c
  Warning C4459: Multiple declarations of 'errno' hide global
 declaration.

5.AppPkg\Applications\Sockets\DataSource\DataSource.c
  Warning C4459: Declaration of 'BytesSent' hides global declaration.

6.AppPkg\Applications\Sockets\OobRx\OobRx.c
  Warning C4475: Length modifier 'L' cannot be used with type field
 character 'd' in format specifier.

7.AppPkg\Applications\Sockets\RawIp4Rx\RawIp4Rx.c
  Warning C4475: Length modifier 'L' cannot be used with type field
 character 'd' in format specifier.

8.StdLib\BsdSocketLib\ns_print.c
  Warning C4456: Multiple declarations of 't' hide previous local
 declarations.
  Warning C4457: Declaration of 'type' hides function parameter.

Jayaprakash N (1):
  edk2-libc: Support for compiling Python UEFI interpreter with VS2022

 AppPkg/Applications/Enquire/Enquire.c | 48 +--
 .../OrderedCollectionTest.c   | 10 +--
 .../Sockets/DataSource/DataSource.c   | 10 +--
 AppPkg/Applications/Sockets/OobRx/OobRx.c |  6 +-
 .../Applications/Sockets/RawIp4Rx/RawIp4Rx.c  |  4 +-
 StdLib/BsdSocketLib/getnetbyht.c  |  9 ++-
 StdLib/BsdSocketLib/ns_print.c| 57 +++--
 StdLib/EfiSocketLib/Socket.c  | 80 +--
 8 files changed, 117 insertions(+), 107 deletions(-)

-- 
2.45.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119987): https://edk2.groups.io/g/devel/message/119987
Mute This Topic: https://groups.io/mt/107454080/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: Support for compiling Python UEFI interpreter with VS2022

2024-07-18 Thread Jayaprakash, N
Thanks Mike.
I shall add the summary of the types of compiler warnings being addressed into 
PR description and the commit message.

Regards,
JP

-Original Message-
From: Kinney, Michael D  
Sent: Thursday, July 18, 2024 9:14 PM
To: Jayaprakash, N ; devel@edk2.groups.io
Cc: Rebecca Cran ; Kinney, Michael D 

Subject: RE: [edk2-libc Patch 1/1] edk2-libc: Support for compiling Python UEFI 
interpreter with VS2022

Hi JP,

Thanks for adding details to the BZ.

For the commit message and PR description please add the Summary of the types 
of compiler warnings being addressed.

For example, I did not know why declaring a different named local variable 
resolved an issue.

Mike

> -Original Message-
> From: Jayaprakash, N 
> Sent: Wednesday, July 17, 2024 9:58 PM
> To: Kinney, Michael D ; 
> devel@edk2.groups.io
> Cc: Rebecca Cran 
> Subject: RE: [edk2-libc Patch 1/1] edk2-libc: Support for compiling 
> Python UEFI interpreter with VS2022
> 
> Hi Mike,
> 
> It's a big list of warnings treated as errors in VS2022.
> So, I have captured all these compilation issues in the BZ:
> https://bugzilla.tianocore.org/show_bug.cgi?id=4811
> 
> GitHub actions with VS2019 and GCC building successfully post these 
> fixes in my fork of edk2-libc.
> VS2019 Github action: https://github.com/jpshivakavi/edk2-libc-
> jp/actions/runs/9969663166
> GCC github action: https://github.com/jpshivakavi/edk2-libc-
> jp/actions/runs/9969663158
> 
> I have also verified the builds with VS2022  in my local workspace.
> 
> Regards,
> JP
> -Original Message-
> From: Kinney, Michael D 
> Sent: Wednesday, July 17, 2024 9:40 PM
> To: Jayaprakash, N ; devel@edk2.groups.io
> Cc: Rebecca Cran ; Kinney, Michael D 
> 
> Subject: RE: [edk2-libc Patch 1/1] edk2-libc: Support for compiling 
> Python UEFI interpreter with VS2022
> 
> Can you list the compiler errors that are being fixed by this patch?
> 
> Mike
> 
> > -Original Message-
> > From: Jayaprakash, N 
> > Sent: Tuesday, July 16, 2024 11:59 PM
> > To: devel@edk2.groups.io
> > Cc: Jayaprakash, N ; Rebecca Cran 
> > ; Kinney, Michael D 
> > Subject: [edk2-libc Patch 1/1] edk2-libc: Support for compiling 
> > Python UEFI interpreter with VS2022
> >
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4811
> >
> > This commit fixes the compilation issues observed with several 
> > components in the edk2-libc repo while trying to compile Python 
> > interpreter for UEFI.
> >
> > Cc: Rebecca Cran 
> > Cc: Michael D Kinney 
> > Cc: Jayaprakash N 
> > Signed-off-by: Jayaprakash N 
> > ---
> >  AppPkg/Applications/Enquire/Enquire.c | 48 +--
> >  .../OrderedCollectionTest.c   | 10 +--
> >  .../Sockets/DataSource/DataSource.c   | 10 +--
> >  AppPkg/Applications/Sockets/OobRx/OobRx.c |  4 +-
> >  .../Applications/Sockets/RawIp4Rx/RawIp4Rx.c  |  4 +-
> >  StdLib/BsdSocketLib/getnetbyht.c  |  9 ++-
> >  StdLib/BsdSocketLib/ns_print.c| 57 +++--
> >  StdLib/EfiSocketLib/Socket.c  | 80 +--
> >  8 files changed, 116 insertions(+), 106 deletions(-)
> >
> > diff --git a/AppPkg/Applications/Enquire/Enquire.c
> > b/AppPkg/Applications/Enquire/Enquire.c
> > index 1e1db69..5e34f48 100644
> > --- a/AppPkg/Applications/Enquire/Enquire.c
> > +++ b/AppPkg/Applications/Enquire/Enquire.c
> > @@ -5,7 +5,7 @@
> >  Steven Pemberton, CWI, Amsterdam; "steven.pember...@cwi.nl"
> >  Used with permission.
> >
> > -Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.
> > +Copyright (c) 2010 - 2024, Intel Corporation. All rights 
> > + reserved.
> >  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 @@ -918,15 +918,15 @@ memeq(  }
> >
> >  Void
> > -farewell(int bugs)
> > +farewell(int bugs_local)
> >  {
> > -  if (bugs == 0) exit(0);
> > +  if (bugs_local == 0) exit(0);
> >printf("\n%sFor hints on dealing with the ", co);
> > -  if (bugs == 1) printf("problem");
> > -  else printf("%d problems", bugs);
> > +  if (bugs_local == 1) printf("problem");  else printf("%d 
> > + problems", bugs_local);
> >printf(" above\n   see the section 'TROUBLESHOOTING' in the file ");
> >printf("%

Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: add .gitattributes to ensure right line endings in .sh .bat

2024-07-17 Thread Jayaprakash, N
Regarding the below comment from Lief.

Now, as for the suggestion: this isn't wrong, but can you explain what problem 
it is solving?

<> As a developer and also as a maintainer the lines endings have been a 
consistent problem as I have seen patches coming with mixed line endings some 
times it take quite a while to fix these simple line ending issues.
I want to start small through .gtiattributes usage for the .sh and .bat scripts 
to normalize the line endings to LF so that irrespective of the user 
environment the line endings are always stored as LF in git repo but presented 
to the users in LF or CRLF as per their environment. Thought of using this 
feature of github in a lower scale to make it easy for the developers and 
maintainers of the edk2-libc project. 

If there is a general alignment that this change need not go, then I will close 
the BZ as won't fix.


Regards,
JP

-Original Message-
From: Leif Lindholm  
Sent: Wednesday, July 17, 2024 7:55 PM
To: devel@edk2.groups.io; Jayaprakash, N ; Kinney, 
Michael D 
Cc: Rebecca Cran 
Subject: Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: add .gitattributes 
to ensure right line endings in .sh .bat

Hi,

The address I am replying from is the email address I use for tianocore work. 
Messages sent elsewhere are going to end up misfiled and likely lost.

On 2024-07-17 06:55, Jayaprakash, N wrote:
> Hi Lefi,
> 
> Do you have any recommendations on this?
> 
> Regards,
> JP
> 
> -Original Message-
> From: Kinney, Michael D 
> Sent: Friday, July 12, 2024 9:29 PM
> To: Jayaprakash, N ; devel@edk2.groups.io; 
> Leif Lindholm 
> Cc: Rebecca Cran ; Kinney, Michael D 
> 
> Subject: RE: [edk2-libc Patch 1/1] edk2-libc: add .gitattributes to 
> ensure right line endings in .sh .bat
> 
> + Leif
> 
> .gitattributes is not used in other TianoCore repos.

Technically sort of correct, but see below.

> This feature changes the line endings locally when checked out.
> 
> Instead, the edk2 repo uses a CI check like PatchCheck.py to make sure files 
> with specific extensions have the correct line endings when they are checked 
> in and files are checked out unmodified.
> 
> I know Leif has been evaluating some line ending changes to TianoCore Repos.  
> Don't know if this direction is in alignment with those ideas or not.
> 
> Mike
> 
>> -Original Message-
>> From: Jayaprakash, N 
>> Sent: Friday, July 12, 2024 7:27 AM
>> To: devel@edk2.groups.io
>> Cc: Jayaprakash, N ; Rebecca Cran 
>> ; Kinney, Michael D 
>> Subject: [edk2-libc Patch 1/1] edk2-libc: add .gitattributes to 
>> ensure right line endings in .sh .bat
>>
>> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4809
>>
>> This commit adds .gitattributes file with the right settings to 
>> preserve the correct line endings for .sh and .bat files as per the 
>> Linxu and Windows line ending conventions respectively.
 >>
>> Cc: Rebecca Cran 
>> Cc: Michael D Kinney 
>> Cc: Jayaprakash N 
>> Signed-off-by: Jayaprakash N 
>> ---
>>   .gitattributes | 2 ++
>>   1 file changed, 2 insertions(+)
>>   create mode 100644 .gitattributes
>>
>> diff --git a/.gitattributes b/.gitattributes new file mode 100644 
>> index 000..3fd9ec8
>> --- /dev/null
>> +++ b/.gitattributes
>> @@ -0,0 +1,2 @@
>> +*.bat text eol=crlf
>> +*.sh text eol=lf
>> \ No newline at end of file

^ This is not a good look for any submission, but especially not one dealing 
with line endings. Please manually look at patches before sending them out.

Now, as for the suggestion: this isn't wrong, but can you explain what problem 
it is solving?

I had a look in edk2-libc and all the .sh files have LF line endings and all 
the .bat files have CRLF line endings.

Now, if we *did* want to do this, I would strongly prefer a patch to 
edk2/BaseTools/Conf/gitattributes, which is applied in any repo SetupGit.py has 
been executed in.

But ultimately I want to convert the repos completely to LF line endings except 
for where special cases exist (which *should* be described in
[.]gitattributes) and then move to enable core.autocrlf.

/
 Leif

>> --
>> 2.45.1.windows.1
> 
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119965): https://edk2.groups.io/g/devel/message/119965
Mute This Topic: https://groups.io/mt/107182920/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: Support for compiling Python UEFI interpreter with VS2022

2024-07-17 Thread Jayaprakash, N
Hi Mike,

It's a big list of warnings treated as errors in VS2022.
So, I have captured all these compilation issues in the BZ: 
https://bugzilla.tianocore.org/show_bug.cgi?id=4811

GitHub actions with VS2019 and GCC building successfully post these fixes in my 
fork of edk2-libc.
VS2019 Github action: 
https://github.com/jpshivakavi/edk2-libc-jp/actions/runs/9969663166
GCC github action: 
https://github.com/jpshivakavi/edk2-libc-jp/actions/runs/9969663158

I have also verified the builds with VS2022  in my local workspace. 

Regards,
JP
-Original Message-
From: Kinney, Michael D  
Sent: Wednesday, July 17, 2024 9:40 PM
To: Jayaprakash, N ; devel@edk2.groups.io
Cc: Rebecca Cran ; Kinney, Michael D 

Subject: RE: [edk2-libc Patch 1/1] edk2-libc: Support for compiling Python UEFI 
interpreter with VS2022

Can you list the compiler errors that are being fixed by this patch?

Mike

> -Original Message-
> From: Jayaprakash, N 
> Sent: Tuesday, July 16, 2024 11:59 PM
> To: devel@edk2.groups.io
> Cc: Jayaprakash, N ; Rebecca Cran 
> ; Kinney, Michael D 
> Subject: [edk2-libc Patch 1/1] edk2-libc: Support for compiling Python 
> UEFI interpreter with VS2022
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4811
> 
> This commit fixes the compilation issues observed with several 
> components in the edk2-libc repo while trying to compile Python 
> interpreter for UEFI.
> 
> Cc: Rebecca Cran 
> Cc: Michael D Kinney 
> Cc: Jayaprakash N 
> Signed-off-by: Jayaprakash N 
> ---
>  AppPkg/Applications/Enquire/Enquire.c | 48 +--
>  .../OrderedCollectionTest.c   | 10 +--
>  .../Sockets/DataSource/DataSource.c   | 10 +--
>  AppPkg/Applications/Sockets/OobRx/OobRx.c |  4 +-
>  .../Applications/Sockets/RawIp4Rx/RawIp4Rx.c  |  4 +-
>  StdLib/BsdSocketLib/getnetbyht.c  |  9 ++-
>  StdLib/BsdSocketLib/ns_print.c| 57 +++--
>  StdLib/EfiSocketLib/Socket.c  | 80 +--
>  8 files changed, 116 insertions(+), 106 deletions(-)
> 
> diff --git a/AppPkg/Applications/Enquire/Enquire.c
> b/AppPkg/Applications/Enquire/Enquire.c
> index 1e1db69..5e34f48 100644
> --- a/AppPkg/Applications/Enquire/Enquire.c
> +++ b/AppPkg/Applications/Enquire/Enquire.c
> @@ -5,7 +5,7 @@
>  Steven Pemberton, CWI, Amsterdam; "steven.pember...@cwi.nl"
>  Used with permission.
> 
> -Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.
> +Copyright (c) 2010 - 2024, Intel Corporation. All rights 
> + reserved.
>  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 @@ -918,15 +918,15 @@ memeq(  }
> 
>  Void
> -farewell(int bugs)
> +farewell(int bugs_local)
>  {
> -  if (bugs == 0) exit(0);
> +  if (bugs_local == 0) exit(0);
>printf("\n%sFor hints on dealing with the ", co);
> -  if (bugs == 1) printf("problem");
> -  else printf("%d problems", bugs);
> +  if (bugs_local == 1) printf("problem");  else printf("%d problems", 
> + bugs_local);
>printf(" above\n   see the section 'TROUBLESHOOTING' in the file ");
>printf("%s%s\n", FILENAME, oc);
> -  exit(bugs);
> +  exit(bugs_local);
>  }
> 
>  /* The program has received a signal where it wasn't expecting one */ 
> @@ -1927,51 +1927,51 @@ int cprop( void )
> 
>  if (c_signed) {
>  #ifndef NO_UC
> -/* Syntax error? Define NO_UC */ Volatile unsigned char c1, char_max;
> -  c1=0; char_max=0;
> +/* Syntax error? Define NO_UC */ Volatile unsigned char c1, char_max_local;
> +  c1=0; char_max_local=0;
>c1++;
> -  if (setjmp(lab)==0) { /* Yields char_max */
> -while (c1>char_max) {
> -  char_max=c1;
> +  if (setjmp(lab)==0) { /* Yields char_max_local */
> +while (c1>char_max_local) {
> +  char_max_local=c1;
>c1++;
>  }
>}
>Unexpected(4);
>if (sizeof(char) == sizeof(int)) {
>  u_define(D_UCHAR_MAX, "", "UCHAR", "_MAX",
> -   (ulong) char_max,
> +   (ulong) char_max_local,
> (ulong) UCHAR_MAX, "");
>} else {
>  i_define(D_UCHAR_MAX, "", "UCHAR", "_MAX",
> -   (long) char_max, 0L,
> +   (long) char_max_local, 0L,
> (long) UCHAR_MAX, "");
>}
>  #endif
>  } else {
>  #ifndef NO_SC
> -/* Syntax error? Define NO

[edk2-devel] [edk2-libc Patch 1/1] edk2-libc: Support for compiling Python UEFI interpreter with VS2022

2024-07-17 Thread Jayaprakash, N
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4811

This commit fixes the compilation issues observed with several
components in the edk2-libc repo while trying to compile Python
interpreter for UEFI.

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Cc: Jayaprakash N 
Signed-off-by: Jayaprakash N 
---
 AppPkg/Applications/Enquire/Enquire.c | 48 +--
 .../OrderedCollectionTest.c   | 10 +--
 .../Sockets/DataSource/DataSource.c   | 10 +--
 AppPkg/Applications/Sockets/OobRx/OobRx.c |  4 +-
 .../Applications/Sockets/RawIp4Rx/RawIp4Rx.c  |  4 +-
 StdLib/BsdSocketLib/getnetbyht.c  |  9 ++-
 StdLib/BsdSocketLib/ns_print.c| 57 +++--
 StdLib/EfiSocketLib/Socket.c  | 80 +--
 8 files changed, 116 insertions(+), 106 deletions(-)

diff --git a/AppPkg/Applications/Enquire/Enquire.c 
b/AppPkg/Applications/Enquire/Enquire.c
index 1e1db69..5e34f48 100644
--- a/AppPkg/Applications/Enquire/Enquire.c
+++ b/AppPkg/Applications/Enquire/Enquire.c
@@ -5,7 +5,7 @@
 Steven Pemberton, CWI, Amsterdam; "steven.pember...@cwi.nl"
 Used with permission.
 
-Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.
+Copyright (c) 2010 - 2024, Intel Corporation. All rights reserved.
 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
@@ -918,15 +918,15 @@ memeq(
 }
 
 Void
-farewell(int bugs)
+farewell(int bugs_local)
 {
-  if (bugs == 0) exit(0);
+  if (bugs_local == 0) exit(0);
   printf("\n%sFor hints on dealing with the ", co);
-  if (bugs == 1) printf("problem");
-  else printf("%d problems", bugs);
+  if (bugs_local == 1) printf("problem");
+  else printf("%d problems", bugs_local);
   printf(" above\n   see the section 'TROUBLESHOOTING' in the file ");
   printf("%s%s\n", FILENAME, oc);
-  exit(bugs);
+  exit(bugs_local);
 }
 
 /* The program has received a signal where it wasn't expecting one */
@@ -1927,51 +1927,51 @@ int cprop( void )
 
 if (c_signed) {
 #ifndef NO_UC
-/* Syntax error? Define NO_UC */ Volatile unsigned char c1, char_max;
-  c1=0; char_max=0;
+/* Syntax error? Define NO_UC */ Volatile unsigned char c1, char_max_local;
+  c1=0; char_max_local=0;
   c1++;
-  if (setjmp(lab)==0) { /* Yields char_max */
-while (c1>char_max) {
-  char_max=c1;
+  if (setjmp(lab)==0) { /* Yields char_max_local */
+while (c1>char_max_local) {
+  char_max_local=c1;
   c1++;
 }
   }
   Unexpected(4);
   if (sizeof(char) == sizeof(int)) {
 u_define(D_UCHAR_MAX, "", "UCHAR", "_MAX",
-   (ulong) char_max,
+   (ulong) char_max_local,
(ulong) UCHAR_MAX, "");
   } else {
 i_define(D_UCHAR_MAX, "", "UCHAR", "_MAX",
-   (long) char_max, 0L,
+   (long) char_max_local, 0L,
(long) UCHAR_MAX, "");
   }
 #endif
 } else {
 #ifndef NO_SC
-/* Syntax error? Define NO_SC */ Volatile signed char c1, char_max, char_min;
-  c1=0; char_max=0;
+/* Syntax error? Define NO_SC */ Volatile signed char c1, char_max_local, 
char_min_local;
+  c1=0; char_max_local=0;
   c1++;
-  if (setjmp(lab)==0) { /* Yields char_max */
-while (c1>char_max) {
-  char_max=c1;
+  if (setjmp(lab)==0) { /* Yields char_max_local */
+while (c1>char_max_local) {
+  char_max_local=c1;
   c1++;
 }
   }
-  c1=0; char_min=0;
+  c1=0; char_min_local=0;
   c1--;
-  if (setjmp(lab)==0) { /* Yields char_min */
-while (c1
+  Copyright (c) 2010 - 2024, Intel Corporation. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 **/
@@ -458,10 +458,10 @@ SetupInputOutput (
 
 case 'h':
   fprintf (stderr,
-"%1$s: simple OrderedCollectionLib tester\n"
+"%s: simple OrderedCollectionLib tester\n"
 "\n"
-"Usage: 1. %1$s [-i InputFile] [-o OutputFile]\n"
-"   2. %1$s -h\n"
+"Usage: 1. %s [-i InputFile] [-o OutputFile]\n"
+"   2. %s -h\n"
 "\n"
 "Options:\n"
 "  -i InputFile : read commands from InputFile\n"
@@ -469,7 +469,7 @@ SetupInputOutput (
 "  -o OutputFile: write command responses to OutputFile\n"
 " (will write to stdout if absent)\n"
 "  -h   : print this help and exit\n"
-"\n", ArgV[0]);
+"\n", ArgV[0], ArgV[0], ArgV[0]);

[edk2-devel] [edk2-libc Patch 0/1] Support for compiling Python UEFI interpreter with VS2022

2024-07-17 Thread Jayaprakash, N
This patch request adds support for compiling Python UEFI interpreter
with VS2022 by fixing all the compilation issues observed in edk2-libc
repo.

Jayaprakash N (1):
  edk2-libc: Support for compiling Python UEFI interpreter with VS2022

 AppPkg/Applications/Enquire/Enquire.c | 48 +--
 .../OrderedCollectionTest.c   | 10 +--
 .../Sockets/DataSource/DataSource.c   | 10 +--
 AppPkg/Applications/Sockets/OobRx/OobRx.c |  4 +-
 .../Applications/Sockets/RawIp4Rx/RawIp4Rx.c  |  4 +-
 StdLib/BsdSocketLib/getnetbyht.c  |  9 ++-
 StdLib/BsdSocketLib/ns_print.c| 57 +++--
 StdLib/EfiSocketLib/Socket.c  | 80 +--
 8 files changed, 116 insertions(+), 106 deletions(-)

-- 
2.45.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119947): https://edk2.groups.io/g/devel/message/119947
Mute This Topic: https://groups.io/mt/107267144/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: add .gitattributes to ensure right line endings in .sh .bat

2024-07-16 Thread Jayaprakash, N
Hi Lefi,

Do you have any recommendations on this?

Regards,
JP

-Original Message-
From: Kinney, Michael D  
Sent: Friday, July 12, 2024 9:29 PM
To: Jayaprakash, N ; devel@edk2.groups.io; Leif 
Lindholm 
Cc: Rebecca Cran ; Kinney, Michael D 

Subject: RE: [edk2-libc Patch 1/1] edk2-libc: add .gitattributes to ensure 
right line endings in .sh .bat

+ Leif

.gitattributes is not used in other TianoCore repos.

This feature changes the line endings locally when checked out.

Instead, the edk2 repo uses a CI check like PatchCheck.py to make sure files 
with specific extensions have the correct line endings when they are checked in 
and files are checked out unmodified.

I know Leif has been evaluating some line ending changes to TianoCore Repos.  
Don't know if this direction is in alignment with those ideas or not.

Mike

> -Original Message-
> From: Jayaprakash, N 
> Sent: Friday, July 12, 2024 7:27 AM
> To: devel@edk2.groups.io
> Cc: Jayaprakash, N ; Rebecca Cran 
> ; Kinney, Michael D 
> Subject: [edk2-libc Patch 1/1] edk2-libc: add .gitattributes to ensure 
> right line endings in .sh .bat
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4809
> 
> This commit adds .gitattributes file with the right settings to 
> preserve the correct line endings for .sh and .bat files as per the 
> Linxu and Windows line ending conventions respectively.
> 
> Cc: Rebecca Cran 
> Cc: Michael D Kinney 
> Cc: Jayaprakash N 
> Signed-off-by: Jayaprakash N 
> ---
>  .gitattributes | 2 ++
>  1 file changed, 2 insertions(+)
>  create mode 100644 .gitattributes
> 
> diff --git a/.gitattributes b/.gitattributes new file mode 100644 
> index 000..3fd9ec8
> --- /dev/null
> +++ b/.gitattributes
> @@ -0,0 +1,2 @@
> +*.bat text eol=crlf
> +*.sh text eol=lf
> \ No newline at end of file
> --
> 2.45.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119946): https://edk2.groups.io/g/devel/message/119946
Mute This Topic: https://groups.io/mt/107182920/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: add .gitattributes to ensure right line endings in .sh .bat

2024-07-15 Thread Jayaprakash, N
Thanks Rebecca for the feedback. I shall definitely add .env into the list.
Waiting for inputs from Leif as per Mike's suggestion.

Regards,
JP

-Original Message-
From: Rebecca Cran  
Sent: Saturday, July 13, 2024 1:34 AM
To: devel@edk2.groups.io; Jayaprakash, N 
Cc: Kinney, Michael D 
Subject: Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: add .gitattributes 
to ensure right line endings in .sh .bat

On 7/12/24 08:27, Jayaprakash, N wrote:
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4809
> 
> This commit adds .gitattributes file with the right settings to 
> preserve the correct line endings for .sh and .bat files as per the 
> Linxu and Windows line ending conventions respectively.
> 
> Cc: Rebecca Cran 
> Cc: Michael D Kinney 
> Cc: Jayaprakash N 
> Signed-off-by: Jayaprakash N 
> ---
>   .gitattributes | 2 ++
>   1 file changed, 2 insertions(+)
>   create mode 100644 .gitattributes
> 
> diff --git a/.gitattributes b/.gitattributes new file mode 100644 
> index 000..3fd9ec8
> --- /dev/null
> +++ b/.gitattributes
> @@ -0,0 +1,2 @@
> +*.bat text eol=crlf
> +*.sh text eol=lf
> \ No newline at end of file

Could you also add .env to allow for files that set environment variables 
sourced from scripts?

--
Rebecca Cran


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119937): https://edk2.groups.io/g/devel/message/119937
Mute This Topic: https://groups.io/mt/107182920/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: add .gitattributes to ensure right line endings in .sh .bat

2024-07-12 Thread Jayaprakash, N
Thanks Mike.

Line endings have been a consistent problem creators for me for the .sh and 
.bat files while working on Python UEFI project.

At times I used to run dos2linux command to convert the .sh scripts line 
endings from \r\n format to \n format to fix the compilation issues on Linux.
So, thought of using the .gitattributes feature from github to normalize the 
line endings for these 2 types of text files.

Will wait to hear from Leif on the changes being evaluated for Tinocore repos 
on Line endings.

Regards,
JP
-Original Message-
From: Kinney, Michael D  
Sent: Friday, July 12, 2024 9:29 PM
To: Jayaprakash, N ; devel@edk2.groups.io; Leif 
Lindholm 
Cc: Rebecca Cran ; Kinney, Michael D 

Subject: RE: [edk2-libc Patch 1/1] edk2-libc: add .gitattributes to ensure 
right line endings in .sh .bat

+ Leif

.gitattributes is not used in other TianoCore repos.

This feature changes the line endings locally when checked out.

Instead, the edk2 repo uses a CI check like PatchCheck.py to make sure files 
with specific extensions have the correct line endings when they are checked in 
and files are checked out unmodified.

I know Leif has been evaluating some line ending changes to TianoCore Repos.  
Don't know if this direction is in alignment with those ideas or not.

Mike

> -Original Message-
> From: Jayaprakash, N 
> Sent: Friday, July 12, 2024 7:27 AM
> To: devel@edk2.groups.io
> Cc: Jayaprakash, N ; Rebecca Cran 
> ; Kinney, Michael D 
> Subject: [edk2-libc Patch 1/1] edk2-libc: add .gitattributes to ensure 
> right line endings in .sh .bat
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4809
> 
> This commit adds .gitattributes file with the right settings to 
> preserve the correct line endings for .sh and .bat files as per the 
> Linxu and Windows line ending conventions respectively.
> 
> Cc: Rebecca Cran 
> Cc: Michael D Kinney 
> Cc: Jayaprakash N 
> Signed-off-by: Jayaprakash N 
> ---
>  .gitattributes | 2 ++
>  1 file changed, 2 insertions(+)
>  create mode 100644 .gitattributes
> 
> diff --git a/.gitattributes b/.gitattributes new file mode 100644 
> index 000..3fd9ec8
> --- /dev/null
> +++ b/.gitattributes
> @@ -0,0 +1,2 @@
> +*.bat text eol=crlf
> +*.sh text eol=lf
> \ No newline at end of file
> --
> 2.45.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119914): https://edk2.groups.io/g/devel/message/119914
Mute This Topic: https://groups.io/mt/107182920/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-libc Patch 0/1] add .gitattributes to ensure right line endings in .sh .bat

2024-07-12 Thread Jayaprakash, N
This commit adds the .gitattributes file to preserve
correct line endings for the files .sh and .bat irrespective
of the environment used by the developer.

Jayaprakash N (1):
  edk2-libc: add .gitattributes to ensure right line endings in .sh .bat

 .gitattributes | 2 ++
 1 file changed, 2 insertions(+)
 create mode 100644 .gitattributes

-- 
2.45.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119911): https://edk2.groups.io/g/devel/message/119911
Mute This Topic: https://groups.io/mt/107182919/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-libc Patch 1/1] edk2-libc: add .gitattributes to ensure right line endings in .sh .bat

2024-07-12 Thread Jayaprakash, N
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4809

This commit adds .gitattributes file with the right settings
to preserve the correct line endings for .sh and .bat files
as per the Linxu and Windows line ending conventions
respectively.

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Cc: Jayaprakash N 
Signed-off-by: Jayaprakash N 
---
 .gitattributes | 2 ++
 1 file changed, 2 insertions(+)
 create mode 100644 .gitattributes

diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 000..3fd9ec8
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,2 @@
+*.bat text eol=crlf
+*.sh text eol=lf
\ No newline at end of file
-- 
2.45.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119912): https://edk2.groups.io/g/devel/message/119912
Mute This Topic: https://groups.io/mt/107182920/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc : add github actions workflow to build PyUEFI using gcc

2024-07-01 Thread Jayaprakash, N
Hi Mike,

I have sent the updated V2 patch for review.
Changed the line endings of create_python_pkg.sh script to use unix line 
endings and removed the installation and usage of dos2unix from the actions 
.yaml file.

Regards,
JP

-Original Message-
From: Jayaprakash, N 
Sent: Monday, July 1, 2024 7:55 PM
To: Kinney, Michael D ; devel@edk2.groups.io
Cc: Rebecca Cran 
Subject: RE: [edk2-libc Patch 1/1] edk2-libc : add github actions workflow to 
build PyUEFI using gcc

Thanks Mike.

I shall make this change and submit the PR again for review.

Regards,
JP

-Original Message-
From: Kinney, Michael D 
Sent: Monday, July 1, 2024 7:51 PM
To: Jayaprakash, N ; devel@edk2.groups.io
Cc: Rebecca Cran ; Kinney, Michael D 

Subject: RE: [edk2-libc Patch 1/1] edk2-libc : add github actions workflow to 
build PyUEFI using gcc

One comment below.

Mike

> -Original Message-
> From: Jayaprakash, N 
> Sent: Monday, July 1, 2024 1:44 AM
> To: devel@edk2.groups.io
> Cc: Jayaprakash, N ; Rebecca Cran 
> ; Kinney, Michael D 
> Subject: [edk2-libc Patch 1/1] edk2-libc : add github actions workflow 
> to build PyUEFI using gcc
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4794
> 
> This commit adds github actions workflow to build python uefi 
> interpreter with gcc tool chain on Ubuntu Linux system.
> The build-python-uefi-gcc.yaml file under .github/workflows implements 
> the build action for building the pyuefi interpreter with gcc tool 
> chain.
> 
> Cc: Rebecca Cran 
> Cc: Michael D Kinney 
> Cc: Jayaprakash N 
> Signed-off-by: Jayaprakash N 
> ---
>  .github/workflows/build-python-uefi-gcc.yaml | 71
> 
>  1 file changed, 71 insertions(+)
>  create mode 100644 .github/workflows/build-python-uefi-gcc.yaml
> 
> diff --git a/.github/workflows/build-python-uefi-gcc.yaml
> b/.github/workflows/build-python-uefi-gcc.yaml
> new file mode 100644
> index 000..5df6c5c
> --- /dev/null
> +++ b/.github/workflows/build-python-uefi-gcc.yaml
> @@ -0,0 +1,71 @@
> +# GitHub actions workflow to build python uefi using gcc # # 
> +Copyright (c) 2023-2024, Intel Corporation. All rights reserved.
> +# SPDX-License-Identifier: BSD-2-Clause-Patent #
> +
> +name: Build Python Interpreter for UEFI with GCC
> +
> +on: [push, pull_request]
> +
> +jobs:
> +  build:
> +runs-on: ubuntu-latest
> +
> +steps:
> +- name: Checkout repository
> +  uses: actions/checkout@v4
> +
> +- name: Setup Python
> +  uses: actions/setup-python@v5
> +  with:
> +python-version: '3.x'
> +
> +- name: Install dependencies
> +  run: |
> +sudo apt-get update
> +sudo apt-get install -y build-essential uuid-dev iasl git 
> + nasm
> python3-distutils dos2unix
> +
> +- name: Clone EDK2
> +  run: |
> +git clone https://github.com/tianocore/edk2.git
> +cd edk2
> +git submodule update --init
> +
> +- name: Build EDK2 Base Tools
> +  run: |
> +cd edk2
> +. edksetup.sh
> +make -C BaseTools
> +
> +- name: Run srcprep.py
> +  run: |
> +cd AppPkg/Applications/Python/Python-3.6.8/
> +python3 srcprep.py
> +
> +- name: Build Python UEFI
> +  run: |
> +export PACKAGES_PATH=`pwd`/edk2:`pwd`:
> +export EDK2_LIBC_PATH=`pwd`
> +cd edk2
> +. edksetup.sh
> +build -t GCC5 -a X64 -b RELEASE -p 
> + $EDK2_LIBC_PATH/AppPkg/AppPkg.dsc
> -D BUILD_PYTHON368
> +
> +- name: Create PyUEFI package
> +  run: |
> +export WORKSPACE=`pwd`/edk2
> +echo WORKSPACE is $WORKSPACE
> +export EDK2_LIBC_PATH=`pwd`
> +# run the shell script through dos2unix to update any CRLF to 
> + LF
> line ending format
> +dos2unix AppPkg/Applications/Python/Python-
> 3.6.8/create_python_pkg.sh
> +. 
> + AppPkg/Applications/Python/Python-3.6.8/create_python_pkg.sh GCC5

The create_python_pkg.sh and all .sh files should be changed in git repo to use 
unix line endings and remove the need to use dos2unix.

> RELEASE X64 myUEFIPy
> +
> +- name: List build artifacts
> +  run: |
> +ls -R edk2/myUEFIPy
> +
> +- name: Upload build output as artifact
> +  uses: actions/upload-artifact@v4
> +  with:
> +name: myUEFIPy-build-gcc-output
> +path: edk2/myUEFIPy/**/*
> \ No newline at end of file
> --
> 2.45.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119744): https://edk2.groups.io/g/devel/message/119744
Mute This Topic: https://groups.io/mt/106974577/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-libc Patch v2 1/1] edk2-libc : add github actions workflow to build PyUEFI using gcc

2024-07-01 Thread Jayaprakash, N
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4794

This commit adds github actions workflow to build python uefi
interpreter with gcc tool chain on Ubuntu Linux system.
The build-python-uefi-gcc.yaml file under .github/workflows
implements the build action for building the pyuefi interpreter with
gcc tool chain.

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Cc: Jayaprakash N 
Signed-off-by: Jayaprakash N 
---
 .github/workflows/build-python-uefi-gcc.yaml  | 69 +++
 .../Python/Python-3.6.8/create_python_pkg.sh  | 40 +--
 2 files changed, 89 insertions(+), 20 deletions(-)
 create mode 100644 .github/workflows/build-python-uefi-gcc.yaml

diff --git a/.github/workflows/build-python-uefi-gcc.yaml 
b/.github/workflows/build-python-uefi-gcc.yaml
new file mode 100644
index 000..f25fb02
--- /dev/null
+++ b/.github/workflows/build-python-uefi-gcc.yaml
@@ -0,0 +1,69 @@
+# GitHub actions workflow to build python uefi using gcc
+#
+# Copyright (c) 2023-2024, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+
+name: Build Python Interpreter for UEFI with GCC
+
+on: [push, pull_request]
+
+jobs:
+  build:
+runs-on: ubuntu-latest
+
+steps:
+- name: Checkout repository
+  uses: actions/checkout@v4
+
+- name: Setup Python
+  uses: actions/setup-python@v5
+  with:
+python-version: '3.x'
+
+- name: Install dependencies
+  run: |
+sudo apt-get update
+sudo apt-get install -y build-essential uuid-dev iasl git nasm 
python3-distutils
+
+- name: Clone EDK2
+  run: |
+git clone https://github.com/tianocore/edk2.git
+cd edk2
+git submodule update --init
+
+- name: Build EDK2 Base Tools
+  run: |
+cd edk2
+. edksetup.sh
+make -C BaseTools
+
+- name: Run srcprep.py
+  run: |
+cd AppPkg/Applications/Python/Python-3.6.8/
+python3 srcprep.py
+
+- name: Build Python UEFI
+  run: |
+export PACKAGES_PATH=`pwd`/edk2:`pwd`:
+export EDK2_LIBC_PATH=`pwd`
+cd edk2
+. edksetup.sh
+build -t GCC5 -a X64 -b RELEASE -p $EDK2_LIBC_PATH/AppPkg/AppPkg.dsc 
-D BUILD_PYTHON368
+
+- name: Create PyUEFI package
+  run: |
+export WORKSPACE=`pwd`/edk2
+echo WORKSPACE is $WORKSPACE
+export EDK2_LIBC_PATH=`pwd`
+. AppPkg/Applications/Python/Python-3.6.8/create_python_pkg.sh GCC5 
RELEASE X64 myUEFIPy
+
+- name: List build artifacts
+  run: |
+ls -R edk2/myUEFIPy
+
+- name: Upload build output as artifact
+  uses: actions/upload-artifact@v4
+  with:
+name: myUEFIPy-build-gcc-output
+path: edk2/myUEFIPy/**/*
diff --git a/AppPkg/Applications/Python/Python-3.6.8/create_python_pkg.sh 
b/AppPkg/Applications/Python/Python-3.6.8/create_python_pkg.sh
index c10ba03..323d846 100644
--- a/AppPkg/Applications/Python/Python-3.6.8/create_python_pkg.sh
+++ b/AppPkg/Applications/Python/Python-3.6.8/create_python_pkg.sh
@@ -59,24 +59,24 @@ then
exit
 fi
 
-echo current working directory `pwd`
-echo changing working directory to $WORKSPACE
-cd $WORKSPACE
-ls
-
-# check if the EDK2_LIBC_PATH environment variable set or not
-if [ -z $EDK2_LIBC_PATH ]
-then
-echo Warning: EDK2_LIBC_PATH environment variable is not set
-echo It should be set to edk2-libc folder path.
-echo.
-echo Assuming that edk2-libc contents are copied to edk2 folder
-echo at compilation time, setting this variable to edk2 path.
-export EDK2_LIBC_PATH=$WORKSPACE
-fi
-
-echo edk2 libc path $EDK2_LIBC_PATH
-
+echo current working directory `pwd`
+echo changing working directory to $WORKSPACE
+cd $WORKSPACE
+ls
+
+# check if the EDK2_LIBC_PATH environment variable set or not
+if [ -z $EDK2_LIBC_PATH ]
+then
+echo Warning: EDK2_LIBC_PATH environment variable is not set
+echo It should be set to edk2-libc folder path.
+echo.
+echo Assuming that edk2-libc contents are copied to edk2 folder
+echo at compilation time, setting this variable to edk2 path.
+export EDK2_LIBC_PATH=$WORKSPACE
+fi
+
+echo edk2 libc path $EDK2_LIBC_PATH
+
 PYTHON_BIN="Build/AppPkg/$TARGET"_"$TOOL_CHAIN_TAG/$ARCH/Python.efi"
 if [ ! -f $PYTHON_BIN ]
 then
@@ -103,8 +103,8 @@ then
 mkdir -p $OUT_FOLDER/EFI/StdLib/etc
 fi
 
-cp -rf $EDK2_LIBC_PATH/AppPkg/Applications/Python/Python-3.6.8/Lib/*  
$OUT_FOLDER/EFI/StdLib/lib/python36.8/
-cp -rf $EDK2_LIBC_PATH/StdLib/Efi/StdLib/etc/*  $OUT_FOLDER/EFI/StdLib/etc/
+cp -rf $EDK2_LIBC_PATH/AppPkg/Applications/Python/Python-3.6.8/Lib/*  
$OUT_FOLDER/EFI/StdLib/lib/python36.8/
+cp -rf $EDK2_LIBC_PATH/StdLib/Efi/StdLib/etc/*  $OUT_FOLDER/EFI/StdLib/etc/
 
 if [ ${OUT_FOLDER:0:1} == "/" ]
 then
-- 
2.45.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119743): https://edk2.groups.io/g/dev

[edk2-devel] [edk2-libc Patch v2 0/1] add github actions workflow to build PyUEFI using gcc

2024-07-01 Thread Jayaprakash, N
This patch request adds github actions workflow to build python uefi
interpreter with gcc tool chain on Ubuntu Linux system.
The build-python-uefi-gcc.yaml file under .github/workflows implements
the build action for building the pyuefi interpreter with gcc tool
chain. You may visit BZ4794 to know more about this.


Jayaprakash N (1):
  edk2-libc : add github actions workflow to build PyUEFI using gcc

 .github/workflows/build-python-uefi-gcc.yaml  | 69 +++
 .../Python/Python-3.6.8/create_python_pkg.sh  | 40 +--
 2 files changed, 89 insertions(+), 20 deletions(-)
 create mode 100644 .github/workflows/build-python-uefi-gcc.yaml

-- 
2.45.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119742): https://edk2.groups.io/g/devel/message/119742
Mute This Topic: https://groups.io/mt/106982477/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc : add github actions workflow to build PyUEFI using gcc

2024-07-01 Thread Jayaprakash, N
Thanks Mike.

I shall make this change and submit the PR again for review.

Regards,
JP

-Original Message-
From: Kinney, Michael D  
Sent: Monday, July 1, 2024 7:51 PM
To: Jayaprakash, N ; devel@edk2.groups.io
Cc: Rebecca Cran ; Kinney, Michael D 

Subject: RE: [edk2-libc Patch 1/1] edk2-libc : add github actions workflow to 
build PyUEFI using gcc

One comment below.

Mike

> -Original Message-
> From: Jayaprakash, N 
> Sent: Monday, July 1, 2024 1:44 AM
> To: devel@edk2.groups.io
> Cc: Jayaprakash, N ; Rebecca Cran 
> ; Kinney, Michael D 
> Subject: [edk2-libc Patch 1/1] edk2-libc : add github actions workflow 
> to build PyUEFI using gcc
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4794
> 
> This commit adds github actions workflow to build python uefi 
> interpreter with gcc tool chain on Ubuntu Linux system.
> The build-python-uefi-gcc.yaml file under .github/workflows implements 
> the build action for building the pyuefi interpreter with gcc tool 
> chain.
> 
> Cc: Rebecca Cran 
> Cc: Michael D Kinney 
> Cc: Jayaprakash N 
> Signed-off-by: Jayaprakash N 
> ---
>  .github/workflows/build-python-uefi-gcc.yaml | 71 
> 
>  1 file changed, 71 insertions(+)
>  create mode 100644 .github/workflows/build-python-uefi-gcc.yaml
> 
> diff --git a/.github/workflows/build-python-uefi-gcc.yaml
> b/.github/workflows/build-python-uefi-gcc.yaml
> new file mode 100644
> index 000..5df6c5c
> --- /dev/null
> +++ b/.github/workflows/build-python-uefi-gcc.yaml
> @@ -0,0 +1,71 @@
> +# GitHub actions workflow to build python uefi using gcc # # 
> +Copyright (c) 2023-2024, Intel Corporation. All rights reserved.
> +# SPDX-License-Identifier: BSD-2-Clause-Patent #
> +
> +name: Build Python Interpreter for UEFI with GCC
> +
> +on: [push, pull_request]
> +
> +jobs:
> +  build:
> +runs-on: ubuntu-latest
> +
> +steps:
> +- name: Checkout repository
> +  uses: actions/checkout@v4
> +
> +- name: Setup Python
> +  uses: actions/setup-python@v5
> +  with:
> +python-version: '3.x'
> +
> +- name: Install dependencies
> +  run: |
> +sudo apt-get update
> +sudo apt-get install -y build-essential uuid-dev iasl git 
> + nasm
> python3-distutils dos2unix
> +
> +- name: Clone EDK2
> +  run: |
> +git clone https://github.com/tianocore/edk2.git
> +cd edk2
> +git submodule update --init
> +
> +- name: Build EDK2 Base Tools
> +  run: |
> +cd edk2
> +. edksetup.sh
> +make -C BaseTools
> +
> +- name: Run srcprep.py
> +  run: |
> +cd AppPkg/Applications/Python/Python-3.6.8/
> +python3 srcprep.py
> +
> +- name: Build Python UEFI
> +  run: |
> +export PACKAGES_PATH=`pwd`/edk2:`pwd`:
> +export EDK2_LIBC_PATH=`pwd`
> +cd edk2
> +. edksetup.sh
> +build -t GCC5 -a X64 -b RELEASE -p 
> + $EDK2_LIBC_PATH/AppPkg/AppPkg.dsc
> -D BUILD_PYTHON368
> +
> +- name: Create PyUEFI package
> +  run: |
> +export WORKSPACE=`pwd`/edk2
> +echo WORKSPACE is $WORKSPACE
> +export EDK2_LIBC_PATH=`pwd`
> +# run the shell script through dos2unix to update any CRLF to 
> + LF
> line ending format
> +dos2unix AppPkg/Applications/Python/Python-
> 3.6.8/create_python_pkg.sh
> +. 
> + AppPkg/Applications/Python/Python-3.6.8/create_python_pkg.sh GCC5

The create_python_pkg.sh and all .sh files should be changed in git repo to use 
unix line endings and remove the need to use dos2unix.

> RELEASE X64 myUEFIPy
> +
> +- name: List build artifacts
> +  run: |
> +ls -R edk2/myUEFIPy
> +
> +- name: Upload build output as artifact
> +  uses: actions/upload-artifact@v4
> +  with:
> +name: myUEFIPy-build-gcc-output
> +path: edk2/myUEFIPy/**/*
> \ No newline at end of file
> --
> 2.45.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119740): https://edk2.groups.io/g/devel/message/119740
Mute This Topic: https://groups.io/mt/106974577/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-libc Patch 1/1] edk2-libc : add github actions workflow to build PyUEFI using gcc

2024-07-01 Thread Jayaprakash, N
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4794

This commit adds github actions workflow to build python uefi
interpreter with gcc tool chain on Ubuntu Linux system.
The build-python-uefi-gcc.yaml file under .github/workflows
implements the build action for building the pyuefi interpreter with
gcc tool chain.

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Cc: Jayaprakash N 
Signed-off-by: Jayaprakash N 
---
 .github/workflows/build-python-uefi-gcc.yaml | 71 
 1 file changed, 71 insertions(+)
 create mode 100644 .github/workflows/build-python-uefi-gcc.yaml

diff --git a/.github/workflows/build-python-uefi-gcc.yaml 
b/.github/workflows/build-python-uefi-gcc.yaml
new file mode 100644
index 000..5df6c5c
--- /dev/null
+++ b/.github/workflows/build-python-uefi-gcc.yaml
@@ -0,0 +1,71 @@
+# GitHub actions workflow to build python uefi using gcc
+#
+# Copyright (c) 2023-2024, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+
+name: Build Python Interpreter for UEFI with GCC
+
+on: [push, pull_request]
+
+jobs:
+  build:
+runs-on: ubuntu-latest
+
+steps:
+- name: Checkout repository
+  uses: actions/checkout@v4
+
+- name: Setup Python
+  uses: actions/setup-python@v5
+  with:
+python-version: '3.x'
+
+- name: Install dependencies
+  run: |
+sudo apt-get update
+sudo apt-get install -y build-essential uuid-dev iasl git nasm 
python3-distutils dos2unix
+
+- name: Clone EDK2
+  run: |
+git clone https://github.com/tianocore/edk2.git
+cd edk2
+git submodule update --init
+
+- name: Build EDK2 Base Tools
+  run: |
+cd edk2
+. edksetup.sh
+make -C BaseTools
+
+- name: Run srcprep.py
+  run: |
+cd AppPkg/Applications/Python/Python-3.6.8/
+python3 srcprep.py
+
+- name: Build Python UEFI
+  run: |
+export PACKAGES_PATH=`pwd`/edk2:`pwd`:
+export EDK2_LIBC_PATH=`pwd`
+cd edk2
+. edksetup.sh
+build -t GCC5 -a X64 -b RELEASE -p $EDK2_LIBC_PATH/AppPkg/AppPkg.dsc 
-D BUILD_PYTHON368
+
+- name: Create PyUEFI package
+  run: |
+export WORKSPACE=`pwd`/edk2
+echo WORKSPACE is $WORKSPACE
+export EDK2_LIBC_PATH=`pwd`
+# run the shell script through dos2unix to update any CRLF to LF line 
ending format
+dos2unix AppPkg/Applications/Python/Python-3.6.8/create_python_pkg.sh
+. AppPkg/Applications/Python/Python-3.6.8/create_python_pkg.sh GCC5 
RELEASE X64 myUEFIPy
+
+- name: List build artifacts
+  run: |
+ls -R edk2/myUEFIPy
+
+- name: Upload build output as artifact
+  uses: actions/upload-artifact@v4
+  with:
+name: myUEFIPy-build-gcc-output
+path: edk2/myUEFIPy/**/*
\ No newline at end of file
-- 
2.45.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119734): https://edk2.groups.io/g/devel/message/119734
Mute This Topic: https://groups.io/mt/106974577/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-libc Patch 0/1] setup github actions to build PyUEFI using gcc

2024-07-01 Thread Jayaprakash, N
This patch request adds github actions workflow to build python uefi
interpreter with gcc tool chain on Ubuntu Linux system.
The build-python-uefi-gcc.yaml file under .github/workflows
implements the build action for building the pyuefi interpreter with
gcc tool chain. You may visit BZ4794 to know more about this.

Jayaprakash N (1):
  edk2-libc : add github actions workflow to build PyUEFI using gcc

 .github/workflows/build-python-uefi-gcc.yaml | 71 
 1 file changed, 71 insertions(+)
 create mode 100644 .github/workflows/build-python-uefi-gcc.yaml

-- 
2.45.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119733): https://edk2.groups.io/g/devel/message/119733
Mute This Topic: https://groups.io/mt/106974576/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-libc Patch v2 1/1] edk2-libc : add github actions workflow to build PyUEFI using VS2019

2024-06-20 Thread Jayaprakash, N
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4788

This commit adds github actions workflow to build python uefi
interpreter with visual studio 2019 tool chain.
The build-python-uefi-vs.yaml file under .github/workflows
implements the build action for building the pyuefi interpreter with
VS2019 tool chain.

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Cc: Jayaprakash N 
Signed-off-by: Jayaprakash N 
---
 .github/workflows/build-python-uefi-vs.yaml | 84 +
 1 file changed, 84 insertions(+)
 create mode 100644 .github/workflows/build-python-uefi-vs.yaml

diff --git a/.github/workflows/build-python-uefi-vs.yaml 
b/.github/workflows/build-python-uefi-vs.yaml
new file mode 100644
index 000..a8393d8
--- /dev/null
+++ b/.github/workflows/build-python-uefi-vs.yaml
@@ -0,0 +1,84 @@
+# GitHub actions workflow to build python uefi using VS2019
+#
+# Copyright (c) 2023-2024, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+
+name: Build Python Interpreter for UEFI using VS2019
+
+on: [push, pull_request]
+
+jobs:
+  build:
+runs-on: windows-2019
+env:
+  NASM_PREFIX: "C:\\Program Files\\NASM\\"
+defaults:
+  run:
+shell: cmd
+
+steps:
+- name: Checkout repository
+  uses: actions/checkout@v4
+
+- name: Setup Python
+  uses: actions/setup-python@v5
+  with:
+python-version: '3.10'
+
+- name: Install NASM
+  run: choco install nasm
+
+- name: VSWhere
+  run: |
+"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe"
+
+- name: Setup environment for Visual Studio 2019 Build Tools
+  run: |
+"C:\Program Files (x86)\Microsoft Visual 
Studio\2019\Professional\VC\Auxiliary\Build\vcvarsall.bat" x86
+set
+
+- name: Clone EDK2
+  run: |
+git clone https://github.com/tianocore/edk2.git";
+cd edk2
+git submodule update --init
+
+- name: Build EDK2 Base Tools
+  run: |
+cd edk2
+dir
+edksetup.bat ForceRebuild
+
+- name: Run srcprep.py
+  run: |
+echo switching to AppPkg\Applications\Python\Python-3.6.8\
+cd AppPkg\Applications\Python\Python-3.6.8\
+dir
+echo run srcprep.py file
+python srcprep.py
+
+- name: Build Python UEFI
+  run: |
+set PACKAGES_PATH=%CD%\edk2;%CD%;
+set EDK2_LIBC_PATH=%CD%
+cd edk2
+call edksetup.bat
+build -t VS2019 -a X64 -b RELEASE -p 
%EDK2_LIBC_PATH%\AppPkg\AppPkg.dsc -D BUILD_PYTHON368
+
+- name: Create Python UEFI package
+  run: |
+set WORKSPACE=%CD%\edk2
+set EDK2_LIBC_PATH=%CD%
+dir
+call AppPkg\Applications\Python\Python-3.6.8\create_python_pkg.bat 
VS2019 RELEASE X64 myUEFIPy
+
+- name: List build artifacts
+  run: |
+dir /S edk2\myUEFIPy
+
+- name: Upload build output as artifact
+  uses: actions/upload-artifact@v4
+  with:
+name: myUEFIPy-build-VS2019-output
+path: edk2\myUEFIPy\**\*
-- 
2.45.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119652): https://edk2.groups.io/g/devel/message/119652
Mute This Topic: https://groups.io/mt/106778225/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-libc Patch v2 0/1] add github actions workflow to build PyUEFI using VS2019

2024-06-20 Thread Jayaprakash, N
This patch adds github actions workflow to build python uefi
interpreter with visual studio 2019 tool chain.
The build-python-uefi-vs.yaml file under .github/workflows
implements the build action for building the pyuefi interpreter with
VS2019 tool chain. Please refer to BZ4788 for more details.

Jayaprakash N (1):
  edk2-libc : add github actions workflow to build PyUEFI using VS2019

 .github/workflows/build-python-uefi-vs.yaml | 84 +
 1 file changed, 84 insertions(+)
 create mode 100644 .github/workflows/build-python-uefi-vs.yaml

-- 
2.45.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119651): https://edk2.groups.io/g/devel/message/119651
Mute This Topic: https://groups.io/mt/106778224/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-libc Patch 0/1] update build and packaging scripts to take EDK2_LIBC_PATH

2024-06-19 Thread Jayaprakash, N
This commit adds necessary changes to build and packaging scripts
to take path to edk2-libc through an environment variable.
It also updates the build and packaging instructions in
GCCCompilationBKMs.rst file and Py368ReadMe.txt files.
The Python368.inf file is also updated to take EDK2_LIBC_PATH
instead of the current WORKSPACE path in the CC flags.
Please refer to BZ4791 for more details.

Jayaprakash N (1):
  edk2-libc : update build and packaging scripts to take EDK2_LIBC_PATH

 .../Python-3.6.8/GCCCompilationBKMs.rst   | 21 +++--
 .../Python/Python-3.6.8/Py368ReadMe.txt   | 22 --
 .../Python/Python-3.6.8/Python368.inf |  6 ++---
 .../Python/Python-3.6.8/create_python_pkg.bat | 21 ++---
 .../Python/Python-3.6.8/create_python_pkg.sh  | 23 ---
 5 files changed, 75 insertions(+), 18 deletions(-)

-- 
2.45.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119630): https://edk2.groups.io/g/devel/message/119630
Mute This Topic: https://groups.io/mt/106756611/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-libc Patch 1/1] edk2-libc : update build and packaging scripts to take EDK2_LIBC_PATH

2024-06-19 Thread Jayaprakash, N
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4791

This commit adds necessary changes to build and packaging scripts
to take path to edk2-libc through an environment variable.
It also updates the build and packaging instructions in
GCCCompilationBKMs.rst file and Py368ReadMe.txt files.
The Python368.inf file is also updated to take EDK2_LIBC_PATH
instead of the current WORKSPACE path in the CC flags.

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Cc: Jayaprakash N 
Signed-off-by: Jayaprakash N 
---
 .../Python-3.6.8/GCCCompilationBKMs.rst   | 21 +++--
 .../Python/Python-3.6.8/Py368ReadMe.txt   | 22 --
 .../Python/Python-3.6.8/Python368.inf |  6 ++---
 .../Python/Python-3.6.8/create_python_pkg.bat | 21 ++---
 .../Python/Python-3.6.8/create_python_pkg.sh  | 23 ---
 5 files changed, 75 insertions(+), 18 deletions(-)

diff --git a/AppPkg/Applications/Python/Python-3.6.8/GCCCompilationBKMs.rst 
b/AppPkg/Applications/Python/Python-3.6.8/GCCCompilationBKMs.rst
index 0574977..667b408 100644
--- a/AppPkg/Applications/Python/Python-3.6.8/GCCCompilationBKMs.rst
+++ b/AppPkg/Applications/Python/Python-3.6.8/GCCCompilationBKMs.rst
@@ -136,17 +136,17 @@ Now clone the edk2-libc git repo by following / executing 
the below commands::
 
 bash$ cd ~/src
 bash$ git clone https://github.com/tianocore/edk2-libc.git
-bash$ export PACKAGES_PATH=$HOME/src/edk2:$HOME/src/edk2-libc
 
+Set the PACKAGES_PATH and EDK2_LIBC_PATH using the commands below::
+
+bash$ export PACKAGES_PATH=$HOME/src/edk2:$HOME/src/edk2-libc
+bash$ export EDK2_LIBC_PATH=$HOME/src/edk2-libc
 
 Verify that you can build the hello world application from AppPkg under 
edk2-libc by running the following commands
 Build hello.inf from edk2-libc applications::
 
-$bash build -p AppPkg/AppPkg.dsc -m AppPkg/Applications/Hello/Hello.inf
-
-Copy the contents of edk2-libc to edk2 folder::
+$bash build -p ../edk2-libc/AppPkg/AppPkg.dsc -m 
../edk2-libc/AppPkg/Applications/Hello/Hello.inf
 
-bash$ cp -rf ~/src/edk2-libc/* ~/src/edk2/
 
 2.5.  Build Python Interpreter using GCC
 
@@ -156,7 +156,8 @@ Execute the below command to build the X64 version of the 
Python 3.6.8 interpret
 bash$ cd AppPkg/Applications/Python/Python-3.6.8/
 bash$ python srcprep.py
 bash$ cd ~/src/edk2
-bash$ build -a X64 -b RELEASE -p AppPkg/AppPkg.dsc -m 
AppPkg/Applications/Python/Python-3.6.8/Python368.inf -D BUILD_PYTHON368
+bash$ build -a X64 -b RELEASE -p ../edk2-libc/AppPkg/AppPkg.dsc \
+  -m 
../edk2-libc/AppPkg/Applications/Python/Python-3.6.8/Python368.inf -D 
BUILD_PYTHON368
  or
 bash$ build -a X64 -b RELEASE -p AppPkg/AppPkg.dsc -D BUILD_PYTHON368
 
@@ -166,7 +167,13 @@ Execute the below command to build the X64 version of the 
Python 3.6.8 interpret
 
 To create an usable Python UEFI package with all the dependencies from the 
build environment,
 you can use the bash shell script create_python_pkg.sh available under 
/AppPkg/Applications/Python/Python-3.6.8
-folder.
+folder. Ensure that EDK2_LIBC_PATH environment variable to edk2-libc folder 
path.
+
+Ensure that EDK2_LIBC_PATH environment variable to edk2-libc folder path::
+
+bash$ echo $EDK2_LIBC_PATH
+
+The environment variable should be set to the folder path for the edk2-libc 
cloned repo.
 
 Use the following commands to create Python UEFI package::
 
diff --git a/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt 
b/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt
index 91f4c24..8a0b3fe 100644
--- a/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt
+++ b/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt
@@ -68,7 +68,24 @@ and that you can successfully build packages within that 
distribution.
 gc  itertools   math  _operator
 time
 
-  C.  Build AppPkg using the standard "build" command:
+  C.  Set the PACKAGES_PATH and EDK2_LIBC_PATH environment variables to
+the right values. PACKAGES_PATH should be set to the folder path of
+edk2 and edk2-libc folders. EDK2_LIBC_PATH should be set to the
+folder path of edk2-libc.
+Use the below provided commands as reference to set the environment
+variables to the corresponding values
+
+set PACKAGES_PATH=;;
+   set EDK2_LIBC_PATH=
+
+where,
+ should be replaced with the absolute path to
+   edk2 folder on your development system.
+
+ should be replaced with the absolute path
+   to edk2-libc folder on your development system.
+
+  D.  Build AppPkg using the standard "build" command:
 For example, to build Python for an X64 CPU architecture:
 build -a X64 -p AppPkg\AppPkg.dsc -D BUILD_PYTHON368
 
@@ -115,7 +132,8 @@ system as 

Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc : add github actions workflow to build PyUEFI using VS2019

2024-06-17 Thread Jayaprakash, N
Hi Mike,

I am planning to split this PR into multiple patches.

The first one is for the suggestion you provided to include conditional 
compilation for Python368.inf in AppPkg.dsc and to pass a macro through -D flag 
to the build command.
I have made the necessary changes and verified them locally. 
After that created a patch and submitted for the review.
Please review and approve the same.

This PR I will use only for setting up the github actions for auto build.
Rest all the changes will be done through different PRs. 

Regards,
JP
-Original Message-
From: Kinney, Michael D  
Sent: Saturday, June 15, 2024 9:03 PM
To: Jayaprakash, N ; devel@edk2.groups.io
Cc: Rebecca Cran ; Kinney, Michael D 

Subject: RE: [edk2-libc Patch 1/1] edk2-libc : add github actions workflow to 
build PyUEFI using VS2019



> -Original Message-
> From: Jayaprakash, N 
> Sent: Saturday, June 15, 2024 1:18 AM
> To: Kinney, Michael D ; 
> devel@edk2.groups.io
> Cc: Rebecca Cran 
> Subject: RE: [edk2-libc Patch 1/1] edk2-libc : add github actions 
> workflow to build PyUEFI using VS2019
> 
> Thanks Mike for your comments.
> Please find my responses inline.
> 
> Regards,
> JP
> 
> -Original Message-
> From: Kinney, Michael D 
> Sent: Saturday, June 15, 2024 7:12 AM
> To: Jayaprakash, N ; devel@edk2.groups.io
> Cc: Rebecca Cran ; Kinney, Michael D 
> 
> Subject: RE: [edk2-libc Patch 1/1] edk2-libc : add github actions 
> workflow to build PyUEFI using VS2019
> 
> Comments below.
> 
> Mike
> 
> > -Original Message-
> > From: Jayaprakash, N 
> > Sent: Friday, June 14, 2024 10:02 AM
> > To: devel@edk2.groups.io
> > Cc: Jayaprakash, N ; Rebecca Cran 
> > ; Kinney, Michael D 
> > Subject: [edk2-libc Patch 1/1] edk2-libc : add github actions 
> > workflow to build PyUEFI using VS2019
> >
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4788
> >
> > This commit adds github actions workflow to build python uefi 
> > interpreter with visual studio 2019 tool chain.
> > The build-python-uefi-vs.yaml file under .github/workflows 
> > implements the build action for building the pyuefi interpreter with 
> > VS2019 tool chain. There is also a supporting python script under 
> > .github/scripts folder which is used to uncomment the python uefi 
> > related .inf file in AppPkg.dsc file.
> >
> > Cc: Rebecca Cran 
> > Cc: Michael D Kinney 
> > Cc: Jayaprakash N 
> > Signed-off-by: Jayaprakash N 
> > ---
> >  .github/scripts/enable_pyuefi_apppkg.py | 31 
> >  .github/workflows/build-python-uefi-vs.yaml | 84
> > +
> >  2 files changed, 115 insertions(+)
> >  create mode 100644 .github/scripts/enable_pyuefi_apppkg.py
> >  create mode 100644 .github/workflows/build-python-uefi-vs.yaml
> >
> > diff --git a/.github/scripts/enable_pyuefi_apppkg.py
> > b/.github/scripts/enable_pyuefi_apppkg.py
> > new file mode 100644
> > index 000..37b9e0a
> > --- /dev/null
> > +++ b/.github/scripts/enable_pyuefi_apppkg.py
> > @@ -0,0 +1,31 @@
> > +'''Script to enable the build of python UEFI interpreter
> > +   in AppPkg.dsc file
> > +'''
> 
> Copyright and License missing
> <> Will add copyright and license
> 
> > +import os
> > +
> > +
> > +script_path = os.path.abspath(__file__) script_dir =
> > +os.path.dirname(script_path)
> > +
> > +# path to the AppPkg.dsc file
> > +path_to_AppPkg_dsc = os.path.join(script_dir, '..', '..', 'edk2', 
> > +'AppPkg',
> > 'AppPkg.dsc')
> > +print('Path to AppPkg dsc file : ', path_to_AppPkg_dsc)
> > +
> > +# Check if the file exists
> > +if not os.path.isfile(path_to_AppPkg_dsc):
> > +print(f"The file {path_to_AppPkg_dsc} does not exist.")
> > +else:
> > +# Read the content of the file
> > +with open(path_to_AppPkg_dsc, 'r') as file:
> > +lines = file.readlines()
> > +
> > +# Uncomment the line containing "Python368.inf"
> > +with open(path_to_AppPkg_dsc, 'w') as file:
> > +for line in lines:
> > +if 'Python368.inf' in line and line.strip().startswith('#'):
> > +# Uncomment the line
> > +file.write(line.lstrip('#'))
> > +else:
> > +file.write(line)
> 
> This is complicated to edit a DSC file.  Can this INF be uncommented 
> in this DSC file or add another DSC files that is only 

[edk2-devel] [edk2-libc Patch 1/1] edk2-libc : make python368.inf compile conditionally in AppPkg.dsc

2024-06-17 Thread Jayaprakash, N
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4789

This commit adds necessary changes to AppPkg.dsc file for
conditional compilation of python368.inf. To enable compilation
of python368.inf users need to pass an additional parameter
to the build command as -D BUILD_PYTHON368.
Also updated the Py368ReadMe.txt and the GCCCompilationBKMs.rst
to include this additional information for building python368.inf.

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Cc: Jayaprakash N 
Signed-off-by: Jayaprakash N 
---
 AppPkg/AppPkg.dsc| 9 ++---
 .../Python/Python-3.6.8/GCCCompilationBKMs.rst   | 6 ++
 AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt  | 9 +++--
 3 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/AppPkg/AppPkg.dsc b/AppPkg/AppPkg.dsc
index e5a6c5e..89f9f1d 100644
--- a/AppPkg/AppPkg.dsc
+++ b/AppPkg/AppPkg.dsc
@@ -7,7 +7,7 @@
 #   for important information about configuring this package for your
 #   environment.
 #
-#   Copyright (c) 2010 - 2021, Intel Corporation. All rights reserved.
+#   Copyright (c) 2010 - 2024, Intel Corporation. All rights reserved.
 #   SPDX-License-Identifier: BSD-2-Clause-Patent
 ##
 
@@ -120,8 +120,11 @@
   gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80400040
   }
 
- Un-comment the following line to build Python 3.6.8.
-# AppPkg/Applications/Python/Python-3.6.8/Python368.inf
+ Conditional compilation of python368.inf by passing -D BUILD_PYTHON368
+ through build command
+  !if $(BUILD_PYTHON368)
+AppPkg/Applications/Python/Python-3.6.8/Python368.inf
+  !endif
 
  Un-comment the following line to build Lua.
 #  AppPkg/Applications/Lua/Lua.inf
diff --git a/AppPkg/Applications/Python/Python-3.6.8/GCCCompilationBKMs.rst 
b/AppPkg/Applications/Python/Python-3.6.8/GCCCompilationBKMs.rst
index 525bef8..0574977 100644
--- a/AppPkg/Applications/Python/Python-3.6.8/GCCCompilationBKMs.rst
+++ b/AppPkg/Applications/Python/Python-3.6.8/GCCCompilationBKMs.rst
@@ -150,17 +150,15 @@ Copy the contents of edk2-libc to edk2 folder::
 
 2.5.  Build Python Interpreter using GCC
 
-Uncomment the line containing following inf file name in AppPkg/AppPkg.dsc file
-AppPkg/Applications/Python/Python-3.6.8/Python368.inf
 
 Execute the below command to build the X64 version of the Python 3.6.8 
interpreter using GCC tool chain::
 
 bash$ cd AppPkg/Applications/Python/Python-3.6.8/
 bash$ python srcprep.py
 bash$ cd ~/src/edk2
-bash$ build -a X64 -b RELEASE -p AppPkg/AppPkg.dsc -m 
AppPkg/Applications/Python/Python-3.6.8/Python368.inf
+bash$ build -a X64 -b RELEASE -p AppPkg/AppPkg.dsc -m 
AppPkg/Applications/Python/Python-3.6.8/Python368.inf -D BUILD_PYTHON368
  or
-bash$ build -a X64 -b RELEASE -p AppPkg/AppPkg.dsc
+bash$ build -a X64 -b RELEASE -p AppPkg/AppPkg.dsc -D BUILD_PYTHON368
 
 
 2.5  Create Python UEFI package with all dependencies
diff --git a/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt 
b/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt
index a6e65fe..5753443 100644
--- a/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt
+++ b/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt
@@ -68,12 +68,9 @@ and that you can successfully build packages within that 
distribution.
 gc  itertools   math  _operator
 time
 
-  C.  Edit AppPkg/AppPkg.dsc to enable (uncomment) the Python368.inf line
-within the [Components] section.
-
-  D.  Build AppPkg using the standard "build" command:
+  C.  Build AppPkg using the standard "build" command:
 For example, to build Python for an X64 CPU architecture:
-build -a X64 -p AppPkg\AppPkg.dsc
+build -a X64 -p AppPkg\AppPkg.dsc -D BUILD_PYTHON368
 
 4. Python-related paths and files
 =
@@ -133,7 +130,7 @@ system as follows:
   2. Uncomment BsdSocketLib and EfiSocketLib LibraryClasses in Python368.inf
   3. Uncomment the statement #Modules/socketmodule.c in Python368.inf
   4. Build Python interpreter application using below command
-  build -a X64 -p AppPkg\AppPkg.dsc
+  build -a X64 -p AppPkg\AppPkg.dsc -D BUILD_PYTHON368
   5. Copy Build\AppPkg\RELEASE_VS2017\X64\Python.efi to \Efi\Tools on your
  target system. Replace "RELEASE_VS2017", in the source path, with
  values appropriate for your tool chain.
-- 
2.45.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119604): https://edk2.groups.io/g/devel/message/119604
Mute This Topic: https://groups.io/mt/106736573/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-libc Patch 0/1] make python368.inf compile conditionally in AppPkg.dsc

2024-06-17 Thread Jayaprakash, N
This patch adds necessary changes to AppPkg.dsc file for
conditional compilation of python368.inf. To enable compilation
of python368.inf users need to pass an additional parameter
to the build command as -D BUILD_PYTHON368.
Also updated the Py368ReadMe.txt and the GCCCompilationBKMs.rst
to include this additional information for building python368.inf.
Please refer to BZ4789 for more details on the request.

Jayaprakash N (1):
  edk2-libc : make python368.inf compile conditionally in AppPkg.dsc

 AppPkg/AppPkg.dsc| 9 ++---
 .../Python/Python-3.6.8/GCCCompilationBKMs.rst   | 6 ++
 AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt  | 9 +++--
 3 files changed, 11 insertions(+), 13 deletions(-)

-- 
2.45.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119603): https://edk2.groups.io/g/devel/message/119603
Mute This Topic: https://groups.io/mt/106736572/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc : add github actions workflow to build PyUEFI using VS2019

2024-06-15 Thread Jayaprakash, N
Thanks Mike for your comments.
Please find my responses inline.

Regards,
JP

-Original Message-
From: Kinney, Michael D  
Sent: Saturday, June 15, 2024 7:12 AM
To: Jayaprakash, N ; devel@edk2.groups.io
Cc: Rebecca Cran ; Kinney, Michael D 

Subject: RE: [edk2-libc Patch 1/1] edk2-libc : add github actions workflow to 
build PyUEFI using VS2019

Comments below.

Mike

> -Original Message-
> From: Jayaprakash, N 
> Sent: Friday, June 14, 2024 10:02 AM
> To: devel@edk2.groups.io
> Cc: Jayaprakash, N ; Rebecca Cran 
> ; Kinney, Michael D 
> Subject: [edk2-libc Patch 1/1] edk2-libc : add github actions workflow 
> to build PyUEFI using VS2019
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4788
> 
> This commit adds github actions workflow to build python uefi 
> interpreter with visual studio 2019 tool chain.
> The build-python-uefi-vs.yaml file under .github/workflows implements 
> the build action for building the pyuefi interpreter with VS2019 tool 
> chain. There is also a supporting python script under .github/scripts 
> folder which is used to uncomment the python uefi related .inf file in 
> AppPkg.dsc file.
> 
> Cc: Rebecca Cran 
> Cc: Michael D Kinney 
> Cc: Jayaprakash N 
> Signed-off-by: Jayaprakash N 
> ---
>  .github/scripts/enable_pyuefi_apppkg.py | 31 
>  .github/workflows/build-python-uefi-vs.yaml | 84 
> +
>  2 files changed, 115 insertions(+)
>  create mode 100644 .github/scripts/enable_pyuefi_apppkg.py
>  create mode 100644 .github/workflows/build-python-uefi-vs.yaml
> 
> diff --git a/.github/scripts/enable_pyuefi_apppkg.py
> b/.github/scripts/enable_pyuefi_apppkg.py
> new file mode 100644
> index 000..37b9e0a
> --- /dev/null
> +++ b/.github/scripts/enable_pyuefi_apppkg.py
> @@ -0,0 +1,31 @@
> +'''Script to enable the build of python UEFI interpreter
> +   in AppPkg.dsc file
> +'''

Copyright and License missing
<> Will add copyright and license

> +import os
> +
> +
> +script_path = os.path.abspath(__file__) script_dir = 
> +os.path.dirname(script_path)
> +
> +# path to the AppPkg.dsc file
> +path_to_AppPkg_dsc = os.path.join(script_dir, '..', '..', 'edk2', 
> +'AppPkg',
> 'AppPkg.dsc')
> +print('Path to AppPkg dsc file : ', path_to_AppPkg_dsc)
> +
> +# Check if the file exists
> +if not os.path.isfile(path_to_AppPkg_dsc):
> +print(f"The file {path_to_AppPkg_dsc} does not exist.")
> +else:
> +# Read the content of the file
> +with open(path_to_AppPkg_dsc, 'r') as file:
> +lines = file.readlines()
> +
> +# Uncomment the line containing "Python368.inf"
> +with open(path_to_AppPkg_dsc, 'w') as file:
> +for line in lines:
> +if 'Python368.inf' in line and line.strip().startswith('#'):
> +# Uncomment the line
> +file.write(line.lstrip('#'))
> +else:
> +file.write(line)

This is complicated to edit a DSC file.  Can this INF be uncommented in this 
DSC file or add another DSC files that is only used for this workflow to build 
python that has this INF uncommented.  Then this extra python script can be 
removed.

<> 
The reason I chose this approach is because we cannot uncomment this file by 
default in DSC file as it needs few additional steps to be done before the 
compilation.
Also adding another DSC file can lead to regular maintenance of the DSC file 
whenever there are changes to it, we need update in two files.
This custom script makes the process is and it keeps the github actions 
specific things are completely isolated from the rest of the code base. 
Would like to continue with this script rather than having a duplicate DCS file 
specifically for github actions. 

> +
> +print(f"The file {path_to_AppPkg_dsc} has been updated.")
> diff --git a/.github/workflows/build-python-uefi-vs.yaml
> b/.github/workflows/build-python-uefi-vs.yaml
> new file mode 100644
> index 000..aa5c317
> --- /dev/null
> +++ b/.github/workflows/build-python-uefi-vs.yaml
> @@ -0,0 +1,84 @@

Copyright and License missing

<> Will add and send updated patch for review.

> +name: Build Python Interpreter for UEFI using VS2019
> +
> +on: [push, pull_request]
> +
> +jobs:
> +  build:
> +runs-on: windows-2019
> +env:
> +  NASM_PREFIX: "C:\\Program Files\\NASM\\"
> +defaults:
> +  run:
> +shell: cmd
> +
> +steps:
> +- name: Checkout repository
> +  uses: actions/checkout@v4
> +
> +- name: Setup Python
> +  u

[edk2-devel] [edk2-libc Patch 1/1] edk2-libc : add github actions workflow to build PyUEFI using VS2019

2024-06-14 Thread Jayaprakash, N
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4788

This commit adds github actions workflow to build python uefi
interpreter with visual studio 2019 tool chain.
The build-python-uefi-vs.yaml file under .github/workflows
implements the build action for building the pyuefi interpreter
with VS2019 tool chain. There is also a supporting python script
under .github/scripts folder which is used to uncomment the python
uefi related .inf file in AppPkg.dsc file.

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Cc: Jayaprakash N 
Signed-off-by: Jayaprakash N 
---
 .github/scripts/enable_pyuefi_apppkg.py | 31 
 .github/workflows/build-python-uefi-vs.yaml | 84 +
 2 files changed, 115 insertions(+)
 create mode 100644 .github/scripts/enable_pyuefi_apppkg.py
 create mode 100644 .github/workflows/build-python-uefi-vs.yaml

diff --git a/.github/scripts/enable_pyuefi_apppkg.py 
b/.github/scripts/enable_pyuefi_apppkg.py
new file mode 100644
index 000..37b9e0a
--- /dev/null
+++ b/.github/scripts/enable_pyuefi_apppkg.py
@@ -0,0 +1,31 @@
+'''Script to enable the build of python UEFI interpreter 
+   in AppPkg.dsc file
+'''
+import os
+
+
+script_path = os.path.abspath(__file__)
+script_dir = os.path.dirname(script_path)
+
+# path to the AppPkg.dsc file
+path_to_AppPkg_dsc = os.path.join(script_dir, '..', '..', 'edk2', 'AppPkg', 
'AppPkg.dsc')
+print('Path to AppPkg dsc file : ', path_to_AppPkg_dsc)
+
+# Check if the file exists
+if not os.path.isfile(path_to_AppPkg_dsc):
+print(f"The file {path_to_AppPkg_dsc} does not exist.")
+else:
+# Read the content of the file
+with open(path_to_AppPkg_dsc, 'r') as file:
+lines = file.readlines()
+
+# Uncomment the line containing "Python368.inf"
+with open(path_to_AppPkg_dsc, 'w') as file:
+for line in lines:
+if 'Python368.inf' in line and line.strip().startswith('#'):
+# Uncomment the line
+file.write(line.lstrip('#'))
+else:
+file.write(line)
+
+print(f"The file {path_to_AppPkg_dsc} has been updated.")
diff --git a/.github/workflows/build-python-uefi-vs.yaml 
b/.github/workflows/build-python-uefi-vs.yaml
new file mode 100644
index 000..aa5c317
--- /dev/null
+++ b/.github/workflows/build-python-uefi-vs.yaml
@@ -0,0 +1,84 @@
+name: Build Python Interpreter for UEFI using VS2019
+
+on: [push, pull_request]
+
+jobs:
+  build:
+runs-on: windows-2019
+env:
+  NASM_PREFIX: "C:\\Program Files\\NASM\\"
+defaults:
+  run:
+shell: cmd
+
+steps:
+- name: Checkout repository
+  uses: actions/checkout@v4
+
+- name: Setup Python
+  uses: actions/setup-python@v5
+  with:
+python-version: '3.10'
+
+- name: Install NASM
+  run: choco install nasm
+
+- name: VSWhere
+  run: |
+"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe"
+
+- name: Setup environment for Visual Studio 2019 Build Tools
+  run: |
+"C:\Program Files (x86)\Microsoft Visual 
Studio\2019\Professional\VC\Auxiliary\Build\vcvarsall.bat" x86
+set
+
+- name: Clone EDK2
+  run: |
+git clone https://github.com/tianocore/edk2.git";
+cd edk2
+git submodule update --init
+
+- name: Copy edk2-libc contents to edk2
+  run: |
+dir
+cmd /c xcopy /E /I /Y AppPkg edk2\AppPkg
+cmd /c xcopy /E /I /Y StdLib edk2\StdLib
+cmd /c xcopy /E /I /Y StdLibPrivateInternalFiles 
edk2\StdLibPrivateInternalFiles
+
+- name: Build EDK2 Base Tools
+  run: |
+cd edk2
+dir
+edksetup.bat ForceRebuild
+
+- name: Enable python368.inf file in AppPkg.dsc
+  run: |
+cd .github\scripts
+dir
+python enable_pyuefi_apppkg.py
+
+- name: Build Python UEFI
+  run: |
+cd edk2
+call edksetup.bat
+cd AppPkg\Applications\Python\Python-3.6.8\
+python srcprep.py
+cd ..\..\..\..\..\
+build -t VS2019 -a X64 -b RELEASE -p AppPkg\AppPkg.dsc
+
+- name: Create Python UEFI package
+  run: |
+dir
+cd edk2\AppPkg\Applications\Python\Python-3.6.8\
+dir
+call create_python_pkg.bat VS2019 RELEASE X64 myUEFIPy
+
+- name: List build artifacts
+  run: |
+dir /S edk2\myUEFIPy
+
+- name: Upload build output as artifact
+  uses: actions/upload-artifact@v4
+  with:
+name: myUEFIPy-build-VS2019-output
+path: edk2\myUEFIPy\**\*
-- 
2.45.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119578): https://edk2.groups.io/g/devel/message/119578
Mute This Topic: https://groups.io/mt/106674325/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-libc Patch 0/1] add github actions workflow to build Python UEFI with VS2019

2024-06-14 Thread Jayaprakash, N
This patch request enables the github actions workflow to build Python
UEFI interpreter using VS2019 tool chain. 
Please refere to BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=4788

Jayaprakash N (1):
  edk2-libc : add github actions workflow to build PyUEFI using VS2019

 .github/scripts/enable_pyuefi_apppkg.py | 31 
 .github/workflows/build-python-uefi-vs.yaml | 84 +
 2 files changed, 115 insertions(+)
 create mode 100644 .github/scripts/enable_pyuefi_apppkg.py
 create mode 100644 .github/workflows/build-python-uefi-vs.yaml

-- 
2.45.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119577): https://edk2.groups.io/g/devel/message/119577
Mute This Topic: https://groups.io/mt/106674324/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: Add cpuid_ex API to execute CPUID instructions on specific CPU

2024-05-17 Thread Jayaprakash, N
Changes looks good.

Reviewed-by: Jayaprakash N 

Regards,
JP
-Original Message-
From: R, Vishal  
Sent: Friday, May 17, 2024 12:08 PM
To: devel@edk2.groups.io
Cc: R, Vishal ; Rebecca Cran ; Kinney, 
Michael D ; Jayaprakash, N 
Subject: [edk2-libc Patch 1/1] edk2-libc: Add cpuid_ex API to execute CPUID 
instructions on specific CPU

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

This commit adds cpuid_ex function to edk2module to provide capability to 
execute cpuid instruction on specific cpu.
This feature was requested via BZ 4749

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Cc: Jayaprakash N 
Signed-off-by: Vishal R 
---
 .../PyMod-3.6.8/Modules/edk2module.c  | 93 +++
 1 file changed, 93 insertions(+)

diff --git 
a/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c 
b/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c
index 163fc7f..d419428 100644
--- a/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c
+++ b/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2mo
+++ dule.c
@@ -45,6 +45,15 @@ typedef struct {
 UINT64 data; // data, to be filled by the AP function  } 
AP_FUNCTION_MSR_ARGS;
 
+typedef struct {
+UINT32 eax; // eax value
+UINT32 ecx; // ecx value
+UINT32 rax_value;   // retrun value for eax
+UINT32 rbx_value;   // return value for ebx
+UINT32 rcx_value;   // retrun value for ecx
+UINT32 rdx_value;   // return value for edx
+} AP_FUNCTION_CPUID_ARGS;
+
 #define AP_FUNCTION_EXECUTION_TIMEOUT  500   // setting the max time out 
value to be 5 seconds
 
 extern void _swsmi( unsigned int smi_code_data, unsigned int rax_value, 
unsigned int rbx_value, unsigned int rcx_value, unsigned int rdx_value, 
unsigned int rsi_value, unsigned int rdi_value ); @@ -223,6 +232,13 @@ VOID 
EFIAPI MSRWriteToRunOnAP(IN VOID *context)
 AsmWriteMsr64(msr, data);
 }
 
+// CPUID execution function to run on specific cpu core using 
+MPServices Protocol VOID EFIAPI CPUIDToRunOnAP(IN VOID *context) {
+AP_FUNCTION_CPUID_ARGS *args = (AP_FUNCTION_CPUID_ARGS *)context;
+AsmCpuidEx( args->eax, args->ecx, &args->rax_value, 
+&args->rbx_value, &args->rcx_value, &args->rdx_value); }
+
 #ifndef UEFI_C_SOURCE
 /* Return a dictionary corresponding to the POSIX environment table */  extern 
char **environ; @@ -4153,6 +4169,82 @@ edk2_cpuid(PyObject *self, PyObject 
*args)
 return Py_BuildValue("())",  (unsigned long)rax_value,  (unsigned 
long)rbx_value,  (unsigned long)rcx_value,  (unsigned long)rdx_value);  }
 
+PyDoc_STRVAR(efi_cpuid_ex__doc__,
+"cpuid_ex(cpu, eax, ecx) -> (eax:ebx:ecx:edx)\n\ Read the CPUID from a 
+specific cpu.";);
+
+static PyObject *
+edk2_cpuid_ex(PyObject *self, PyObject *args) {
+UINT32 cpu, eax, ecx, rax_value, rbx_value, rcx_value, rdx_value;
+BOOLEAN is_function_finished = FALSE;
+EFI_STATUS status = 0;
+AP_FUNCTION_CPUID_ARGS cpuid_args = {0};
+
+if (!PyArg_ParseTuple(args, "III", &cpu, &eax, &ecx))
+return NULL;
+Py_BEGIN_ALLOW_THREADS
+
+cpuid_args.eax = eax;
+cpuid_args.ecx = ecx;
+
+if (cpu == gCurrentBSPProcessorNumber)
+{
+// cpu provided as input is same as the current BSP processor
+// then directly call the CPUIDToRunOnAP function to execute
+// cpuid instruction on current BSP processor itself.
+CPUIDToRunOnAP(&cpuid_args);
+}
+else if (cpu < gNumberOfProcessors)
+{
+// if cpu provided as input is different from the current
+// BSP processor and is less than the number of processors
+// on this system, then make use of the MPService protocols
+// StartupThisAP function to run the CPUIDToRunOnAP function on
+// specific AP indicated by cpu parameter.
+// Start the AP with the arguments structure
+
+status = gpMpService->StartupThisAP(
+gpMpService,
+CPUIDToRunOnAP, // Function to run
+cpu,// AP number
+NULL,   // WaitEvent (optional)
+AP_FUNCTION_EXECUTION_TIMEOUT,  // Timeout in microseconds
+&cpuid_args,// Buffer to pass to the function
+&is_function_finished   // Finished (optional)
+);
+if (EFI_ERROR(status))
+{
+PyErr_SetString(PyExc_OSError, "Could not start the requested 
cpu");
+Py_INCREF(Py_None);
+return Py_None;
+}
+
+if (!is_function_finished)
+{
+PyErr_SetString(PyExc_OSError,
+"Timeout while running the cpuid instruction on 
given cpu");
+Py_INCREF(Py_None);
+return Py_None;
+}
+}
+else
+{

Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc:add rdmsr_ex & wrmsr_ex functions to read/write cpu specific msrs

2024-04-24 Thread Jayaprakash, N
Hi Mike,

I have sent an updated patch v2 for review which uses the MP Services protocol 
API StarupThisAP() to read / write MSRs specific to CPU cores.
Please review and do the needful.

Regards,
JP

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Jayaprakash, N
Sent: Thursday, April 18, 2024 11:49 AM
To: Kinney, Michael D ; devel@edk2.groups.io
Cc: Rebecca Cran 
Subject: Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc:add rdmsr_ex & 
wrmsr_ex functions to read/write cpu specific msrs

Thanks Mike. I shall make necessary changes and submit the PR again for review.

Regards,
JP

-Original Message-
From: Kinney, Michael D 
Sent: Thursday, April 18, 2024 10:46 AM
To: Jayaprakash, N ; devel@edk2.groups.io
Cc: Rebecca Cran ; Kinney, Michael D 

Subject: RE: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc:add rdmsr_ex & 
wrmsr_ex functions to read/write cpu specific msrs

Please use MP Services Protocol APIs StartupAllAPs() or StarupThisAP() to 
read/write MSRs on other logical processors.

There and many examples of this in the UefiCpuPkg to programming MSRs on all 
the logical processors.

Mike

> -Original Message-----
> From: Jayaprakash, N 
> Sent: Wednesday, April 17, 2024 8:16 PM
> To: Kinney, Michael D ; 
> devel@edk2.groups.io
> Cc: Rebecca Cran 
> Subject: RE: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc:add rdmsr_ex 
> & wrmsr_ex functions to read/write cpu specific msrs
> 
> In the validation and debug scenarios, engineers tend to read MSRs and 
> write to MSRs of different CPUs.
> So we are providing a simple mechanism through these APIs to enable 
> them to do these operations.
> 
> These APIs will be part of the edk2 module of the Python interpreter 
> and will be used during the validation and debug scenarios only.
> 
> This is not for switching the BSP for OS boot. This is only used 
> during the validation and debug use cases.
> 
> Regards,
> JP
> -Original Message-
> From: Kinney, Michael D 
> Sent: Thursday, April 18, 2024 12:08 AM
> To: Jayaprakash, N ; devel@edk2.groups.io
> Cc: Rebecca Cran ; Kinney, Michael D 
> 
> Subject: RE: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc:add rdmsr_ex 
> & wrmsr_ex functions to read/write cpu specific msrs
> 
> Hi JP,
> 
> Is there a reason switch BSP is being used.  That is not a common 
> operation and is typically used if the current BSP is not stable or 
> there is a good reason to switch the BSP for OS boot.
> 
> The MP Services can be used to execute a C function on APs to execute 
> MSR related instructions.
> 
> Mike
> 
> > -Original Message-
> > From: Jayaprakash, N 
> > Sent: Sunday, April 14, 2024 10:33 PM
> > To: devel@edk2.groups.io; Jayaprakash, N 
> > Cc: Rebecca Cran ; Kinney, Michael D 
> > 
> > Subject: RE: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc:add
> rdmsr_ex
> > & wrmsr_ex functions to read/write cpu specific msrs
> >
> > + Rebecca and Mike,
> >
> > Would you be able to review this PR?
> >
> > Regards,
> > JP
> >
> > -Original Message-
> > From: devel@edk2.groups.io  On Behalf Of 
> > Jayaprakash, N
> > Sent: Wednesday, April 10, 2024 11:49 AM
> > To: devel@edk2.groups.io
> > Cc: Jayaprakash, N ; Rebecca Cran 
> > ; Kinney, Michael D 
> > Subject: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc:add rdmsr_ex & 
> > wrmsr_ex functions to read/write cpu specific msrs
> >
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4746
> >
> > The rdmsr_ex and wrmsr_ex are extension APIs to the rdmsr and wrmsr 
> > APIs supported in edk2 module. These extension APIs makes it
> possible
> > to read / write MSRs from specific processors and fills an existing 
> > gap in this area.
> >
> > Cc: Rebecca Cran 
> > Cc: Michael D Kinney 
> > Cc: Jayaprakash N 
> > Signed-off-by: Jayaprakash N 
> > ---
> >  .../PyMod-3.6.8/Modules/edk2module.c  | 159
> > +-
> >  .../Python/Python-3.6.8/Python368.inf |   3 +
> >  2 files changed, 158 insertions(+), 4 deletions(-)
> >
> > diff --git a/AppPkg/Applications/Python/Python-3.6.8/PyMod-
> > 3.6.8/Modules/edk2module.c b/AppPkg/Applications/Python/Python-
> > 3.6.8/PyMod-3.6.8/Modules/edk2module.c
> > index d6af8da..f1b13a6 100644
> > --- a/AppPkg/Applications/Python/Python-3.6.8/PyMod-
> > 3.6.8/Modules/edk2module.c
> > +++ b/AppPkg/Applications/Python/Python-3.6.8/PyMod-
> > 3.6.8/Modules/edk2mo
> > +++ dule.c
> > @@ -3,7 +3,7 @@
> >  Derived from posixmodule.c in Python 2.7.2.
> >
> >  Copyright (c) 2015, Daryl McDani

[edk2-devel] [edk2-libc Patch v2 1/1] edk2-libc : add rdmsr_ex and wrmsr_ex to read/write msr from specific cpus

2024-04-24 Thread Jayaprakash, N
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4746

The rdmsr_ex and wrmsr_ex are extension APIs to the rdmsr and wrmsr APIs
supported in edk2 module. These extension APIs makes it possible to
read / write MSRs from specific processors. This fills an important gap in
reading / writing these registers from specific cpu cores using python
scripts from UEFI shell.

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Cc: Jayaprakash N 
Signed-off-by: Jayaprakash N 
---
 .../PyMod-3.6.8/Modules/edk2module.c  | 258 +-
 .../Python/Python-3.6.8/Python368.inf |   3 +
 2 files changed, 252 insertions(+), 9 deletions(-)

diff --git 
a/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c 
b/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c
index f688b51..13e5de5 100644
--- a/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c
+++ b/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c
@@ -3,7 +3,7 @@
 Derived from posixmodule.c in Python 2.7.2.
 
 Copyright (c) 2015, Daryl McDaniel. All rights reserved.
-Copyright (c) 2011 - 2023, Intel Corporation. All rights reserved.
+Copyright (c) 2011 - 2024, Intel Corporation. All rights reserved.
 This program and the accompanying materials are licensed and made 
available under
 the terms and conditions of the BSD License that accompanies this 
distribution.
 The full text of the license may be found at
@@ -22,16 +22,30 @@
 #include  
 #include  
 #include  
+#include// Needed for the definition of EFI_AP_PROCEDURE
 #include  
 #include  
 #include  
 #include  
+#include  
+#include  
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 PyTypeObject EfiGuidType;
+EFI_MP_SERVICES_PROTOCOL   *gpMpService = NULL;
+UINTN   gCurrentBSPProcessorNumber = 0;
+UINTN   gNumberOfProcessors = 0;
+UINTN   gNumberOfEnabledProcessors = 0;
+
+typedef struct {
+UINT32 msr;  // msr value
+UINT64 data; // data, to be filled by the AP function
+} AP_FUNCTION_MSR_ARGS;
+
+#define AP_FUNCTION_EXECUTION_TIMEOUT  500   // setting the max time out 
value to be 5 seconds
 
 extern void _swsmi( unsigned int smi_code_data, unsigned int rax_value, 
unsigned int rbx_value, unsigned int rcx_value, unsigned int rdx_value, 
unsigned int rsi_value, unsigned int rdi_value );
 // -- Support routines
@@ -169,6 +183,46 @@ PyDoc_STRVAR(edk2__doc__,
 /* dummy version. _PyVerify_fd() is already defined in fileobject.h */
 #define _PyVerify_fd_dup2(A, B) (1)
 
+/* MPServices Protocol wrapper function definitions */
+static EFI_STATUS
+MpServicesWhoAmI (
+  IN EFI_MP_SERVICES_PROTOCOL  *pMpService,
+  OUT UINTN*pProcessorNumber
+  )
+{
+  return pMpService->WhoAmI (pMpService, pProcessorNumber);
+}
+
+static EFI_STATUS
+MpServicesGetNumberOfProcessors (
+  IN EFI_MP_SERVICES_PROTOCOL  *pMpService,
+  OUT UINTN*pNumberOfProcessors,
+  OUT UINTN*pNumberOfEnabledProcessors
+
+  )
+{
+  return pMpService->GetNumberOfProcessors (pMpService,
+pNumberOfProcessors,
+pNumberOfEnabledProcessors);
+}
+
+// MSR read function to run on specific cpu core using MPServices Protocol
+VOID EFIAPI MSRReadToRunOnAP(IN VOID *context)
+{
+AP_FUNCTION_MSR_ARGS *args = (AP_FUNCTION_MSR_ARGS *)context;
+UINT32 msr = args->msr;
+args->data = AsmReadMsr64(msr);
+}
+
+// MSR write function to run on specific cpu core using MPServices Protocol
+VOID EFIAPI MSRWriteToRunOnAP(IN VOID *context)
+{
+AP_FUNCTION_MSR_ARGS *args = (AP_FUNCTION_MSR_ARGS *)context;
+UINT32 msr = args->msr;
+UINT64 data = args->data;
+AsmWriteMsr64(msr, data);
+}
+
 #ifndef UEFI_C_SOURCE
 /* Return a dictionary corresponding to the POSIX environment table */
 extern char **environ;
@@ -3864,6 +3918,91 @@ edk2_rdmsr(PyObject *self, PyObject *args)
   vedx = (UINT64)data >> 32;
   return Py_BuildValue("(II)", (unsigned long)veax, (unsigned long)vedx);
 }
+
+PyDoc_STRVAR(efi_rdmsr_ex__doc__,
+"rdmsr_ex(cpu, msr) -> (lower_32bits, higher_32bits)\n\
+\n\
+Read the given msr from the specific cpu and return the data as tuple,\n\
+provided the cpu number is less than the max number of processors on\n\
+this system, otherwise generates OSError/ValueError to indicate API failure.\n\
+\n\
+Parameters:\n\
+cpu - The cpu number in hex or int format\n\
+msr - The msr in hex or int format\n\
+\n\
+Return Value:\n\
+a tuple with lower and higher 32 bit values read from the msr\n\
+");
+
+static PyObject *
+edk2_rdmsr_ex(PyObject *self, PyObject *args)
+{
+unsigned int cpu, msr, veax, vedx;
+EFI_STATUS status = 0;
+UINT64   data = 0;
+BOOLEAN is_function_finished = FALSE;
+AP_FUNCTION_MSR_ARGS ap_function_args =

[edk2-devel] [edk2-libc Patch v2 0/1] add rdmsr_ex & wrmsr_ex functions to read/write msrs from specific cpu

2024-04-24 Thread Jayaprakash, N
This patch adds 2 new functions to read and write MSRs from specific CPUs.
rdmsr_ex and wrmsr_ex are the 2 new functions added into edk2module to provide
the read and write of CPU specific MSRs.

Jayaprakash N (1):
  edk2-libc : add rdmsr_ex and wrmsr_ex to read/write msr from specific
cpus

 .../PyMod-3.6.8/Modules/edk2module.c  | 258 +-
 .../Python/Python-3.6.8/Python368.inf |   3 +
 2 files changed, 252 insertions(+), 9 deletions(-)

-- 
2.44.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#118230): https://edk2.groups.io/g/devel/message/118230
Mute This Topic: https://groups.io/mt/105715628/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-libc Patch 2 1/1] ek2-libc: wrmsr function available in edk2module is not working as expected

2024-04-19 Thread Jayaprakash, N
Thanks Mike as suggested made the logic simpler.
Sent the updated v3 patch for review.

Regards,
JP

-Original Message-
From: Kinney, Michael D  
Sent: Friday, April 19, 2024 2:35 AM
To: Jayaprakash, N ; devel@edk2.groups.io
Cc: Rebecca Cran ; Kinney, Michael D 

Subject: RE: [edk2-libc Patch 2 1/1] ek2-libc: wrmsr function available in 
edk2module is not working as expected

The use of BitFieldOr64() is really only required when updating a portion of a 
32-bit or 64-bit value that are not aligned on a 32-bit boundary and do not 
have a 32-bit aligned width.  Since this use case is setting the lower 32-bits, 
simpler logic should be used.

  data = LShiftU64(vedx, 32) | veax;

Mike

> -Original Message-
> From: Jayaprakash, N 
> Sent: Thursday, April 18, 2024 5:55 AM
> To: devel@edk2.groups.io
> Cc: Jayaprakash, N ; Rebecca Cran 
> ; Kinney, Michael D 
> Subject: [edk2-libc Patch 2 1/1] ek2-libc: wrmsr function available in 
> edk2module is not working as expected
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4745
> 
> This commit fixes the issue reported in the BZ4745.
> The wrmsr was always writing 0 to the higher 32 bits of the msr 
> register.
> This was due to a logical flaw in the code, where the input variable 
> of type unsigned int was left shitted by 32 bits without explicitly 
> converting it to a 64 bit value.
> 
> The issue is with the below statement.
> data = vedx << 32 | veax;
> Where the vedx which is an unsigned int, after left shifting by 32 
> bits its value will be set to 0. Because of this the higher 32 bits of 
> the MSR are always set to 0. This has been fixed by this commit.
> 
> Cc: Rebecca Cran 
> Cc: Michael D Kinney 
> Cc: Jayaprakash N 
> Signed-off-by: Jayaprakash N 
> ---
>  .../Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c   | 3
> ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/AppPkg/Applications/Python/Python-3.6.8/PyMod-
> 3.6.8/Modules/edk2module.c b/AppPkg/Applications/Python/Python-
> 3.6.8/PyMod-3.6.8/Modules/edk2module.c
> index 8786df8..06bcf82 100644
> --- a/AppPkg/Applications/Python/Python-3.6.8/PyMod-
> 3.6.8/Modules/edk2module.c
> +++ b/AppPkg/Applications/Python/Python-3.6.8/PyMod-
> 3.6.8/Modules/edk2module.c
> @@ -3886,7 +3886,8 @@ edk2_wrmsr(PyObject *self, PyObject *args)
>UINT64   data = 0;
>if (!PyArg_ParseTuple(args, "III", &vecx, &veax, &vedx))
>  return NULL;
> -  data = vedx << 32 | veax;
> +  data = LShiftU64(vedx, 32);
> +  data = BitFieldOr64(data, 0, 31, veax);
>Py_BEGIN_ALLOW_THREADS
>AsmWriteMsr64(vecx, data);
>Py_END_ALLOW_THREADS
> --
> 2.44.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#118013): https://edk2.groups.io/g/devel/message/118013
Mute This Topic: https://groups.io/mt/105597214/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-libc Patch v3 0/1] wrmsr function is not working as expected

2024-04-19 Thread Jayaprakash, N
The wrmsr function always writes 0s to the higher 32 bits of the msr register.
This PR fixes this issue reported through the BZ4745

Jayaprakash N (1):
  ek2-libc: wrmsr function available in edk2module is not working as
expected

 .../Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c| 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.44.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#118011): https://edk2.groups.io/g/devel/message/118011
Mute This Topic: https://groups.io/mt/105614475/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-libc Patch v3 1/1] ek2-libc: wrmsr function available in edk2module is not working as expected

2024-04-19 Thread Jayaprakash, N
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4745

This commit fixes the issue reported in the BZ4745.
The wrmsr was always writing 0 to the higher 32 bits of the msr register.
This was due to a logical flaw in the code, where the input variable of
type unsigned int was left shitted by 32 bits without explicitly
converting it to a 64 bit value.

The issue is with the below statement.
data = vedx << 32 | veax;
Where the vedx which is an unsigned int, after left shifting by 32 bits
its value will be set to 0. Because of this the higher 32 bits of the MSR
are always set to 0. This has been fixed by this commit.

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Cc: Jayaprakash N 
Signed-off-by: Jayaprakash N 
---
 .../Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c| 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c 
b/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c
index d6af8da..f688b51 100644
--- a/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c
+++ b/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c
@@ -3886,7 +3886,7 @@ edk2_wrmsr(PyObject *self, PyObject *args)
   UINT64   data = 0;
   if (!PyArg_ParseTuple(args, "III", &vecx, &veax, &vedx))
 return NULL;
-  data = vedx << 32 | veax;
+  data = LShiftU64(vedx, 32) | veax;
   Py_BEGIN_ALLOW_THREADS
   AsmWriteMsr64(vecx, data);
   Py_END_ALLOW_THREADS
-- 
2.44.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#118012): https://edk2.groups.io/g/devel/message/118012
Mute This Topic: https://groups.io/mt/105614477/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-libc Patch 2 1/1] ek2-libc: wrmsr function available in edk2module is not working as expected

2024-04-18 Thread Jayaprakash, N
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4745

This commit fixes the issue reported in the BZ4745.
The wrmsr was always writing 0 to the higher 32 bits of the msr register.
This was due to a logical flaw in the code, where the input variable of
type unsigned int was left shitted by 32 bits without explicitly
converting it to a 64 bit value.

The issue is with the below statement.
data = vedx << 32 | veax;
Where the vedx which is an unsigned int, after left shifting by 32 bits
its value will be set to 0. Because of this the higher 32 bits of the MSR
are always set to 0. This has been fixed by this commit.

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Cc: Jayaprakash N 
Signed-off-by: Jayaprakash N 
---
 .../Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c 
b/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c
index 8786df8..06bcf82 100644
--- a/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c
+++ b/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c
@@ -3886,7 +3886,8 @@ edk2_wrmsr(PyObject *self, PyObject *args)
   UINT64   data = 0;
   if (!PyArg_ParseTuple(args, "III", &vecx, &veax, &vedx))
 return NULL;
-  data = vedx << 32 | veax;
+  data = LShiftU64(vedx, 32);
+  data = BitFieldOr64(data, 0, 31, veax);
   Py_BEGIN_ALLOW_THREADS
   AsmWriteMsr64(vecx, data);
   Py_END_ALLOW_THREADS
-- 
2.44.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117988): https://edk2.groups.io/g/devel/message/117988
Mute This Topic: https://groups.io/mt/105597214/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-libc Patch 2 0/1] wrmsr function is not working as expected.

2024-04-18 Thread Jayaprakash, N
The wrmsr function always writes 0s to the higher 32 bits of the msr register.
This PR fixes the this issue reported through the BZ4745.

Jayaprakash N (1):
  ek2-libc: wrmsr function available in edk2module is not working as
expected

 .../Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

-- 
2.44.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117987): https://edk2.groups.io/g/devel/message/117987
Mute This Topic: https://groups.io/mt/105597212/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc:add rdmsr_ex & wrmsr_ex functions to read/write cpu specific msrs

2024-04-17 Thread Jayaprakash, N
Thanks Mike. I shall make necessary changes and submit the PR again for review.

Regards,
JP

-Original Message-
From: Kinney, Michael D  
Sent: Thursday, April 18, 2024 10:46 AM
To: Jayaprakash, N ; devel@edk2.groups.io
Cc: Rebecca Cran ; Kinney, Michael D 

Subject: RE: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc:add rdmsr_ex & 
wrmsr_ex functions to read/write cpu specific msrs

Please use MP Services Protocol APIs StartupAllAPs() or StarupThisAP() to 
read/write MSRs on other logical processors.

There and many examples of this in the UefiCpuPkg to programming MSRs on all 
the logical processors.

Mike

> -Original Message-
> From: Jayaprakash, N 
> Sent: Wednesday, April 17, 2024 8:16 PM
> To: Kinney, Michael D ; 
> devel@edk2.groups.io
> Cc: Rebecca Cran 
> Subject: RE: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc:add rdmsr_ex 
> & wrmsr_ex functions to read/write cpu specific msrs
> 
> In the validation and debug scenarios, engineers tend to read MSRs and 
> write to MSRs of different CPUs.
> So we are providing a simple mechanism through these APIs to enable 
> them to do these operations.
> 
> These APIs will be part of the edk2 module of the Python interpreter 
> and will be used during the validation and debug scenarios only.
> 
> This is not for switching the BSP for OS boot. This is only used 
> during the validation and debug use cases.
> 
> Regards,
> JP
> -Original Message-
> From: Kinney, Michael D 
> Sent: Thursday, April 18, 2024 12:08 AM
> To: Jayaprakash, N ; devel@edk2.groups.io
> Cc: Rebecca Cran ; Kinney, Michael D 
> 
> Subject: RE: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc:add rdmsr_ex 
> & wrmsr_ex functions to read/write cpu specific msrs
> 
> Hi JP,
> 
> Is there a reason switch BSP is being used.  That is not a common 
> operation and is typically used if the current BSP is not stable or 
> there is a good reason to switch the BSP for OS boot.
> 
> The MP Services can be used to execute a C function on APs to execute 
> MSR related instructions.
> 
> Mike
> 
> > -Original Message-
> > From: Jayaprakash, N 
> > Sent: Sunday, April 14, 2024 10:33 PM
> > To: devel@edk2.groups.io; Jayaprakash, N 
> > Cc: Rebecca Cran ; Kinney, Michael D 
> > 
> > Subject: RE: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc:add
> rdmsr_ex
> > & wrmsr_ex functions to read/write cpu specific msrs
> >
> > + Rebecca and Mike,
> >
> > Would you be able to review this PR?
> >
> > Regards,
> > JP
> >
> > -Original Message-
> > From: devel@edk2.groups.io  On Behalf Of 
> > Jayaprakash, N
> > Sent: Wednesday, April 10, 2024 11:49 AM
> > To: devel@edk2.groups.io
> > Cc: Jayaprakash, N ; Rebecca Cran 
> > ; Kinney, Michael D 
> > Subject: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc:add rdmsr_ex & 
> > wrmsr_ex functions to read/write cpu specific msrs
> >
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4746
> >
> > The rdmsr_ex and wrmsr_ex are extension APIs to the rdmsr and wrmsr 
> > APIs supported in edk2 module. These extension APIs makes it
> possible
> > to read / write MSRs from specific processors and fills an existing 
> > gap in this area.
> >
> > Cc: Rebecca Cran 
> > Cc: Michael D Kinney 
> > Cc: Jayaprakash N 
> > Signed-off-by: Jayaprakash N 
> > ---
> >  .../PyMod-3.6.8/Modules/edk2module.c  | 159
> > +-
> >  .../Python/Python-3.6.8/Python368.inf |   3 +
> >  2 files changed, 158 insertions(+), 4 deletions(-)
> >
> > diff --git a/AppPkg/Applications/Python/Python-3.6.8/PyMod-
> > 3.6.8/Modules/edk2module.c b/AppPkg/Applications/Python/Python-
> > 3.6.8/PyMod-3.6.8/Modules/edk2module.c
> > index d6af8da..f1b13a6 100644
> > --- a/AppPkg/Applications/Python/Python-3.6.8/PyMod-
> > 3.6.8/Modules/edk2module.c
> > +++ b/AppPkg/Applications/Python/Python-3.6.8/PyMod-
> > 3.6.8/Modules/edk2mo
> > +++ dule.c
> > @@ -3,7 +3,7 @@
> >  Derived from posixmodule.c in Python 2.7.2.
> >
> >  Copyright (c) 2015, Daryl McDaniel. All rights reserved.
> > -Copyright (c) 2011 - 2023, Intel Corporation. All rights
> > reserved.
> > +Copyright (c) 2011 - 2024, Intel Corporation. All rights 
> > + reserved.
> >  This program and the accompanying materials are licensed and
> made
> > available under
> >  the terms and conditions of the BSD License that accompanies
> this
> > distribution.
> >  The full text of the license may be found at @@ -22,16 +22,23
> @@
> 

Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc:add rdmsr_ex & wrmsr_ex functions to read/write cpu specific msrs

2024-04-17 Thread Jayaprakash, N
In the validation and debug scenarios, engineers tend to read MSRs and write to 
MSRs of different CPUs.
So we are providing a simple mechanism through these APIs to enable them to do 
these operations.

These APIs will be part of the edk2 module of the Python interpreter and will 
be used during the validation and debug scenarios only.

This is not for switching the BSP for OS boot. This is only used during the 
validation and debug use cases.

Regards,
JP
-Original Message-
From: Kinney, Michael D  
Sent: Thursday, April 18, 2024 12:08 AM
To: Jayaprakash, N ; devel@edk2.groups.io
Cc: Rebecca Cran ; Kinney, Michael D 

Subject: RE: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc:add rdmsr_ex & 
wrmsr_ex functions to read/write cpu specific msrs

Hi JP,

Is there a reason switch BSP is being used.  That is not a common operation and 
is typically used if the current BSP is not stable or there is a good reason to 
switch the BSP for OS boot.

The MP Services can be used to execute a C function on APs to execute MSR 
related instructions.

Mike

> -Original Message-
> From: Jayaprakash, N 
> Sent: Sunday, April 14, 2024 10:33 PM
> To: devel@edk2.groups.io; Jayaprakash, N 
> Cc: Rebecca Cran ; Kinney, Michael D 
> 
> Subject: RE: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc:add rdmsr_ex 
> & wrmsr_ex functions to read/write cpu specific msrs
> 
> + Rebecca and Mike,
> 
> Would you be able to review this PR?
> 
> Regards,
> JP
> 
> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of 
> Jayaprakash, N
> Sent: Wednesday, April 10, 2024 11:49 AM
> To: devel@edk2.groups.io
> Cc: Jayaprakash, N ; Rebecca Cran 
> ; Kinney, Michael D 
> Subject: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc:add rdmsr_ex & 
> wrmsr_ex functions to read/write cpu specific msrs
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4746
> 
> The rdmsr_ex and wrmsr_ex are extension APIs to the rdmsr and wrmsr 
> APIs supported in edk2 module. These extension APIs makes it possible 
> to read / write MSRs from specific processors and fills an existing 
> gap in this area.
> 
> Cc: Rebecca Cran 
> Cc: Michael D Kinney 
> Cc: Jayaprakash N 
> Signed-off-by: Jayaprakash N 
> ---
>  .../PyMod-3.6.8/Modules/edk2module.c  | 159
> +-
>  .../Python/Python-3.6.8/Python368.inf |   3 +
>  2 files changed, 158 insertions(+), 4 deletions(-)
> 
> diff --git a/AppPkg/Applications/Python/Python-3.6.8/PyMod-
> 3.6.8/Modules/edk2module.c b/AppPkg/Applications/Python/Python-
> 3.6.8/PyMod-3.6.8/Modules/edk2module.c
> index d6af8da..f1b13a6 100644
> --- a/AppPkg/Applications/Python/Python-3.6.8/PyMod-
> 3.6.8/Modules/edk2module.c
> +++ b/AppPkg/Applications/Python/Python-3.6.8/PyMod-
> 3.6.8/Modules/edk2mo
> +++ dule.c
> @@ -3,7 +3,7 @@
>  Derived from posixmodule.c in Python 2.7.2.
> 
>  Copyright (c) 2015, Daryl McDaniel. All rights reserved.
> -Copyright (c) 2011 - 2023, Intel Corporation. All rights
> reserved.
> +Copyright (c) 2011 - 2024, Intel Corporation. All rights 
> + reserved.
>  This program and the accompanying materials are licensed and made 
> available under
>  the terms and conditions of the BSD License that accompanies this 
> distribution.
>  The full text of the license may be found at @@ -22,16 +22,23 @@ 
> #include#include#include  
> +#include// Needed for the definition of
> EFI_AP_PROCEDURE
>  #include  
>  #include  
>  #include  
>  #include  
> +#include  
> +#include  
> 
>  #ifdef __cplusplus
>  extern "C" {
>  #endif
> 
>  PyTypeObject EfiGuidType;
> +EFI_MP_SERVICES_PROTOCOL   *gpMpService = NULL;
> +UINTN   gBSPProcessorNumber = 0;
> +UINTN   gNumberOfProcessors = 0;
> +UINTN   gNumberOfEnabledProcessors = 0;
> 
>  extern void _swsmi( unsigned int smi_code_data, unsigned int 
> rax_value, unsigned int rbx_value, unsigned int rcx_value, unsigned 
> int rdx_value, unsigned int rsi_value, unsigned int rdi_value );  // -
> - Support routines @@ -169,6 +176,35 @@ PyDoc_STRVAR(edk2__doc__,
>  /* dummy version. _PyVerify_fd() is already defined in fileobject.h 
> */  #define _PyVerify_fd_dup2(A, B) (1)
> 
> +static EFI_STATUS
> +MpServicesWhoAmI (
> +  IN EFI_MP_SERVICES_PROTOCOL  *pMpService,
> +  OUT UINTN*pProcessorNumber
> +  )
> +{
> +  return pMpService->WhoAmI (pMpService, pProcessorNumber); }
> +
> +static EFI_STATUS
> +MpServicesGetNumberOfProcessors (
> +  IN EFI_MP_SERVICES_PROTOCOL  *pMpService,
> +  OUT UINTN*pNumberOfProcessors,
> +  OUT UINTN*pNumberOfEn

Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc:add rdmsr_ex & wrmsr_ex functions to read/write cpu specific msrs

2024-04-14 Thread Jayaprakash, N
+ Rebecca and Mike,

Would you be able to review this PR?

Regards,
JP

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Jayaprakash, N
Sent: Wednesday, April 10, 2024 11:49 AM
To: devel@edk2.groups.io
Cc: Jayaprakash, N ; Rebecca Cran ; 
Kinney, Michael D 
Subject: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc:add rdmsr_ex & wrmsr_ex 
functions to read/write cpu specific msrs

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

The rdmsr_ex and wrmsr_ex are extension APIs to the rdmsr and wrmsr APIs 
supported in edk2 module. These extension APIs makes it possible to read / 
write MSRs from specific processors and fills an existing gap in this area.

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Cc: Jayaprakash N 
Signed-off-by: Jayaprakash N 
---
 .../PyMod-3.6.8/Modules/edk2module.c  | 159 +-
 .../Python/Python-3.6.8/Python368.inf |   3 +
 2 files changed, 158 insertions(+), 4 deletions(-)

diff --git 
a/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c 
b/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c
index d6af8da..f1b13a6 100644
--- a/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c
+++ b/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2mo
+++ dule.c
@@ -3,7 +3,7 @@
 Derived from posixmodule.c in Python 2.7.2.
 
 Copyright (c) 2015, Daryl McDaniel. All rights reserved.
-Copyright (c) 2011 - 2023, Intel Corporation. All rights reserved.
+Copyright (c) 2011 - 2024, Intel Corporation. All rights 
+ reserved.
 This program and the accompanying materials are licensed and made 
available under
 the terms and conditions of the BSD License that accompanies this 
distribution.
 The full text of the license may be found at @@ -22,16 +22,23 @@  #include 
   #include#include  
+#include// Needed for the definition of EFI_AP_PROCEDURE
 #include  
 #include  
 #include  
 #include  
+#include  
+#include  
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 PyTypeObject EfiGuidType;
+EFI_MP_SERVICES_PROTOCOL   *gpMpService = NULL;
+UINTN   gBSPProcessorNumber = 0;
+UINTN   gNumberOfProcessors = 0;
+UINTN   gNumberOfEnabledProcessors = 0;
 
 extern void _swsmi( unsigned int smi_code_data, unsigned int rax_value, 
unsigned int rbx_value, unsigned int rcx_value, unsigned int rdx_value, 
unsigned int rsi_value, unsigned int rdi_value );  // -- Support routines @@ 
-169,6 +176,35 @@ PyDoc_STRVAR(edk2__doc__,
 /* dummy version. _PyVerify_fd() is already defined in fileobject.h */  
#define _PyVerify_fd_dup2(A, B) (1)
 
+static EFI_STATUS
+MpServicesWhoAmI (
+  IN EFI_MP_SERVICES_PROTOCOL  *pMpService,
+  OUT UINTN*pProcessorNumber
+  )
+{
+  return pMpService->WhoAmI (pMpService, pProcessorNumber); }
+
+static EFI_STATUS
+MpServicesGetNumberOfProcessors (
+  IN EFI_MP_SERVICES_PROTOCOL  *pMpService,
+  OUT UINTN*pNumberOfProcessors,
+  OUT UINTN*pNumberOfEnabledProcessors
+
+  )
+{
+  return pMpService->GetNumberOfProcessors (pMpService, 
+pNumberOfProcessors, pNumberOfEnabledProcessors); }
+
+static EFI_STATUS
+MpServicesSwitchBSP (
+  IN EFI_MP_SERVICES_PROTOCOL  *pMpService,
+  IN UINTN  ProcessorNumber
+  )
+{
+  return pMpService->SwitchBSP(pMpService,  ProcessorNumber, TRUE); }
+
 #ifndef UEFI_C_SOURCE
 /* Return a dictionary corresponding to the POSIX environment table */  extern 
char **environ; @@ -3865,6 +3901,56 @@ edk2_rdmsr(PyObject *self, PyObject 
*args)
   return Py_BuildValue("(II)", (unsigned long)veax, (unsigned long)vedx);  }
 
+PyDoc_STRVAR(efi_rdmsr_ex__doc__,
+"rdmsr_ex(cpu, msr) -> (lower_32bits, higher_32bits)\n\ \n\ Read the 
+given msr by switching to cpu and return the data as tuple.\n\ \n\ 
+Parameters:\n\
+cpu - The cpu number in hex or int format\n\
+msr - The msr in hex or int format\n\ \n\ Return Value:\n\
+a tuple with lower and higher 32 bit values read from the msr\n\ 
+");
+
+static PyObject *
+edk2_rdmsr_ex(PyObject *self, PyObject *args) {
+  unsigned int cpu, vecx, veax, vedx;
+  unsigned int bsp_switched = 0;
+  EFI_STATUS status = 0;
+  UINT64   data = 0;
+
+  if (!PyArg_ParseTuple(args, "II", &cpu, &vecx))
+return NULL;
+
+  Py_BEGIN_ALLOW_THREADS
+  if (cpu != gBSPProcessorNumber && cpu < gNumberOfProcessors)  {
+//switch the BSP to the cpu
+status = MpServicesSwitchBSP(gpMpService, cpu);
+if (!EFI_ERROR(status))
+{
+bsp_switched = 1;
+}
+  }
+
+  data = AsmReadMsr64(vecx);
+
+  if (bsp_switched)
+  {
+// switch BSP to the saved BSP processor
+MpServicesSwitchBSP(gpMpService, gBSPProcessorNumber);
+// update the saved BSP processor
+MpServicesWhoAmI(gpMpService, &gBSPProcessorNumber);
+  }
+  Py_END_ALLOW_THREADS
+  veax = (UINT3

[edk2-devel] [edk2-libc Patch 1/1] edk2-libc:add rdmsr_ex & wrmsr_ex functions to read/write cpu specific msrs

2024-04-09 Thread Jayaprakash, N
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4746

The rdmsr_ex and wrmsr_ex are extension APIs to the rdmsr and wrmsr APIs
supported in edk2 module. These extension APIs makes it possible
to read / write MSRs from specific processors and fills an existing gap
in this area.

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Cc: Jayaprakash N 
Signed-off-by: Jayaprakash N 
---
 .../PyMod-3.6.8/Modules/edk2module.c  | 159 +-
 .../Python/Python-3.6.8/Python368.inf |   3 +
 2 files changed, 158 insertions(+), 4 deletions(-)

diff --git 
a/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c 
b/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c
index d6af8da..f1b13a6 100644
--- a/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c
+++ b/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c
@@ -3,7 +3,7 @@
 Derived from posixmodule.c in Python 2.7.2.
 
 Copyright (c) 2015, Daryl McDaniel. All rights reserved.
-Copyright (c) 2011 - 2023, Intel Corporation. All rights reserved.
+Copyright (c) 2011 - 2024, Intel Corporation. All rights reserved.
 This program and the accompanying materials are licensed and made 
available under
 the terms and conditions of the BSD License that accompanies this 
distribution.
 The full text of the license may be found at
@@ -22,16 +22,23 @@
 #include  
 #include  
 #include  
+#include// Needed for the definition of EFI_AP_PROCEDURE
 #include  
 #include  
 #include  
 #include  
+#include  
+#include  
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 PyTypeObject EfiGuidType;
+EFI_MP_SERVICES_PROTOCOL   *gpMpService = NULL;
+UINTN   gBSPProcessorNumber = 0;
+UINTN   gNumberOfProcessors = 0;
+UINTN   gNumberOfEnabledProcessors = 0;
 
 extern void _swsmi( unsigned int smi_code_data, unsigned int rax_value, 
unsigned int rbx_value, unsigned int rcx_value, unsigned int rdx_value, 
unsigned int rsi_value, unsigned int rdi_value );
 // -- Support routines
@@ -169,6 +176,35 @@ PyDoc_STRVAR(edk2__doc__,
 /* dummy version. _PyVerify_fd() is already defined in fileobject.h */
 #define _PyVerify_fd_dup2(A, B) (1)
 
+static EFI_STATUS
+MpServicesWhoAmI (
+  IN EFI_MP_SERVICES_PROTOCOL  *pMpService,
+  OUT UINTN*pProcessorNumber
+  )
+{
+  return pMpService->WhoAmI (pMpService, pProcessorNumber);
+}
+
+static EFI_STATUS
+MpServicesGetNumberOfProcessors (
+  IN EFI_MP_SERVICES_PROTOCOL  *pMpService,
+  OUT UINTN*pNumberOfProcessors,
+  OUT UINTN*pNumberOfEnabledProcessors
+
+  )
+{
+  return pMpService->GetNumberOfProcessors (pMpService, pNumberOfProcessors, 
pNumberOfEnabledProcessors);
+}
+
+static EFI_STATUS
+MpServicesSwitchBSP (
+  IN EFI_MP_SERVICES_PROTOCOL  *pMpService,
+  IN UINTN  ProcessorNumber
+  )
+{
+  return pMpService->SwitchBSP(pMpService,  ProcessorNumber, TRUE);
+}
+
 #ifndef UEFI_C_SOURCE
 /* Return a dictionary corresponding to the POSIX environment table */
 extern char **environ;
@@ -3865,6 +3901,56 @@ edk2_rdmsr(PyObject *self, PyObject *args)
   return Py_BuildValue("(II)", (unsigned long)veax, (unsigned long)vedx);
 }
 
+PyDoc_STRVAR(efi_rdmsr_ex__doc__,
+"rdmsr_ex(cpu, msr) -> (lower_32bits, higher_32bits)\n\
+\n\
+Read the given msr by switching to cpu and return the data as tuple.\n\
+\n\
+Parameters:\n\
+cpu - The cpu number in hex or int format\n\
+msr - The msr in hex or int format\n\
+\n\
+Return Value:\n\
+a tuple with lower and higher 32 bit values read from the msr\n\
+");
+
+static PyObject *
+edk2_rdmsr_ex(PyObject *self, PyObject *args)
+{
+  unsigned int cpu, vecx, veax, vedx;
+  unsigned int bsp_switched = 0;
+  EFI_STATUS status = 0;
+  UINT64   data = 0;
+
+  if (!PyArg_ParseTuple(args, "II", &cpu, &vecx))
+return NULL;
+
+  Py_BEGIN_ALLOW_THREADS
+  if (cpu != gBSPProcessorNumber && cpu < gNumberOfProcessors)
+  {
+//switch the BSP to the cpu
+status = MpServicesSwitchBSP(gpMpService, cpu);
+if (!EFI_ERROR(status))
+{
+bsp_switched = 1;
+}
+  }
+
+  data = AsmReadMsr64(vecx);
+
+  if (bsp_switched)
+  {
+// switch BSP to the saved BSP processor
+MpServicesSwitchBSP(gpMpService, gBSPProcessorNumber);
+// update the saved BSP processor
+MpServicesWhoAmI(gpMpService, &gBSPProcessorNumber);
+  }
+  Py_END_ALLOW_THREADS
+  veax = (UINT32)data;
+  vedx = (UINT64)data >> 32;
+  return Py_BuildValue("(II)", (unsigned long)veax, (unsigned long)vedx);
+}
+
 PyDoc_STRVAR(efi_wrmsr__doc__,
 "wrmsr(msr, lower_32bits, higher_32bits) -> None\n\
 \n\
@@ -3889,6 +3975,58 @@ edk2_wrmsr(PyObject *self, PyObject *args)
   data = vedx << 32 | veax;
   Py_BEGIN_ALLOW_THREADS
   AsmWriteMsr64(vecx, data);
+  Py_END_ALLOW_THRE

[edk2-devel] [edk2-libc Patch 0/1] add rdmsr_ex & wrmsr_ex functions to read/write msrs from specific cpu

2024-04-09 Thread Jayaprakash, N
This patch adds 2 new functions to read and write msrs from specific CPUs.
rdmsr_ex and wrmsr_ex are the 2 new functions added into edk2module to
provide the read and write of CPU specific MSRs.

Jayaprakash N (1):
  edk2-libc:add rdmsr_ex & wrmsr_ex functions to read/write cpu specific
msrs

 .../PyMod-3.6.8/Modules/edk2module.c  | 159 +-
 .../Python/Python-3.6.8/Python368.inf |   3 +
 2 files changed, 158 insertions(+), 4 deletions(-)

-- 
2.40.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117569): https://edk2.groups.io/g/devel/message/117569
Mute This Topic: https://groups.io/mt/105437324/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: wrmsr function available in edk2module is not working as expected

2024-04-09 Thread Jayaprakash, N
Reviewed-by : Jayaprakash N

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Jayaprakash, N
Sent: Thursday, April 4, 2024 3:14 PM
To: devel@edk2.groups.io
Cc: Jayaprakash, N ; Rebecca Cran ; 
Kinney, Michael D 
Subject: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: wrmsr function available 
in edk2module is not working as expected

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

This commit fixes the issue reported in the BZ4745.
The wrmsr function was always writing 0 to the higher 32 bits of the msr 
register. This was due to a logical flaw in the code, where the input variable 
of type unsigned int was left shitted by 32 bits without explicitly converting 
to a 64 bit value.

Problematic statement in the function edk2_wrmsr code:
data = vedx << 32 | veax;
Where the vedx an unsigned int, after left shifting by 32 bits its value will 
be set to 0. Because of this the higher 32 bits of the MSR are always set to 0. 
This statement has been modified as below:
  data = (((UINT64)vedx) << 32) | veax;
Verified the function by making this change and could see that the wrmsr is 
working as expected.

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Cc: Jayaprakash N 
Signed-off-by: Jayaprakash N 
---
 .../Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c| 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c 
b/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c
index d6af8da..cec4332 100644
--- a/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c
+++ b/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2mo
+++ dule.c
@@ -3886,7 +3886,7 @@ edk2_wrmsr(PyObject *self, PyObject *args)
   UINT64   data = 0;
   if (!PyArg_ParseTuple(args, "III", &vecx, &veax, &vedx))
 return NULL;
-  data = vedx << 32 | veax;
+  data = (((UINT64)vedx) << 32) | veax;
   Py_BEGIN_ALLOW_THREADS
   AsmWriteMsr64(vecx, data);
   Py_END_ALLOW_THREADS
--
2.40.0.windows.1








-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117568): https://edk2.groups.io/g/devel/message/117568
Mute This Topic: https://groups.io/mt/105437258/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-libc Patch 0/1] wrmsr function is not working as expected.

2024-04-04 Thread Jayaprakash, N
The wrmsr function always writes 0s to the higher 32 bits of the msr register.
This issue has been fixed by this PR.

Jayaprakash N (1):
  edk2-libc: wrmsr function available in edk2module is not working as
expected

 .../Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c| 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.40.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117420): https://edk2.groups.io/g/devel/message/117420
Mute This Topic: https://groups.io/mt/105325842/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-libc Patch 1/1] edk2-libc: wrmsr function available in edk2module is not working as expected

2024-04-04 Thread Jayaprakash, N
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4745

This commit fixes the issue reported in the BZ4745.
The wrmsr function was always writing 0 to the higher 32 bits of
the msr register. This was due to a logical flaw in the code,
where the input variable of type unsigned int was left shitted
by 32 bits without explicitly converting to a 64 bit value.

Problematic statement in the function edk2_wrmsr code:
data = vedx << 32 | veax;
Where the vedx an unsigned int, after left shifting by 32 bits its value
will be set to 0. Because of this the higher 32 bits of the MSR are
always set to 0. This statement has been modified as below:
  data = (((UINT64)vedx) << 32) | veax;
Verified the function by making this change and could see that
the wrmsr is working as expected.

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Cc: Jayaprakash N 
Signed-off-by: Jayaprakash N 
---
 .../Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c| 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c 
b/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c
index d6af8da..cec4332 100644
--- a/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c
+++ b/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c
@@ -3886,7 +3886,7 @@ edk2_wrmsr(PyObject *self, PyObject *args)
   UINT64   data = 0;
   if (!PyArg_ParseTuple(args, "III", &vecx, &veax, &vedx))
 return NULL;
-  data = vedx << 32 | veax;
+  data = (((UINT64)vedx) << 32) | veax;
   Py_BEGIN_ALLOW_THREADS
   AsmWriteMsr64(vecx, data);
   Py_END_ALLOW_THREADS
-- 
2.40.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117421): https://edk2.groups.io/g/devel/message/117421
Mute This Topic: https://groups.io/mt/105325843/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-libc Patch 1/1] ek2-libc: writeio function in edk2module.c not working as expected

2023-12-09 Thread Jayaprakash, N
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4619

This commit fixes the issue reported in the BZ4619.
The order of passing the parameters to IoWrite* functions
called within writeio function in edk2module.c has been corrected
Also verified the changes by writing reset command to 0xCF9 port
using writeio function in edk2module.c

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Cc: Jayaprakash N 
Signed-off-by: Jayaprakash N 
---
 .../Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c| 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c 
b/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c
index 8786df8..d6af8da 100644
--- a/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c
+++ b/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c
@@ -3985,9 +3985,9 @@ edk2_writeio(PyObject *self, PyObject *args)
 
   Py_BEGIN_ALLOW_THREADS
   addrs = (short)(addr & 0x);
-  if (1 == sz) IoWrite8((unsigned char)(value & 0xFF), addrs);
-  else if (2 == sz) IoWrite16((unsigned short)(value & 0x), addrs);
-  else if (4 == sz) IoWrite32(value, addrs);
+  if (1 == sz) IoWrite8(addrs, (unsigned char)(value & 0xFF));
+  else if (2 == sz) IoWrite16(addrs, (unsigned short)(value & 0x));
+  else if (4 == sz) IoWrite32(addrs, value);
   Py_END_ALLOW_THREADS
 
   Py_INCREF(Py_None);
-- 
2.40.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#112254): https://edk2.groups.io/g/devel/message/112254
Mute This Topic: https://groups.io/mt/103077058/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-libc Patch 0/1] writeio() edk2module not working as expected

2023-12-09 Thread Jayaprakash, N
This commit fixes the issue reported in BZ4619.
The writeio() function in edk2module.c in
edk2-libc/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules
which uses IoWrite* functions was passing the parameters in incorrect
order. This has been fixed.

Jayaprakash N (1):
  ek2-libc: writeio function in edk2module.c not working as expected

 .../Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c| 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

-- 
2.40.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#112253): https://edk2.groups.io/g/devel/message/112253
Mute This Topic: https://groups.io/mt/103077057/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc/StdLib: Fixed typo issues in multiple files

2023-11-24 Thread Jayaprakash, N
Reviewed-by : Jayaprakash Nevara 

-Original Message-
From: R, Vishal  
Sent: Friday, November 24, 2023 4:41 PM
To: devel@edk2.groups.io
Cc: R, Vishal ; Rebecca Cran ; Kinney, 
Michael D ; Jayaprakash, N 
Subject: [edk2-libc Patch 1/1] edk2-libc/StdLib: Fixed typo issues in multiple 
files

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

This commit fixes the various typo issues found in documentation strings in 
multiple files issue reported via the BZ4579 These changes are documentation 
updates only and does not affect the functionality of the code

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Cc: Jayaprakash N 
Signed-off-by: Vishal R 
---
 StdLib/BsdSocketLib/ns_addr.c  |  4 ++--
 StdLib/BsdSocketLib/res_comp.c |  2 +-
 StdLib/BsdSocketLib/res_config.h   |  2 +-
 StdLib/BsdSocketLib/res_init.c |  2 +-
 StdLib/Include/arpa/telnet.h   |  2 +-
 StdLib/Include/errno.h |  2 +-
 StdLib/Include/locale.h|  2 +-
 StdLib/Include/net/if.h|  8 
 StdLib/Include/netns/ns.h  |  2 +-
 StdLib/Include/stdio.h |  2 +-
 StdLib/Include/stdlib.h|  6 +++---
 StdLib/Include/sys/termios.h   | 14 +++---
 StdLib/Include/sys/wait.h  |  2 +-
 StdLib/LibC/Main/Arm/flt_rounds.c  |  2 +-
 StdLib/LibC/StdLib/realpath.c  |  2 +-
 StdLib/LibC/Stdio/vfscanf.c|  2 +-
 StdLib/LibC/Uefi/InteractiveIO/TerminalFunctions.c |  8 
 StdLib/LibC/Uefi/SysCalls.c|  8 
 StdLib/LibC/Wchar/String.c |  2 +-
 StdLib/LibC/gdtoa/gdtoaimp.h   |  2 +-
 StdLib/PosixLib/Gen/dirname.c  |  2 +-
 21 files changed, 39 insertions(+), 39 deletions(-)

diff --git a/StdLib/BsdSocketLib/ns_addr.c b/StdLib/BsdSocketLib/ns_addr.c 
index 4360b0c..36fe379 100644
--- a/StdLib/BsdSocketLib/ns_addr.c
+++ b/StdLib/BsdSocketLib/ns_addr.c
@@ -72,9 +72,9 @@ ns_addr(
 
   /*
* First, figure out what he intends as a field separtor.
-   * Despite the way this routine is written, the prefered
+   * Despite the way this routine is written, the preferred
* form  2-272.AA001234H.01777, i.e. XDE standard.
-   * Great efforts are made to insure backward compatability.
+   * Great efforts are made to insure backward compatibility.
*/
   if ((hostname = strchr(buf, '#')) != NULL)
 separator = '#';
diff --git a/StdLib/BsdSocketLib/res_comp.c b/StdLib/BsdSocketLib/res_comp.c 
index 7c327fa..8e52e32 100644
--- a/StdLib/BsdSocketLib/res_comp.c
+++ b/StdLib/BsdSocketLib/res_comp.c
@@ -108,7 +108,7 @@ static char rcsid[] = "$Id: res_comp.c,v 1.1.1.1 2003/11/19 
01:51:35 kyu3 Exp $"
 
 /*
  * Expand compressed domain name 'comp_dn' to full domain name.
- * 'msg' is a pointer to the begining of the message,
+ * 'msg' is a pointer to the beginning of the message,
  * 'eomorig' points to the first location after the message,
  * 'exp_dn' is a pointer to a buffer of size 'length' for the result.
  * Return size of compressed name or -1 if there was an error.
diff --git a/StdLib/BsdSocketLib/res_config.h b/StdLib/BsdSocketLib/res_config.h
index 4f4afdf..e3128e1 100644
--- a/StdLib/BsdSocketLib/res_config.h
+++ b/StdLib/BsdSocketLib/res_config.h
@@ -1,6 +1,6 @@
 #define DEBUG   1   /* enable debugging code (needed for dig) */
 #define RESOLVSORT  /* allow sorting of addresses in gethostbyname */
-#define RFC1535 /* comply with RFC1535 (STRONGLY reccomended by vixie)*/
+#define RFC1535 /* comply with RFC1535 (STRONGLY recommended by vixie)*/
 #undef  USELOOPBACK /* res_init() bind to localhost */  #undef  SUNSECURITY /* 
verify gethostbyaddr() calls - WE DONT NEED IT  */  #define 
MULTI_PTRS_ARE_ALIASES 1 /* fold multiple PTR records into aliases */ diff 
--git a/StdLib/BsdSocketLib/res_init.c b/StdLib/BsdSocketLib/res_init.c index 
9df7d4f..449cb17 100644
--- a/StdLib/BsdSocketLib/res_init.c
+++ b/StdLib/BsdSocketLib/res_init.c
@@ -134,7 +134,7 @@ struct __res_state _res
  * there will have precedence.  Otherwise, the server address is set to
  * INADDR_ANY and the default domain name comes from the gethostname().
  *
- * An interrim version of this code (BIND 4.9, pre-4.4BSD) used 127.0.0.1
+ * An interim version of this code (BIND 4.9, pre-4.4BSD) used 
+ 127.0.0.1
  * rather than INADDR_ANY ("0.0.0.0") as the default name server address
  * since it was noted that INADDR_ANY actually meant ``the first interface
  * you "ifconfig"'d at boot time'' and if this was a SLIP or PPP interface, 
diff --git a/StdLib/Include/arpa/telnet.h b/StdLib/Include/arpa/telnet.h 

Re: [edk2-devel] [edk2-libc Patch 1/1] ek2-libc: Sample python scripts for socket client capabilities on UEFI shell

2023-11-10 Thread Jayaprakash, N
These are simple Python apps to demonstrate the usage of socket communication 
using the HTTP library. 
Reviewed-by : Jayaprakash N 

Regards,
JP
-Original Message-
From: devel@edk2.groups.io  On Behalf Of Jayaprakash, N
Sent: Friday, October 27, 2023 9:57 PM
To: devel@edk2.groups.io
Cc: Jayaprakash, N ; Rebecca Cran ; 
Kinney, Michael D 
Subject: [edk2-devel] [edk2-libc Patch 1/1] ek2-libc: Sample python scripts for 
socket client capabilities on UEFI shell

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

This BZ has been created to provide the sample python scripts to demonstrate 
the socket client capabilities using http library on UEFI shell with the help 
of Python UEFI interpreter.
The http_echo_client.py and http_echo_server.py scripts are provided as sample 
scripts to exercise the python http library from UEFI shell.

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Cc: Jayaprakash N 
Signed-off-by: Jayaprakash Nevara 
---
 .../PyMod-3.6.8/Lib/http_echo_client.py   | 81 +++
 .../PyMod-3.6.8/Lib/http_echo_server.py   | 61 ++
 2 files changed, 142 insertions(+)
 create mode 100644 
AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Lib/http_echo_client.py
 create mode 100644 
AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Lib/http_echo_server.py

diff --git 
a/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Lib/http_echo_client.py 
b/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Lib/http_echo_client.py
new file mode 100644
index 000..ea0368d
--- /dev/null
+++ b/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Lib/http_echo_
+++ client.py
@@ -0,0 +1,81 @@
+"""
+This is a sample HTTP echo client sends data to the server and gets 
+echoed data from the server in response body and prints the same to the 
+console.
+
+Note: This application needs to be run from UEFI shell using the Python 
+UEFI interpreter.
+"""
+
+import sys
+import time
+from http import client
+from http.client import HTTPException
+import traceback
+
+_max_retries = 10
+_retry_count = 0
+
+
+def _print_usage():
+print("Sample http echo client application")
+print("Usage:")
+print("python.efi http_echo_client.py ")
+
+
+if len(sys.argv) != 2:
+_print_usage()
+sys.exit(0)
+
+if sys.argv[1] == "-h":
+_print_usage()
+sys.exit(0)
+
+http_server = sys.argv[1]
+while True:
+try:
+name = input("Enter the parameter name:")
+value = input("Enter parameter value:")
+print("Connecting to server to send a get request with following 
parameter")
+print("{}={}".format(name, value))
+# replace space with %20
+value = value.replace(" ", "%20")
+conn = client.HTTPConnection(http_server)
+# Send GET request with some data
+conn.request("GET", "/echo?{}={}".format(name, value))
+rsp = conn.getresponse()
+if rsp.status == 204:
+print("No content")
+break
+elif rsp.status == 200:
+data_received = rsp.read()
+# replace %20 with space character before displaying to console
+data_received = data_received.replace(b"%20", b" ")
+print("from server:{}".format(data_received))
+conn.close()
+print("Closing the connection")
+break
+else:
+print("Invalid response code {}".format(rsp.status))
+conn.close()
+print("Closing the connection")
+break
+except HTTPException as exp:
+print("Got exception while connecting to server : {}".format(exp))
+traceback.print_exc()
+break
+except ConnectionRefusedError as exp:
+print("Got exception while connecting to server : {}".format(exp))
+print("Check & start the server, if it is not started")
+print(
+"Retrying connection after 10 seconds, retry count = {}".format(
+_retry_count + 1
+)
+)
+if _retry_count == _max_retries:
+print(
+"Exceeded max retries {} exiting the 
application".format(_max_retries)
+)
+break
+time.sleep(10)
+_retry_count += 1
diff --git 
a/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Lib/http_echo_server.py 
b/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Lib/http_echo_server.py
new file mode 100644
index 000..eebdf33
--- /dev/null
+++ b/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Lib/http_echo_
+++ server.py
@@ -0,0 +1,61 @@
+"""
+This is a sample HTTP echo server that echos the command / data coming 
+from the client.
+Here the data is received from client thro

[edk2-devel] [edk2-libc Patch 1/1] ek2-libc: Sample python scripts for socket client capabilities on UEFI shell

2023-10-27 Thread Jayaprakash, N
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4580

This BZ has been created to provide the sample python scripts
to demonstrate the socket client capabilities using http library
on UEFI shell with the help of Python UEFI interpreter.
The http_echo_client.py and http_echo_server.py scripts
are provided as sample scripts to exercise the python http library
from UEFI shell.

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Cc: Jayaprakash N 
Signed-off-by: Jayaprakash Nevara 
---
 .../PyMod-3.6.8/Lib/http_echo_client.py   | 81 +++
 .../PyMod-3.6.8/Lib/http_echo_server.py   | 61 ++
 2 files changed, 142 insertions(+)
 create mode 100644 
AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Lib/http_echo_client.py
 create mode 100644 
AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Lib/http_echo_server.py

diff --git 
a/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Lib/http_echo_client.py 
b/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Lib/http_echo_client.py
new file mode 100644
index 000..ea0368d
--- /dev/null
+++ 
b/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Lib/http_echo_client.py
@@ -0,0 +1,81 @@
+"""
+This is a sample HTTP echo client sends data to the server
+and gets echoed data from the server in response body 
+and prints the same to the console.
+
+Note: This application needs to be run from UEFI shell using
+the Python UEFI interpreter.
+"""
+
+import sys
+import time
+from http import client
+from http.client import HTTPException
+import traceback
+
+_max_retries = 10
+_retry_count = 0
+
+
+def _print_usage():
+print("Sample http echo client application")
+print("Usage:")
+print("python.efi http_echo_client.py ")
+
+
+if len(sys.argv) != 2:
+_print_usage()
+sys.exit(0)
+
+if sys.argv[1] == "-h":
+_print_usage()
+sys.exit(0)
+
+http_server = sys.argv[1]
+while True:
+try:
+name = input("Enter the parameter name:")
+value = input("Enter parameter value:")
+print("Connecting to server to send a get request with following 
parameter")
+print("{}={}".format(name, value))
+# replace space with %20
+value = value.replace(" ", "%20")
+conn = client.HTTPConnection(http_server)
+# Send GET request with some data
+conn.request("GET", "/echo?{}={}".format(name, value))
+rsp = conn.getresponse()
+if rsp.status == 204:
+print("No content")
+break
+elif rsp.status == 200:
+data_received = rsp.read()
+# replace %20 with space character before displaying to console
+data_received = data_received.replace(b"%20", b" ")
+print("from server:{}".format(data_received))
+conn.close()
+print("Closing the connection")
+break
+else:
+print("Invalid response code {}".format(rsp.status))
+conn.close()
+print("Closing the connection")
+break
+except HTTPException as exp:
+print("Got exception while connecting to server : {}".format(exp))
+traceback.print_exc()
+break
+except ConnectionRefusedError as exp:
+print("Got exception while connecting to server : {}".format(exp))
+print("Check & start the server, if it is not started")
+print(
+"Retrying connection after 10 seconds, retry count = {}".format(
+_retry_count + 1
+)
+)
+if _retry_count == _max_retries:
+print(
+"Exceeded max retries {} exiting the 
application".format(_max_retries)
+)
+break
+time.sleep(10)
+_retry_count += 1
diff --git 
a/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Lib/http_echo_server.py 
b/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Lib/http_echo_server.py
new file mode 100644
index 000..eebdf33
--- /dev/null
+++ 
b/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Lib/http_echo_server.py
@@ -0,0 +1,61 @@
+"""
+This is a sample HTTP echo server that echos the command / data
+coming from the client.
+Here the data is received from client through GET request in the 
+form of parameter of GET request.
+The parameter is extracted and sent back to the client 
+in the response body.
+
+Note that this server sample application needs to be run 
+on a system booted to OS. 
+"""
+
+import os
+import socket
+import sys
+from http.server import BaseHTTPRequestHandler, HTTPServer
+from http.client import parse_headers
+
+
+class MyHTTPRequestHandler(BaseHTTPRequestHandler):
+"""HTTP request ha

[edk2-devel] [edk2-libc Patch 0/1] AppPkg/Python - Sample scripts to exercise socket functionality

2023-10-27 Thread Jayaprakash, N
This commit provides 2 sample scripts namely
http_echo_client.py and http_echo_server.py to exercise the 
socket capabilities on UEFI shell using the http library from Python UEFI
interpreter.

Jayaprakash N (1):
  ek2-libc: Sample python scripts for socket client capabilities on UEFI
shell

 .../PyMod-3.6.8/Lib/http_echo_client.py   | 81 +++
 .../PyMod-3.6.8/Lib/http_echo_server.py   | 61 ++
 2 files changed, 142 insertions(+)
 create mode 100644 
AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Lib/http_echo_client.py
 create mode 100644 
AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Lib/http_echo_server.py

-- 
2.40.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#110221): https://edk2.groups.io/g/devel/message/110221
Mute This Topic: https://groups.io/mt/102224954/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-libc Patch 0/1] fix missing nanf definition in StdLib

2023-10-26 Thread Jayaprakash, N
Reviewed-by : Jayaprakash Nevara 

Regards,
JP

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Jayaprakash, N
Sent: Thursday, October 26, 2023 9:00 PM
To: devel@edk2.groups.io
Cc: Jayaprakash, N 
Subject: [edk2-devel] [edk2-libc Patch 0/1] fix missing nanf definition in 
StdLib

This patch fixes the issue of missing definition of nanf in StdLib.
This has been extracted from the below PR submitted on edk2-libc.
https://github.com/tianocore/edk2-libc/pull/9

Jayaprakash N (1):
  ek2-libc: fix missing nanf definition in StdLib

 StdLib/LibC/LibC.inf|  1 +
 StdLib/LibC/Main/nanf_ieee754.c | 15 +++
 2 files changed, 16 insertions(+)
 create mode 100644 StdLib/LibC/Main/nanf_ieee754.c

-- 
2.40.0.windows.1








-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#110180): https://edk2.groups.io/g/devel/message/110180
Mute This Topic: https://groups.io/mt/102202278/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-libc Patch 1/1] ek2-libc: realpath function signature doesn't match the standard

2023-10-26 Thread Jayaprakash, N
Reviewed-by: Jayaprakash Nevara 
It's simple fix to align the function signature as per the standards.

Regards,
JP
-Original Message-
From: Jayaprakash, N  
Sent: Thursday, October 26, 2023 7:47 PM
To: devel@edk2.groups.io
Cc: Jayaprakash, N ; Rebecca Cran ; 
Kinney, Michael D ; Kloper, Dimitry 

Subject: [edk2-libc Patch 1/1] ek2-libc: realpath function signature doesn't 
match the standard

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

This commit is for processing the below PR on edk2-libc repo
https://github.com/tianocore/edk2-libc/pull/10
The realpath function signature in stdlib of edk2-libc doesn't match signature 
as per the standard definition of this function given below 
https://pubs.opengroup.org/onlinepubs/009695399/functions/realpath.html
This patch extracted from the above pull request fixes this issue.

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Cc: Jayaprakash N 
Signed-off-by: Kloper Dimitry 
---
 StdLib/Include/stdlib.h   | 4 ++--
 StdLib/LibC/StdLib/realpath.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/StdLib/Include/stdlib.h b/StdLib/Include/stdlib.h index 
0b9dfd3..022ddbd 100644
--- a/StdLib/Include/stdlib.h
+++ b/StdLib/Include/stdlib.h
@@ -74,7 +74,7 @@
const wchar_t * __restrict src, size_t limit);
 
   Miscelaneous functions for *nix compatibility
-char   *realpath(char *file_name, char *resolved_name);
+char   *realpath(const char *file_name, char *resolved_name);
 const char *getprogname (void);
 voidsetprogname (const char *progname);
 
@@ -875,7 +875,7 @@ size_t  wcstombs(char * __restrict Dest, const wchar_t * 
__restrict Src, size_t
 @retval NULLAn error occured.
 @retval resolved_name.
 **/
-char * realpath(char *file_name, char *resolved_name);
+char * realpath(const char *file_name, char *resolved_name);
 
 /** The getprogname() function returns the name of the program.  If the name
 has not been set yet, it will return NULL.
diff --git a/StdLib/LibC/StdLib/realpath.c b/StdLib/LibC/StdLib/realpath.c 
index 3d4118d..29abe9a 100644
--- a/StdLib/LibC/StdLib/realpath.c
+++ b/StdLib/LibC/StdLib/realpath.c
@@ -34,7 +34,7 @@
 **/
 char *
 realpath(
-  char *file_name,
+  const char *file_name,
   char *resolved_name
   )
 {
--
2.40.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#110121): https://edk2.groups.io/g/devel/message/110121
Mute This Topic: https://groups.io/mt/102200532/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-libc Patch 0/1] fix missing nanf definition in StdLib

2023-10-26 Thread Jayaprakash, N
This patch fixes the issue of missing definition of nanf in StdLib.
This has been extracted from the below PR submitted on edk2-libc.
https://github.com/tianocore/edk2-libc/pull/9

Jayaprakash N (1):
  ek2-libc: fix missing nanf definition in StdLib

 StdLib/LibC/LibC.inf|  1 +
 StdLib/LibC/Main/nanf_ieee754.c | 15 +++
 2 files changed, 16 insertions(+)
 create mode 100644 StdLib/LibC/Main/nanf_ieee754.c

-- 
2.40.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#110118): https://edk2.groups.io/g/devel/message/110118
Mute This Topic: https://groups.io/mt/102202278/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-libc Patch 1/1] ek2-libc: fix missing nanf definition in StdLib

2023-10-26 Thread Jayaprakash, N
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4576

File StdLib/Include/math.h:406 defines NAN constant as __nanf.__val.
The problem is that __nanf is never defined.
Fix is simple: define __nanf in similar way as __infinityf

This fix has been provided through the below PR on edk2-libc repo
https://github.com/tianocore/edk2-libc/pull/9.

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Cc: Jayaprakash N 
Signed-off-by: Kloper Dimitry 
---
 StdLib/LibC/LibC.inf|  1 +
 StdLib/LibC/Main/nanf_ieee754.c | 15 +++
 2 files changed, 16 insertions(+)
 create mode 100644 StdLib/LibC/Main/nanf_ieee754.c

diff --git a/StdLib/LibC/LibC.inf b/StdLib/LibC/LibC.inf
index ad6a117..93e32e8 100644
--- a/StdLib/LibC/LibC.inf
+++ b/StdLib/LibC/LibC.inf
@@ -34,6 +34,7 @@
   Main/isnand_ieee754.c
   Main/isnanf_ieee754.c
   Main/infinityf_ieee754.c
+  Main/nanf_ieee754.c
   Main/Main.c
   Main/HtoNtoH.c
   Main/ByteSwap.c
diff --git a/StdLib/LibC/Main/nanf_ieee754.c b/StdLib/LibC/Main/nanf_ieee754.c
new file mode 100644
index 000..8e56d32
--- /dev/null
+++ b/StdLib/LibC/Main/nanf_ieee754.c
@@ -0,0 +1,15 @@
+/*
+ * IEEE-compatible nanf.c -- public domain.
+ */
+#include  
+#include 
+
+#include 
+#include 
+
+const union __float_u __nanf =
+#if BYTE_ORDER == BIG_ENDIAN
+  { { 0x7f, 0xc0, 0,0 } };
+#else
+  { {0,0,  0xc0, 0x7f } };
+#endif
-- 
2.40.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#110117): https://edk2.groups.io/g/devel/message/110117
Mute This Topic: https://groups.io/mt/102202277/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-libc Patch 1/1] ek2-libc: realpath function signature doesn't match the standard

2023-10-26 Thread Jayaprakash, N
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4574

This commit is for processing the below PR on edk2-libc repo
https://github.com/tianocore/edk2-libc/pull/10
The realpath function signature in stdlib of edk2-libc doesn't match
signature as per the standard definition of this function given below
https://pubs.opengroup.org/onlinepubs/009695399/functions/realpath.html
This patch extracted from the above pull request fixes this issue.

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Cc: Jayaprakash N 
Signed-off-by: Kloper Dimitry 
---
 StdLib/Include/stdlib.h   | 4 ++--
 StdLib/LibC/StdLib/realpath.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/StdLib/Include/stdlib.h b/StdLib/Include/stdlib.h
index 0b9dfd3..022ddbd 100644
--- a/StdLib/Include/stdlib.h
+++ b/StdLib/Include/stdlib.h
@@ -74,7 +74,7 @@
const wchar_t * __restrict src, size_t limit);
 
   Miscelaneous functions for *nix compatibility
-char   *realpath(char *file_name, char *resolved_name);
+char   *realpath(const char *file_name, char *resolved_name);
 const char *getprogname (void);
 voidsetprogname (const char *progname);
 
@@ -875,7 +875,7 @@ size_t  wcstombs(char * __restrict Dest, const wchar_t * 
__restrict Src, size_t
 @retval NULLAn error occured.
 @retval resolved_name.
 **/
-char * realpath(char *file_name, char *resolved_name);
+char * realpath(const char *file_name, char *resolved_name);
 
 /** The getprogname() function returns the name of the program.  If the name
 has not been set yet, it will return NULL.
diff --git a/StdLib/LibC/StdLib/realpath.c b/StdLib/LibC/StdLib/realpath.c
index 3d4118d..29abe9a 100644
--- a/StdLib/LibC/StdLib/realpath.c
+++ b/StdLib/LibC/StdLib/realpath.c
@@ -34,7 +34,7 @@
 **/
 char *
 realpath(
-  char *file_name,
+  const char *file_name,
   char *resolved_name
   )
 {
-- 
2.40.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#110106): https://edk2.groups.io/g/devel/message/110106
Mute This Topic: https://groups.io/mt/102200532/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-libc Patch 0/1] realpath function signature doesn't match standard

2023-10-26 Thread Jayaprakash, N
This patch fixes the function signature of realpath to match with the standard
defined signature. This patch bas been extracted from the  below pull request
raised on edk2-libc. 
https://github.com/tianocore/edk2-libc/pull/10

Jayaprakash N (1):
  ek2-libc: realpath function signature doesn't match the standard

 StdLib/Include/stdlib.h   | 4 ++--
 StdLib/LibC/StdLib/realpath.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

-- 
2.40.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#110105): https://edk2.groups.io/g/devel/message/110105
Mute This Topic: https://groups.io/mt/102200531/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] edk2-libc Python Build issue

2023-10-22 Thread Jayaprakash, N
You can build edk2-libc Python 3.6.8 using GCC tool chain by following the BKMs 
documented in this file
https://github.com/tianocore/edk2-libc/blob/master/AppPkg/Applications/Python/Python-3.6.8/GCCCompilationBKMs.rst


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109883): https://edk2.groups.io/g/devel/message/109883
Mute This Topic: https://groups.io/mt/90297607/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-libc Patch 1/1] ek2-libc: Enhance StdLib for supporting Aarch64 and ARM

2023-10-22 Thread Jayaprakash, N
Thanks Pedro.

These are pretty old PRs and some of them have valuable contributions to 
edk2-libc. 
Not every PR owner is interested in submitting the email patch for the PRs. 
Mike and Rebecca are aware of this. We had a discussion couple of Months ago on 
processing these PRs. 
I have volunteered to send email patches on behalf of these old PRs raised on 
edk2-libc over last few years.

Regarding the patch currently under review, I have extracted the patch from PR 
https://github.com/tianocore/edk2-libc/pull/3) and submitted it for review 
without any changes of mine added to it to retain the sanctity of the original 
changes.
 
All the changes are owned by Tyler Erickson  and he 
has added his consent in the PR https://github.com/tianocore/edk2-libc/pull/3 
I agree this could have been submitted as multiple patches but since I am not 
the original author I don't wanted to make changes to this patch. 
Since the original author of the changes has already given consent through 
Signed-off-by clause in the PR, It doesn't require my signature.
Also while merging the change the commit log message would be edited to reflect 
the author correctly. 

Adding Tyler Erickson  to this review discussions 
so that he can take appropriate action on the comments. 
@Tyler Erickson Would you want to take a look at these comments and make 
changes accordingly.

Regards,
JP
-Original Message-
From: Pedro Falcato  
Sent: Saturday, October 21, 2023 1:57 AM
To: devel@edk2.groups.io; Jayaprakash, N 
Cc: Rebecca Cran ; Kinney, Michael D 
; Tyler Erickson ; Ard 
Biesheuvel ; Leif Lindholm 
Subject: Re: [edk2-devel] [edk2-libc Patch 1/1] ek2-libc: Enhance StdLib for 
supporting Aarch64 and ARM

On Fri, Oct 20, 2023 at 3:04 PM Jayaprakash, N  wrote:
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4570
>
> This commit is for processing the below PR on edk2-libc repo
> https://github.com/tianocore/edk2-libc/pull/3
> These are the changes introduced to StdLib to build an application for 
> the UEFI shell.
> Added format macros for int types to Aarch64, ARM, and Ia32.
> Also modified the X64 macros so that everything would build when they 
> are used.
> Added some macros that can be used for compatibility that define when 
> socklen_t has been defined.
> Added getopt_long parser from OpenBSD to provide long and short option 
> parsing capability with getopt.

This patch is unreviewable. You'd think (from the subject) that it's an ARM 
centric change, but it ends up being a whole squashed up sequence of unrelated 
changes.
Please separate this into one commit per change.
>
> Cc: Rebecca Cran 
> Cc: Michael D Kinney 
> Cc: Jayaprakash N 
> Signed-off-by: Tyler Erickson 

AIUI, if this is Tyler's commit, you need a From: Tyler Erickson 
 (since this is his commit?). Also probably your 
own Signed-off-by, I'm not sure.

Lastly, you can't just take NetBSD's headers like this for one simple
reason: UNIX systems have used LP64 for ages, Windows systems use LLP64. What 
does this mean?
UNIX (and thus, code compiled using gcc or clang
linux/netbsd/whatever) has sizeof(long) = 8 for 64-bit systems, whereas in MSVC 
sizeof(long) = 4.

So macros like:
> #define PRIdPTR "ld"/* intptr_t */
> #define PRIuPTR "lu"/* uintptr_t */

etc, are not correct on MSVC.

Tip: since it's pretty safe, you can probably have two headers: 32-bit 
architectures (ILP32, should not change between MSVC and GCC/clang) and 64-bit 
architectures (LP64 on GCC/clang, LLP64 on MSVC). The same goes for the other 
type-related headers (I have *no* idea if those are correct).

--
Pedro


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109882): https://edk2.groups.io/g/devel/message/109882
Mute This Topic: https://groups.io/mt/102081650/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-libc Patch 1/1] ek2-libc: Enhance StdLib for supporting Aarch64 and ARM

2023-10-20 Thread Jayaprakash, N
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4570

This commit is for processing the below PR on edk2-libc repo
https://github.com/tianocore/edk2-libc/pull/3
These are the changes introduced to StdLib to build
an application for the UEFI shell.
Added format macros for int types to Aarch64, ARM, and Ia32.
Also modified the X64 macros so that everything would build
when they are used.
Added some macros that can be used for compatibility that define when
socklen_t has been defined.
Added getopt_long parser from OpenBSD to provide long and
short option parsing capability with getopt.

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Cc: Jayaprakash N 
Signed-off-by: Tyler Erickson 
---
 StdLib/Include/Aarch64/machine/int_fmtio.h | 211 +
 StdLib/Include/Arm/machine/int_fmtio.h | 211 +
 StdLib/Include/Ia32/machine/int_fmtio.h| 212 +
 StdLib/Include/X64/machine/int_fmtio.h | 324 ++---
 StdLib/Include/getopt.h|  76 +++
 StdLib/Include/inttypes.h  |   2 +-
 StdLib/Include/sys/socket.h|   6 +
 StdLib/Include/unistd.h|   7 +-
 StdLib/LibC/LibC.inf   |   1 +
 StdLib/LibC/Uefi/Uefi.inf  |   1 +
 StdLib/LibC/Uefi/compat.c  |  40 +-
 StdLib/LibC/Uefi/getopt_long.c | 523 +
 12 files changed, 1406 insertions(+), 208 deletions(-)
 create mode 100644 StdLib/Include/Aarch64/machine/int_fmtio.h
 create mode 100644 StdLib/Include/Arm/machine/int_fmtio.h
 create mode 100644 StdLib/Include/Ia32/machine/int_fmtio.h
 create mode 100644 StdLib/Include/getopt.h
 create mode 100644 StdLib/LibC/Uefi/getopt_long.c

diff --git a/StdLib/Include/Aarch64/machine/int_fmtio.h 
b/StdLib/Include/Aarch64/machine/int_fmtio.h
new file mode 100644
index 000..f091a7d
--- /dev/null
+++ b/StdLib/Include/Aarch64/machine/int_fmtio.h
@@ -0,0 +1,211 @@
+/*  $NetBSD: int_fmtio.h,v 1.10 2018/07/15 00:36:13 christos Exp $  */
+
+/*-
+ * Copyright (c) 2001 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Klaus Klein.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _ARM_INT_FMTIO_H_
+#define _ARM_INT_FMTIO_H_
+
+/*
+ * 7.8.1 Macros for format specifiers
+ */
+
+/* fprintf macros for signed integers */
+#define PRId8   "d" /* int8_t   */
+#define PRId16  "d" /* int16_t  */
+#define PRId32  "d" /* int32_t  */
+#define PRId64  "lld"   /* int64_t  */
+#define PRIdLEAST8  "d" /* int_least8_t */
+#define PRIdLEAST16 "d" /* int_least16_t*/
+#define PRIdLEAST32 "d" /* int_least32_t*/
+#define PRIdLEAST64 "lld"   /* int_least64_t*/
+#define PRIdFAST8   "d" /* int_fast8_t  */
+#define PRIdFAST16  "d" /* int_fast16_t */
+#define PRIdFAST32  "d" /* int_fast32_t */
+#define PRIdFAST64  "lld"   /* int_fast64_t */
+#define PRIdMAX "lld"   /* intmax_t */
+#define PRIdPTR "ld"/* intptr_t */
+
+#define PRIi8   "i" /* int8_t   */
+#define PRIi16  "i" /* int16_t  */
+#define PRIi32  "i" /* int32_t  */
+#define PRIi64  "lli"   /* int64_t  */
+#define PRIiLEAST8  "i" /* int_least8_t */
+#define PRIiLEAST16 "i" /* int_least16_t*/
+#define PRIiLEAST32 "i" /* int_least32_t*/
+#define PRIiLEAST64 "lli"   /* int_least64_t*/
+#define PRIiFAST8   "i" /* 

[edk2-devel] [edk2-libc Patch 0/1] edk2-libc - Enhancements to StdLibc

2023-10-20 Thread Jayaprakash, N
This patch request contains enhancements made to StdLibc
through BZ https://bugzilla.tianocore.org/show_bug.cgi?id=4570


Jayaprakash N (1):
  ek2-libc: Enhance StdLib for supporting Aarch64 and ARM

 StdLib/Include/Aarch64/machine/int_fmtio.h | 211 +
 StdLib/Include/Arm/machine/int_fmtio.h | 211 +
 StdLib/Include/Ia32/machine/int_fmtio.h| 212 +
 StdLib/Include/X64/machine/int_fmtio.h | 324 ++---
 StdLib/Include/getopt.h|  76 +++
 StdLib/Include/inttypes.h  |   2 +-
 StdLib/Include/sys/socket.h|   6 +
 StdLib/Include/unistd.h|   7 +-
 StdLib/LibC/LibC.inf   |   1 +
 StdLib/LibC/Uefi/Uefi.inf  |   1 +
 StdLib/LibC/Uefi/compat.c  |  40 +-
 StdLib/LibC/Uefi/getopt_long.c | 523 +
 12 files changed, 1406 insertions(+), 208 deletions(-)
 create mode 100644 StdLib/Include/Aarch64/machine/int_fmtio.h
 create mode 100644 StdLib/Include/Arm/machine/int_fmtio.h
 create mode 100644 StdLib/Include/Ia32/machine/int_fmtio.h
 create mode 100644 StdLib/Include/getopt.h
 create mode 100644 StdLib/LibC/Uefi/getopt_long.c

-- 
2.40.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109868): https://edk2.groups.io/g/devel/message/109868
Mute This Topic: https://groups.io/mt/102081649/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-libc Patch 1/1] ek2-libc: Fix compilation instructions of socket module as builtin module

2023-09-01 Thread Jayaprakash, N
It's a documentation change.

Reviewed-by: Jayaprakash N 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Jayaprakash, N
Sent: Friday, September 1, 2023 9:48 PM
To: devel@edk2.groups.io
Cc: Jayaprakash, N ; Rebecca Cran ; 
Kinney, Michael D 
Subject: [edk2-devel] [edk2-libc Patch 1/1] ek2-libc: Fix compilation 
instructions of socket module as builtin module

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

This change fixes the insufficient documentation instructions to compile socket 
module as built in module into Python interpreter

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Cc: Jayaprakash N 
Signed-off-by: Jayaprakash N 
---
 .../Python/Python-3.6.8/Py368ReadMe.txt | 13 +++--
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt 
b/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt
index eae56b4..2b27c92 100644
--- a/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt
+++ b/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt
@@ -129,13 +129,14 @@ system as follows:
 
 6. Example: Enabling socket support
 ===
-  1.  enable {"_socket", init_socket}, in PyMod-3.6.8\Modules\config.c
-  2.  enable LibraryClasses BsdSocketLib and EfiSocketLib in Python368.inf
-  3.  Build Python interpreter application using below command
+  1. Uncomment the statement // {"_socket", init_socket}, in 
+ PyMod-3.6.8\Modules\config.c  2. Uncomment BsdSocketLib and 
+ EfiSocketLib LibraryClasses in Python368.inf  3. Uncomment the 
+ statement #Modules/socketmodule.c in Python368.inf  4. Build Python 
+ interpreter application using below command
   build -a X64 -p AppPkg\AppPkg.dsc
-  6.  copy Build\AppPkg\RELEASE_VS2017\X64\Python.efi to \Efi\Tools on your
-  target system. Replace "RELEASE_VS2017", in the source path, with
-  values appropriate for your tool chain.
+  5. Copy Build\AppPkg\RELEASE_VS2017\X64\Python.efi to \Efi\Tools on your
+ target system. Replace "RELEASE_VS2017", in the source path, with
+ values appropriate for your tool chain.
 
 7. Running Python
 =
--
2.40.0.windows.1








-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108231): https://edk2.groups.io/g/devel/message/108231
Mute This Topic: https://groups.io/mt/101098720/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-libc Patch 1/1] ek2-libc: Fix compilation instructions of socket module as builtin module

2023-09-01 Thread Jayaprakash, N
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4548

This change fixes the insufficient documentation instructions
to compile socket module as built in module into Python interpreter

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Cc: Jayaprakash N 
Signed-off-by: Jayaprakash N 
---
 .../Python/Python-3.6.8/Py368ReadMe.txt | 13 +++--
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt 
b/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt
index eae56b4..2b27c92 100644
--- a/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt
+++ b/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt
@@ -129,13 +129,14 @@ system as follows:
 
 6. Example: Enabling socket support
 ===
-  1.  enable {"_socket", init_socket}, in PyMod-3.6.8\Modules\config.c
-  2.  enable LibraryClasses BsdSocketLib and EfiSocketLib in Python368.inf
-  3.  Build Python interpreter application using below command
+  1. Uncomment the statement // {"_socket", init_socket}, in 
PyMod-3.6.8\Modules\config.c
+  2. Uncomment BsdSocketLib and EfiSocketLib LibraryClasses in Python368.inf
+  3. Uncomment the statement #Modules/socketmodule.c in Python368.inf
+  4. Build Python interpreter application using below command
   build -a X64 -p AppPkg\AppPkg.dsc
-  6.  copy Build\AppPkg\RELEASE_VS2017\X64\Python.efi to \Efi\Tools on your
-  target system. Replace "RELEASE_VS2017", in the source path, with
-  values appropriate for your tool chain.
+  5. Copy Build\AppPkg\RELEASE_VS2017\X64\Python.efi to \Efi\Tools on your
+ target system. Replace "RELEASE_VS2017", in the source path, with
+ values appropriate for your tool chain.
 
 7. Running Python
 =
-- 
2.40.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108230): https://edk2.groups.io/g/devel/message/108230
Mute This Topic: https://groups.io/mt/101098540/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-libc Patch 0/1] AppPkg - fix python socket module compilation instructions

2023-09-01 Thread Jayaprakash, N
This patch fixes the insufficient documentation issue in Py368ReadMe.txt
for compiling the socket module as builtin module of Python.
The issue is reported in BZ 4548. 

Jayaprakash N (1):
  ek2-libc: Fix compilation instructions of socket module as builtin
module

 .../Python/Python-3.6.8/Py368ReadMe.txt | 13 +++--
 1 file changed, 7 insertions(+), 6 deletions(-)

-- 
2.40.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108229): https://edk2.groups.io/g/devel/message/108229
Mute This Topic: https://groups.io/mt/101098539/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-libc Patch 1/1] ek2-libc: socket module of python UEFI fails to compile with GCC

2023-08-31 Thread Jayaprakash, N
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4545

The compilation issues reported in the BZ are fixed by
defining below 2 macros in pyconfig.h
HAVE_ADDRINFO
HAVE_SOCKADDR_STORAGE

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Cc: Jayaprakash N 
Signed-off-by: Jayaprakash N 
---
 .../Python/Python-3.6.8/PyMod-3.6.8/Include/pyconfig.h| 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Include/pyconfig.h 
b/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Include/pyconfig.h
index 3b9eceb..983cfda 100644
--- a/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Include/pyconfig.h
+++ b/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Include/pyconfig.h
@@ -66,7 +66,7 @@
 #undef HAVE_ACOSH
 
 /* struct addrinfo (netdb.h) */
-#undef HAVE_ADDRINFO
+#define HAVE_ADDRINFO   1
 
 /* Define to 1 if you have the 'alarm' function. */
 #undef HAVE_ALARM
@@ -683,7 +683,7 @@
 #undef HAVE_SOCKADDR_SA_LEN
 
 /* struct sockaddr_storage (sys/socket.h) */
-#undef HAVE_SOCKADDR_STORAGE
+#define HAVE_SOCKADDR_STORAGE   1
 
 /* Define if you have the 'socketpair' function. */
 #undef HAVE_SOCKETPAIR
-- 
2.40.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108200): https://edk2.groups.io/g/devel/message/108200
Mute This Topic: https://groups.io/mt/101077159/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-libc Patch 0/1] python socket module fails with GCC compiler

2023-08-31 Thread Jayaprakash, N
This patch fixes the compilation issue of Python UEFI interpreters socket
module due to duplicate definitions of certain structures as reported 
in BZ 4545.

Jayaprakash N (1):
  ek2-libc: socket module of python UEFI fails to compile with GCC

 .../Python/Python-3.6.8/PyMod-3.6.8/Include/pyconfig.h| 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.40.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108199): https://edk2.groups.io/g/devel/message/108199
Mute This Topic: https://groups.io/mt/101077158/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: Socket completion functions are not called on Linux Compilation

2023-08-29 Thread Jayaprakash, N


Reviewed-by: Jayaprakash N  

Regards,
JP
-Original Message-
From: devel@edk2.groups.io  On Behalf Of Jayaprakash, N
Sent: Monday, August 28, 2023 4:01 PM
To: devel@edk2.groups.io
Cc: Jayaprakash, N ; Rebecca Cran ; 
Kinney, Michael D ; Kloper, Dimitry 

Subject: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: Socket completion 
functions are not called on Linux Compilation

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

>From the bug description:
Analysis and root cause


After some investigation and debugging I have figured out the following:

The following function is implemented in file  edk2/StdLib/EfiSocketLib/Tcp4.c

VOID
EslTcp4ListenComplete (
  IN EFI_EVENT Event,
  IN ESL_PORT * pPort
);

The function is used in EslTcp4Listen() as a callback for connection 
notification event, it is created by the following code:

Status = gBS->CreateEvent ( EVT_NOTIFY_SIGNAL,
TPL_SOCKETS,
(EFI_EVENT_NOTIFY)EslTcp4ListenComplete,
pPort,
&pTcp4->ListenToken.CompletionToken.Event );

And this is actually introduces a bug: the CreateEvent() third parameter is of 
type EFI_EVENT_NOTIFY which is defined as

typedef
VOID
(EFIAPI *EFI_EVENT_NOTIFY) (
   IN EFI_EVENT Event,
   IN VOID *Context
);

That EFIAPI tag is important since it defines an ABI that is used by compiler 
in order to call the callback function. Note that EslTcp4ListenComplete() is 
not marked as EFIAPI.

Thus, on Linux, where gcc defaults to SYSV ABI, there will be mismatch between 
arguments passed to EslTcp4ListenComplete() by the event dispatcher. It expects 
function with WIN64 ABI, while its code compiled with default SYSV ABI. It will 
look in wrong registers for arguments.

Specifically pPort pointer references an wrong memory location. Luckily
EslTcp4ListenComplete() performs sanity check of the pPort structure and 
discovers that it is invalid. This causes discarding of all incoming 
connections.

Proposed fix
---

The fix is trivial - mark EslTcp4ListenComplete() as EFIAPI. This is a little 
more complicated, since there are additional callback functions that suffer 
from the same problem. In addition fixing those causes some compiler warnings 
that shall be addressed. Attached patch fixes the problem for me.

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Cc: Jayaprakash N 
Signed-off-by: Dimitry Kloper 
---
 StdLib/EfiSocketLib/Ip4.c| 11 +++
 StdLib/EfiSocketLib/Socket.c |  5 +++--  StdLib/EfiSocketLib/Socket.h | 12 
++--
 StdLib/EfiSocketLib/Tcp4.c   | 35 ---
 StdLib/EfiSocketLib/Tcp6.c   | 35 ---
 StdLib/EfiSocketLib/Udp4.c   | 10 ++
 StdLib/EfiSocketLib/Udp6.c   | 10 ++
 7 files changed, 68 insertions(+), 50 deletions(-)

diff --git a/StdLib/EfiSocketLib/Ip4.c b/StdLib/EfiSocketLib/Ip4.c index 
4b8f05b..8d25537 100644
--- a/StdLib/EfiSocketLib/Ip4.c
+++ b/StdLib/EfiSocketLib/Ip4.c
@@ -588,16 +588,17 @@ EslIp4RemoteAddressSet (
   @param [in] pIo   The address of an ::ESL_IO_MGMT structure
 
 **/
-VOID
+VOID EFIAPI
 EslIp4RxComplete (
   IN EFI_EVENT Event,
-  IN ESL_IO_MGMT * pIo
+  IN VOID *context
   )
 {
   size_t LengthInBytes;
   ESL_PACKET * pPacket;
   EFI_IP4_RECEIVE_DATA * pRxData;
   EFI_STATUS Status;
+  ESL_IO_MGMT * pIo = (ESL_IO_MGMT *)context;
 
   DBG_ENTER ( );
 
@@ -1117,10 +1118,10 @@ EslIp4TxBuffer (
   @param [in] pIo   The address of an ::ESL_IO_MGMT structure
 
 **/
-VOID
+VOID EFIAPI
 EslIp4TxComplete (
   IN EFI_EVENT Event,
-  IN ESL_IO_MGMT * pIo
+  IN VOID *context
   )
 {
   UINT32 LengthInBytes;
@@ -1128,6 +1129,7 @@ EslIp4TxComplete (
   ESL_PACKET * pPacket;
   ESL_SOCKET * pSocket;
   EFI_STATUS Status;
+  ESL_IO_MGMT * pIo = (ESL_IO_MGMT*)context;
 
   DBG_ENTER ( );
 
@@ -1341,6 +1343,7 @@ CONST ESL_PROTOCOL_API cEslIp4Api = {
   OFFSET_OF ( ESL_PORT, Context.Ip4.ModeData.ConfigData ),
   OFFSET_OF ( ESL_LAYER, pIp4List ),
   OFFSET_OF ( struct sockaddr_in, sin_zero ),
+
   sizeof ( struct sockaddr_in ),
   AF_INET,
   sizeof (((ESL_PACKET *)0 )->Op.Ip4Rx ), diff --git 
a/StdLib/EfiSocketLib/Socket.c b/StdLib/EfiSocketLib/Socket.c index 
59b8efa..ee15b62 100644
--- a/StdLib/EfiSocketLib/Socket.c
+++ b/StdLib/EfiSocketLib/Socket.c
@@ -3970,14 +3970,15 @@ EslSocketPortClose (
   @param[in]  Event The close completion event
   @param[in]  pPort Address of an ::ESL_PORT structure.
 **/
-VOID
+VOID EFIAPI
 EslSocketPortCloseComplete (
   IN EFI_EVENT Event,
-  IN ESL_PORT * pPort
+  IN VOID *context
   )
 {
   ESL_IO_MGMT * pIo;
   EFI_STATUS Status;
+  ESL_PORT * pPort = (ESL_PORT*) context;
 
   DBG_ENTER ( );
   VERIFY_AT_TPL ( TPL_SOCKETS );
diff --git a/StdLib/EfiSocketLib/Socket.h b/StdLib/EfiSocketLib/Socket.h index 
d7d55e6..81d3b2c 100644
--- a/StdLib/EfiSocketLib/Socket.h
+++ b/StdLib/EfiSocketLib/So

[edk2-devel] [edk2-libc Patch 1/1] edk2-libc: Socket completion functions are not called on Linux Compilation

2023-08-28 Thread Jayaprakash, N
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=983

>From the bug description:
Analysis and root cause


After some investigation and debugging I have figured out the following:

The following function is implemented in file  edk2/StdLib/EfiSocketLib/Tcp4.c

VOID
EslTcp4ListenComplete (
  IN EFI_EVENT Event,
  IN ESL_PORT * pPort
);

The function is used in EslTcp4Listen() as a callback for connection
notification event, it is created by the following code:

Status = gBS->CreateEvent ( EVT_NOTIFY_SIGNAL,
TPL_SOCKETS,
(EFI_EVENT_NOTIFY)EslTcp4ListenComplete,
pPort,
&pTcp4->ListenToken.CompletionToken.Event );

And this is actually introduces a bug: the CreateEvent() third parameter is of
type EFI_EVENT_NOTIFY which is defined as

typedef
VOID
(EFIAPI *EFI_EVENT_NOTIFY) (
   IN EFI_EVENT Event,
   IN VOID *Context
);

That EFIAPI tag is important since it defines an ABI that is used by compiler
in order to call the callback function. Note that EslTcp4ListenComplete() is
not marked as EFIAPI.

Thus, on Linux, where gcc defaults to SYSV ABI, there will be mismatch between
arguments passed to EslTcp4ListenComplete() by the event dispatcher. It expects
function with WIN64 ABI, while its code compiled with default SYSV ABI. It will
look in wrong registers for arguments.

Specifically pPort pointer references an wrong memory location. Luckily
EslTcp4ListenComplete() performs sanity check of the pPort structure and
discovers that it is invalid. This causes discarding of all incoming
connections.

Proposed fix
---

The fix is trivial - mark EslTcp4ListenComplete() as EFIAPI. This is a little
more complicated, since there are additional callback functions that suffer
from the same problem. In addition fixing those causes some compiler warnings
that shall be addressed. Attached patch fixes the problem for me.

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Cc: Jayaprakash N 
Signed-off-by: Dimitry Kloper 
---
 StdLib/EfiSocketLib/Ip4.c| 11 +++
 StdLib/EfiSocketLib/Socket.c |  5 +++--
 StdLib/EfiSocketLib/Socket.h | 12 ++--
 StdLib/EfiSocketLib/Tcp4.c   | 35 ---
 StdLib/EfiSocketLib/Tcp6.c   | 35 ---
 StdLib/EfiSocketLib/Udp4.c   | 10 ++
 StdLib/EfiSocketLib/Udp6.c   | 10 ++
 7 files changed, 68 insertions(+), 50 deletions(-)

diff --git a/StdLib/EfiSocketLib/Ip4.c b/StdLib/EfiSocketLib/Ip4.c
index 4b8f05b..8d25537 100644
--- a/StdLib/EfiSocketLib/Ip4.c
+++ b/StdLib/EfiSocketLib/Ip4.c
@@ -588,16 +588,17 @@ EslIp4RemoteAddressSet (
   @param [in] pIo   The address of an ::ESL_IO_MGMT structure
 
 **/
-VOID
+VOID EFIAPI
 EslIp4RxComplete (
   IN EFI_EVENT Event,
-  IN ESL_IO_MGMT * pIo
+  IN VOID *context
   )
 {
   size_t LengthInBytes;
   ESL_PACKET * pPacket;
   EFI_IP4_RECEIVE_DATA * pRxData;
   EFI_STATUS Status;
+  ESL_IO_MGMT * pIo = (ESL_IO_MGMT *)context;
 
   DBG_ENTER ( );
 
@@ -1117,10 +1118,10 @@ EslIp4TxBuffer (
   @param [in] pIo   The address of an ::ESL_IO_MGMT structure
 
 **/
-VOID
+VOID EFIAPI
 EslIp4TxComplete (
   IN EFI_EVENT Event,
-  IN ESL_IO_MGMT * pIo
+  IN VOID *context
   )
 {
   UINT32 LengthInBytes;
@@ -1128,6 +1129,7 @@ EslIp4TxComplete (
   ESL_PACKET * pPacket;
   ESL_SOCKET * pSocket;
   EFI_STATUS Status;
+  ESL_IO_MGMT * pIo = (ESL_IO_MGMT*)context;
 
   DBG_ENTER ( );
 
@@ -1341,6 +1343,7 @@ CONST ESL_PROTOCOL_API cEslIp4Api = {
   OFFSET_OF ( ESL_PORT, Context.Ip4.ModeData.ConfigData ),
   OFFSET_OF ( ESL_LAYER, pIp4List ),
   OFFSET_OF ( struct sockaddr_in, sin_zero ),
+
   sizeof ( struct sockaddr_in ),
   AF_INET,
   sizeof (((ESL_PACKET *)0 )->Op.Ip4Rx ),
diff --git a/StdLib/EfiSocketLib/Socket.c b/StdLib/EfiSocketLib/Socket.c
index 59b8efa..ee15b62 100644
--- a/StdLib/EfiSocketLib/Socket.c
+++ b/StdLib/EfiSocketLib/Socket.c
@@ -3970,14 +3970,15 @@ EslSocketPortClose (
   @param[in]  Event The close completion event
   @param[in]  pPort Address of an ::ESL_PORT structure.
 **/
-VOID
+VOID EFIAPI
 EslSocketPortCloseComplete (
   IN EFI_EVENT Event,
-  IN ESL_PORT * pPort
+  IN VOID *context
   )
 {
   ESL_IO_MGMT * pIo;
   EFI_STATUS Status;
+  ESL_PORT * pPort = (ESL_PORT*) context;
 
   DBG_ENTER ( );
   VERIFY_AT_TPL ( TPL_SOCKETS );
diff --git a/StdLib/EfiSocketLib/Socket.h b/StdLib/EfiSocketLib/Socket.h
index d7d55e6..81d3b2c 100644
--- a/StdLib/EfiSocketLib/Socket.h
+++ b/StdLib/EfiSocketLib/Socket.h
@@ -591,9 +591,9 @@ EFI_STATUS
 **/
 typedef
 VOID
-(* PFN_API_IO_COMPLETE) (
+(EFIAPI * PFN_API_IO_COMPLETE) (
   IN EFI_EVENT Event,
-  IN ESL_IO_MGMT * pIo
+  IN VOID *pIo //IN ESL_IO_MGMT * pIo
   );
 
 /**
@@ -909,9 +909,9 @@ EFI_STATUS
 **/
 typedef
 VOID
-(* PFN_API_TX_COMPLETE) (
+(EFIAPI * PFN_API_TX_COMPLETE) (
   IN EFI_EVENT Event,
-  IN ESL_IO_MGMT * pIo
+  IN VOID *pIo //IN E

[edk2-devel] [edk2-libc Patch 0/1] Socket completion functions not called on Linux Compilation

2023-08-28 Thread Jayaprakash, N
This patch fixes the issue reported in BZ given below:
https://bugzilla.tianocore.org/show_bug.cgi?id=983
Patch extracted from PR https://github.com/tianocore/edk2-libc/pull/7

Jayaprakash N (1):
  edk2-libc: Socket completion functions are not called on Linux
Compilation

 StdLib/EfiSocketLib/Ip4.c| 11 +++
 StdLib/EfiSocketLib/Socket.c |  5 +++--
 StdLib/EfiSocketLib/Socket.h | 12 ++--
 StdLib/EfiSocketLib/Tcp4.c   | 35 ---
 StdLib/EfiSocketLib/Tcp6.c   | 35 ---
 StdLib/EfiSocketLib/Udp4.c   | 10 ++
 StdLib/EfiSocketLib/Udp6.c   | 10 ++
 7 files changed, 68 insertions(+), 50 deletions(-)

-- 
2.40.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108055): https://edk2.groups.io/g/devel/message/108055
Mute This Topic: https://groups.io/mt/101006990/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc/StdLib: Fix console jump to 0, 0 issue in lseek()

2023-08-25 Thread Jayaprakash, N
Reviewed the changes and it looks good.
Also verified that the fix solves the problem.

Reviewed-by : Jayaprakash N 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Jayaprakash, N
Sent: Thursday, August 24, 2023 10:04 PM
To: devel@edk2.groups.io
Cc: Jayaprakash, N ; Rebecca Cran ; 
Kinney, Michael D ; Kloper, Dimitry 

Subject: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc/StdLib: Fix console jump 
to 0, 0 issue in lseek()

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

Python code opens console file descriptor and uses lseek() with position == 0 
and SEEK_CUR as 'do nothing, check console is alive' operation.

Current implementation of daConsole ignores whence argument, this is wrong in 
case lseek(0, SEEK_CUR) will send cursor to (0,0).
This fix is not generic, but solves the particular situation.

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Cc: Jayaprakash N 
Signed-off-by: Kloper Dimitry 
---
 StdLib/LibC/Uefi/Devices/Console/daConsole.c | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/StdLib/LibC/Uefi/Devices/Console/daConsole.c 
b/StdLib/LibC/Uefi/Devices/Console/daConsole.c
index 56571af..ba031d6 100644
--- a/StdLib/LibC/Uefi/Devices/Console/daConsole.c
+++ b/StdLib/LibC/Uefi/Devices/Console/daConsole.c
@@ -141,8 +141,16 @@ da_ConSeek(
 EFIerrno = RETURN_UNSUPPORTED;
 return -1;
   }
-  // Everything is OK to do the final verification and "seek".
+
   Proto = (EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *)Stream->Dev;
+
+  if(Position == 0 && whence == SEEK_CUR) {
+CursorPos.XYpos.Column  = (UINT32)Proto->Mode->CursorColumn;
+CursorPos.XYpos.Row = (UINT32)Proto->Mode->CursorRow;
+return CursorPos.Offset;
+  }
+
+  // Everything is OK to do the final verification and "seek".
   CursorPos.Offset = Position;
 
   EFIerrno = Proto->SetCursorPosition(Proto,
--
2.40.0.windows.1








-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108035): https://edk2.groups.io/g/devel/message/108035
Mute This Topic: https://groups.io/mt/100952873/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-libc Patch 1/1] edk2-libc/StdLib: Fix console jump to 0, 0 issue in lseek()

2023-08-24 Thread Jayaprakash, N
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4531

Python code opens console file descriptor and uses lseek()
with position == 0 and SEEK_CUR as
'do nothing, check console is alive' operation.

Current implementation of daConsole ignores whence argument,
this is wrong in case lseek(0, SEEK_CUR) will send cursor to (0,0).
This fix is not generic, but solves the particular situation.

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Cc: Jayaprakash N 
Signed-off-by: Kloper Dimitry 
---
 StdLib/LibC/Uefi/Devices/Console/daConsole.c | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/StdLib/LibC/Uefi/Devices/Console/daConsole.c 
b/StdLib/LibC/Uefi/Devices/Console/daConsole.c
index 56571af..ba031d6 100644
--- a/StdLib/LibC/Uefi/Devices/Console/daConsole.c
+++ b/StdLib/LibC/Uefi/Devices/Console/daConsole.c
@@ -141,8 +141,16 @@ da_ConSeek(
 EFIerrno = RETURN_UNSUPPORTED;
 return -1;
   }
-  // Everything is OK to do the final verification and "seek".
+
   Proto = (EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *)Stream->Dev;
+
+  if(Position == 0 && whence == SEEK_CUR) {
+CursorPos.XYpos.Column  = (UINT32)Proto->Mode->CursorColumn;
+CursorPos.XYpos.Row = (UINT32)Proto->Mode->CursorRow;
+return CursorPos.Offset;
+  }
+
+  // Everything is OK to do the final verification and "seek".
   CursorPos.Offset = Position;
 
   EFIerrno = Proto->SetCursorPosition(Proto,
-- 
2.40.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108016): https://edk2.groups.io/g/devel/message/108016
Mute This Topic: https://groups.io/mt/100938751/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-libc Patch 0/1] Fix issue with lseek function

2023-08-24 Thread Jayaprakash, N
This patch fixes a corner case issue with the lseek function.
The issue is captured in  
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4531

Jayaprakash N (1):
  edk2-libc/StdLib: Fix console jump to 0, 0 issue in lseek()

 StdLib/LibC/Uefi/Devices/Console/daConsole.c | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

-- 
2.40.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108015): https://edk2.groups.io/g/devel/message/108015
Mute This Topic: https://groups.io/mt/100938748/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-libc Patch 1/1] edk2-libc/StdLib: file descriptor leak in rename()

2023-08-21 Thread Jayaprakash, N
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4529

rename() call leads to a function that makes open() for source file
to be renamed. The resulting file descriptor is never closed.
If you have to rename a couple of files this will quickly exhaust
the descriptor table.
The fix is trivial - just close the fd before returning from the function.

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Cc: Jayaprakash N 
Signed-off-by: Kloper Dimitry 
---
 StdLib/LibC/Uefi/Devices/UefiShell/daShell.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/StdLib/LibC/Uefi/Devices/UefiShell/daShell.c 
b/StdLib/LibC/Uefi/Devices/UefiShell/daShell.c
index 861765e..06fcc3b 100644
--- a/StdLib/LibC/Uefi/Devices/UefiShell/daShell.c
+++ b/StdLib/LibC/Uefi/Devices/UefiShell/daShell.c
@@ -670,6 +670,7 @@ da_ShellRename(
 free(NewFileInfo);
 if(Status == EFI_SUCCESS) {
   // File has been successfully renamed.  We are DONE!
+  close(OldFd);
   return 0;
 }
 errno = EFI2errno( Status );
@@ -688,6 +689,7 @@ da_ShellRename(
 else {
   errno = ENOMEM;
 }
+close(OldFd);
   }
   return -1;
 }
-- 
2.40.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#107942): https://edk2.groups.io/g/devel/message/107942
Mute This Topic: https://groups.io/mt/100888179/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-libc Patch 0/1] file descriptor leak in rename

2023-08-21 Thread Jayaprakash, N
This patch provides fix for the file descriptor leak issue in 
rename function from the LibC library of the StdLib of edk2-libc

Jayaprakash N (1):
  edk2-libc/StdLib: file descriptor leak in rename()

 StdLib/LibC/Uefi/Devices/UefiShell/daShell.c | 2 ++
 1 file changed, 2 insertions(+)

-- 
2.40.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#107941): https://edk2.groups.io/g/devel/message/107941
Mute This Topic: https://groups.io/mt/100888175/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc/AppPkg: Fix documentation issue with edk2module.c

2023-08-07 Thread Jayaprakash, N
Reviewed-by: Jayaprakash Nevara 


-Original Message-
From: R, Vishal  
Sent: Thursday, August 3, 2023 10:12 PM
To: devel@edk2.groups.io
Cc: R, Vishal ; Rebecca Cran ; Kinney, 
Michael D ; Jayaprakash, N 
Subject: [edk2-libc Patch 1/1] edk2-libc/AppPkg: Fix documentation issue with 
edk2module.c

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

This commit fixes the API documentation issue reported via the BZ4517 Updated 
documentation strings for rdmsr() and wrmsr()

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Cc: Jayaprakash N 
Signed-off-by: Vishal R 
---
 .../PyMod-3.6.8/Modules/edk2module.c  | 28 +++
 1 file changed, 23 insertions(+), 5 deletions(-)

diff --git 
a/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c 
b/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c
index 9641f86..05b1a5a 100644
--- a/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c
+++ b/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2mo
+++ dule.c
@@ -3839,8 +3839,16 @@ void WritePCICfg(  }
 
 PyDoc_STRVAR(efi_rdmsr__doc__,
-"rdmsr(ecx) -> (eax,edx)\n\
-Read the given MSR.");
+"rdmsr(msr) -> (lower_32bits, higher_32bits)\n\ \n\ Read the given msr 
+and return the data as tuple.\n\ \n\ Parameters:\n\
+msr - The msr in hex or int format\n\ \n\ Return Value:\n\
+a tuple with lower and higher 32 bit values read from the msr\n\ 
+");
 
 static PyObject *
 edk2_rdmsr(PyObject *self, PyObject *args) @@ -3857,9 +3865,19 @@ 
edk2_rdmsr(PyObject *self, PyObject *args)
   return Py_BuildValue("(II)", (unsigned long)veax, (unsigned long)vedx);  }
 
-PyDoc_STRVAR(efi_wrmsr__doc__,
-"wrmsr(ecx, eax, edx) -> None\n\
-Write edx:eax to the given MSR.");
+PyDoc_STRVAR(efi_wrmsr__doc__,
+"wrmsr(msr, lower_32bits, higher_32bits) -> None\n\ \n\ Writes 
+higher_32bits:lower_32bits to the given msr.\n\ \n\ Parameters:\n\
+msr - The msr in hex or int format\n\
+lower_32bits - The lower 32 bit data for the msr\n\
+higher_32bits - The higher 32 bit data for the msr\n\ \n\ Return 
+Value:\n\
+None\n\
+");
 
 static PyObject *
 edk2_wrmsr(PyObject *self, PyObject *args)
--
2.39.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#107633): https://edk2.groups.io/g/devel/message/107633
Mute This Topic: https://groups.io/mt/100551578/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-libc Patch v2 1/1] edk2-libc/StdLib: Fix uninitialized global variable

2023-07-30 Thread Jayaprakash, N
Reviewed-by: Jayaprakash N 

Regards,
JP
-Original Message-
From: devel@edk2.groups.io  On Behalf Of Jayaprakash, N
Sent: Wednesday, July 26, 2023 9:09 PM
To: devel@edk2.groups.io
Cc: Jayaprakash, N ; Rebecca Cran ; 
Kinney, Michael D ; Kloper, Dimitry 

Subject: [edk2-devel] [edk2-libc Patch v2 1/1] edk2-libc/StdLib: Fix 
uninitialized global variable

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

res_init() is called from different places in sockets library. It depends on 
global _res variable containing a state.
The problem is that if __BIND_RES_TEXT macro is not defined, _res is not 
initialized.
Depending on compiler and build optimization this can fill the variable with 
garbage that is later used by res_init().
Fix is trivial - explicitly initialize _res.

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Cc: Jayaprakash N 
Signed-off-by: Kloper Dimitry 
---
 StdLib/BsdSocketLib/res_init.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/StdLib/BsdSocketLib/res_init.c b/StdLib/BsdSocketLib/res_init.c 
index 613a76a..9df7d4f 100644
--- a/StdLib/BsdSocketLib/res_init.c
+++ b/StdLib/BsdSocketLib/res_init.c
@@ -121,9 +121,11 @@ static u_int32_t net_mask __P((struct in_addr));
  */
 
 struct __res_state _res
-# if defined(__BIND_RES_TEXT)
+#if defined(__BIND_RES_TEXT)
 = { RES_TIMEOUT, }  /* Motorola, et al. */ -# endif
+#else
+= {0}
+#endif
 ;
 
 
--
2.40.0.windows.1








-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#107394): https://edk2.groups.io/g/devel/message/107394
Mute This Topic: https://groups.io/mt/100456378/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




  1   2   >