All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 0/4] efi_loader: text protocols
@ 2018-07-05  6:17 Heinrich Schuchardt
  2018-07-05  6:17 ` [U-Boot] [PATCH 1/4] efi_loader: set revision in loaded image protocol Heinrich Schuchardt
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Heinrich Schuchardt @ 2018-07-05  6:17 UTC (permalink / raw)
  To: u-boot

This patch set fixes some problems found via the SCT.

Heinrich Schuchardt (4):
  efi_loader: set revision in loaded image protocol
  efi_loader: EFI_SIMPLE_TEXT_INPUT_PROTOCOL.Reset()
  efi_loader: clear screen has to reset cursor position
  efi_loader: EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.Reset()

 include/efi_api.h             |  2 ++
 lib/efi_loader/efi_boottime.c |  1 +
 lib/efi_loader/efi_console.c  | 19 +++++++++++++++++--
 3 files changed, 20 insertions(+), 2 deletions(-)

-- 
2.18.0

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH 1/4] efi_loader: set revision in loaded image protocol
  2018-07-05  6:17 [U-Boot] [PATCH 0/4] efi_loader: text protocols Heinrich Schuchardt
@ 2018-07-05  6:17 ` Heinrich Schuchardt
  2018-07-05  6:17 ` [U-Boot] [PATCH 2/4] efi_loader: EFI_SIMPLE_TEXT_INPUT_PROTOCOL.Reset() Heinrich Schuchardt
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Heinrich Schuchardt @ 2018-07-05  6:17 UTC (permalink / raw)
  To: u-boot

The revision number has to be set in the loaded image protocol.

The problem was detected by running the SCT in
Protocol/LoadedImage/BlackBoxTest/LoadedImageBBTestMain.c:890

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 include/efi_api.h             | 2 ++
 lib/efi_loader/efi_boottime.c | 1 +
 2 files changed, 3 insertions(+)

diff --git a/include/efi_api.h b/include/efi_api.h
index 99ea2c5b69..c98cc34908 100644
--- a/include/efi_api.h
+++ b/include/efi_api.h
@@ -321,6 +321,8 @@ struct efi_system_table {
 	EFI_GUID(0x5b1b31a1, 0x9562, 0x11d2, \
 		 0x8e, 0x3f, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b)
 
+#define EFI_LOADED_IMAGE_PROTOCOL_REVISION 0x1000
+
 struct efi_loaded_image {
 	u32 revision;
 	void *parent_handle;
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index 105e80bb52..9ac8e18680 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -1484,6 +1484,7 @@ efi_status_t efi_setup_loaded_image(
 	/* efi_exit() assumes that the handle points to the info */
 	obj->handle = info;
 
+	info->revision =  EFI_LOADED_IMAGE_PROTOCOL_REVISION;
 	info->file_path = file_path;
 
 	if (device_path) {
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH 2/4] efi_loader: EFI_SIMPLE_TEXT_INPUT_PROTOCOL.Reset()
  2018-07-05  6:17 [U-Boot] [PATCH 0/4] efi_loader: text protocols Heinrich Schuchardt
  2018-07-05  6:17 ` [U-Boot] [PATCH 1/4] efi_loader: set revision in loaded image protocol Heinrich Schuchardt
