diff mbox

[U-Boot,v2,57/63] x86: Add a dummy setjmp implementation for x86_64

Message ID 1479587152-25065-58-git-send-email-sjg@chromium.org
State Accepted
Commit c780069f1e3ff6a6613a1aaae5668a35164532c7
Delegated to: Bin Meng
Headers show

Commit Message

Simon Glass Nov. 19, 2016, 8:25 p.m. UTC
We don't have the code for this yet. Add a dummy version for now, so that
EFI builds correctly.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v2:
- Add the 'val' parameter to longjmp()

 arch/x86/cpu/x86_64/Makefile |  2 +-
 arch/x86/cpu/x86_64/setjmp.c | 20 ++++++++++++++++++++
 2 files changed, 21 insertions(+), 1 deletion(-)
 create mode 100644 arch/x86/cpu/x86_64/setjmp.c

Comments

Bin Meng Jan. 14, 2017, 1:32 p.m. UTC | #1
On Sun, Nov 20, 2016 at 4:25 AM, Simon Glass <sjg@chromium.org> wrote:
> We don't have the code for this yet. Add a dummy version for now, so that
> EFI builds correctly.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
> Changes in v2:
> - Add the 'val' parameter to longjmp()
>
>  arch/x86/cpu/x86_64/Makefile |  2 +-
>  arch/x86/cpu/x86_64/setjmp.c | 20 ++++++++++++++++++++
>  2 files changed, 21 insertions(+), 1 deletion(-)
>  create mode 100644 arch/x86/cpu/x86_64/setjmp.c
>

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
diff mbox

Patch

diff --git a/arch/x86/cpu/x86_64/Makefile b/arch/x86/cpu/x86_64/Makefile
index 4b06386..400f0ff 100644
--- a/arch/x86/cpu/x86_64/Makefile
+++ b/arch/x86/cpu/x86_64/Makefile
@@ -3,4 +3,4 @@ 
 # Written by Simon Glass <sjg@chromium.org>
 #
 
-obj-y += cpu.o interrupts.o
+obj-y += cpu.o interrupts.o setjmp.o
diff --git a/arch/x86/cpu/x86_64/setjmp.c b/arch/x86/cpu/x86_64/setjmp.c
new file mode 100644
index 0000000..25f8d28
--- /dev/null
+++ b/arch/x86/cpu/x86_64/setjmp.c
@@ -0,0 +1,20 @@ 
+/*
+ * Copyright (c) 2016 Google, Inc
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/setjmp.h>
+
+int setjmp(struct jmp_buf_data *jmp_buf)
+{
+	printf("WARNING: setjmp() is not supported\n");
+
+	return 0;
+}
+
+void longjmp(struct jmp_buf_data *jmp_buf, int val)
+{
+	printf("WARNING: longjmp() is not supported\n");
+}