@ 2018-07-05  6:17 ` Heinrich Schuchardt
  2018-07-05  6:18 ` [U-Boot] [PATCH 3/4] efi_loader: clear screen has to reset cursor position Heinrich Schuchardt
  2018-07-05  6:18 ` [U-Boot] [PATCH 4/4] efi_loader: EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.Reset() Heinrich Schuchardt
  3 siblings, 0 replies; 6+ messages in thread
From: Heinrich Schuchardt @ 2018-07-05  6:17 UTC (permalink / raw)
  To: u-boot

Implement the reset service of the EFI_SIMPLE_TEXT_INPUT_PROTOCOL.

This should resolve the error reported by the SCT in
Protocol/SimpleTextIn/BlackBoxTest/SimpleTextInBBTestFunction.c:193

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 lib/efi_loader/efi_console.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console.c
index ce66c935ec..1d52753456 100644
--- a/lib/efi_loader/efi_console.c
+++ b/lib/efi_loader/efi_console.c
@@ -381,7 +381,12 @@ static efi_status_t EFIAPI efi_cin_reset(
 			bool extended_verification)
 {
 	EFI_ENTRY("%p, %d", this, extended_verification);
-	return EFI_EXIT(EFI_UNSUPPORTED);
+
+	/* Empty input buffer */
+	while (tstc())
+		getc();
+
+	return EFI_EXIT(EFI_SUCCESS);
 }
 
 /*
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH 3/4] efi_loader: clear screen has to reset cursor position
  2018-07-05  6:17 [U-Boot] [PATCH 0/4] efi_loader: text protocols Heinrich Schuchardt
  2018-07-05  6:17 ` [U-Boot] [PATCH 1/4] efi_loader: set revision in loaded image protocol Heinrich Schuchardt
  2018-07-05  6:17 ` [U-Boot] [PATCH 2/4] efi_loader: EFI_SIMPLE_TEXT_INPUT_PROTOCOL.Reset() Heinrich Schuchardt
@ 2018-07-05  6:18 ` Heinrich Schuchardt
  2018-07-05  6:18 ` [U-Boot] [PATCH 4/4] efi_loader: EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.Reset() Heinrich Schuchardt
  3 siblings, 0 replies; 6+ messages in thread
From: Heinrich Schuchardt @ 2018-07-05  6:18 UTC (permalink / raw)
  To: u-boot

After clearing the screen the cursor position is row 0, column 0.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 lib/efi_loader/efi_console.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console.c
index 1d52753456..3fd0d2fd51 100644
--- a/lib/efi_loader/efi_console.c
+++ b/lib/efi_loader/efi_console.c
@@ -335,6 +335,8 @@ static efi_status_t EFIAPI efi_cout_clear_screen(
 	EFI_ENTRY("%p", this);
 
 	printf(ESC"[2J");
+	efi_con_mode.cursor_column = 0;
+	efi_con_mode.cursor_row = 0;
 
 	return EFI_EXIT(EFI_SUCCESS);
 }
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH 4/4] efi_loader: EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.Reset()
  2018-07-05  6:17 [U-Boot] [PATCH 0/4] efi_loader: text protocols Heinrich Schuchardt
                   ` (2 preceding siblings ...)
  2018-07-05  6:18 ` [U-Boot] [PATCH 3/4] efi_loader: clear screen has to reset cursor position Heinrich Schuchardt
@ 2018-07-05  6:18 ` Heinrich Schuchardt
  2018-07-05 11:46   ` Alexander Graf
  3 siblings, 1 reply; 6+ messages in thread
From: Heinrich Schuchardt @ 2018-07-05  6:18 UTC (permalink / raw)
  To: u-boot

Implement the reset service of the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.

This should resolve the error reported by the SCT in
Protocol/SimpleTextOut/BlackBoxTest/SimpleTextOutBBTestFunction_uefi.c:639

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 lib/efi_loader/efi_console.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console.c
index 3fd0d2fd51..17aced86a5 100644
--- a/lib/efi_loader/efi_console.c
+++ b/lib/efi_loader/efi_console.c
@@ -110,7 +110,15 @@ static efi_status_t EFIAPI efi_cout_reset(
 			char extended_verification)
 {
 	EFI_ENTRY("%p, %d", this, extended_verification);
-	return EFI_EXIT(EFI_UNSUPPORTED);
+
+	/* Clear screen */
+	printf(ESC "[2J");
+	efi_con_mode.cursor_column = 0;
+	efi_con_mode.cursor_row = 0;
+	/* Set default colors */
+	printf(ESC "[0;37;40m");
+
+	return EFI_EXIT(EFI_SUCCESS);
 }
 
 static efi_status_t EFIAPI efi_cout_output_string(
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH 4/4] efi_loader: EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.Reset()
  2018-07-05  6:18 ` [U-Boot] [PATCH 4/4] efi_loader: EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.Reset() Heinrich Schuchardt
@ 2018-07-05 11:46   ` Alexander Graf
  0 siblings, 0 replies; 6+ messages in thread
From: Alexander Graf @ 2018-07-05 11:46 UTC (permalink / raw)
  To: u-boot

On 07/05/2018 08:18 AM, Heinrich Schuchardt wrote:
> Implement the reset service of the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.
>
> This should resolve the error reported by the SCT in
> Protocol/SimpleTextOut/BlackBoxTest/SimpleTextOutBBTestFunction_uefi.c:639
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>   lib/efi_loader/efi_console.c | 10 +++++++++-
>   1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console.c
> index 3fd0d2fd51..17aced86a5 100644
> --- a/lib/efi_loader/efi_console.c
> +++ b/lib/efi_loader/efi_console.c
> @@ -110,7 +110,15 @@ static efi_status_t EFIAPI efi_cout_reset(
>   			char extended_verification)
>   {
>   	EFI_ENTRY("%p, %d", this, extended_verification);
> -	return EFI_EXIT(EFI_UNSUPPORTED);
> +
> +	/* Clear screen */
> +	printf(ESC "[2J");
> +	efi_con_mode.cursor_column = 0;
> +	efi_con_mode.cursor_row = 0;

Can this just call clear_screen()?


Alex

> +	/* Set default colors */
> +	printf(ESC "[0;37;40m");
> +
> +	return EFI_EXIT(EFI_SUCCESS);
>   }
>   
>   static efi_status_t EFIAPI efi_cout_output_string(

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-07-05 11:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-05  6:17 [U-Boot] [PATCH 0/4] efi_loader: text protocols Heinrich Schuchardt
2018-07-05  6:17 ` [U-Boot] [PATCH 1/4] efi_loader: set revision in loaded image protocol Heinrich Schuchardt
2018-07-05  6:17 ` [U-Boot] [PATCH 2/4] efi_loader: EFI_SIMPLE_TEXT_INPUT_PROTOCOL.Reset() Heinrich Schuchardt
2018-07-05  6:18 ` [U-Boot] [PATCH 3/4] efi_loader: clear screen has to reset cursor position Heinrich Schuchardt
2018-07-05  6:18 ` [U-Boot] [PATCH 4/4] efi_loader: EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.Reset() Heinrich Schuchardt
2018-07-05 11:46   ` Alexander Graf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.