[OpenBIOS] [PATCH 2/8] SPARC64: introduce new Forth context stack (fcstack) for CPU contexts
Mark Cave-Ayland
mark.cave-ayland at ilande.co.uk
Sun Nov 22 19:38:38 CET 2015
The fcstack holds a stack of complete CPU states which can be used to enable
re-entrant calls into Forth (e.g. when processing interrupts).
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland at ilande.co.uk>
---
openbios-devel/arch/sparc64/context.c | 4 ++++
openbios-devel/arch/sparc64/ldscript | 5 +++++
openbios-devel/include/arch/sparc64/io.h | 2 +-
3 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/openbios-devel/arch/sparc64/context.c b/openbios-devel/arch/sparc64/context.c
index 2e76689..98932ee 100644
--- a/openbios-devel/arch/sparc64/context.c
+++ b/openbios-devel/arch/sparc64/context.c
@@ -40,6 +40,10 @@ static uint8_t image_stack[IMAGE_STACK_SIZE];
/* Pointer to startup context (physical address) */
unsigned long __boot_ctx;
+/* Pointer to Forth context stack */
+void *_fcstack_ptr = &_efcstack;
+
+
/*
* Main starter
* This is the C function that runs first.
diff --git a/openbios-devel/arch/sparc64/ldscript b/openbios-devel/arch/sparc64/ldscript
index 54288e8..c5cc6a5 100644
--- a/openbios-devel/arch/sparc64/ldscript
+++ b/openbios-devel/arch/sparc64/ldscript
@@ -50,6 +50,11 @@ SECTIONS
*(.bss.*)
*(COMMON)
+ _fcstack = .;
+ . += 32768;
+ . = ALIGN(16);
+ _efcstack = .;
+
_stack = .;
. += STACK_SIZE;
. = ALIGN(16);
diff --git a/openbios-devel/include/arch/sparc64/io.h b/openbios-devel/include/arch/sparc64/io.h
index 2e4dfa3..0f1a732 100644
--- a/openbios-devel/include/arch/sparc64/io.h
+++ b/openbios-devel/include/arch/sparc64/io.h
@@ -9,7 +9,7 @@
extern unsigned long va_shift; // Set in entry.S
// Defined in ldscript
-extern char _start, _data, _stack, _estack, _end, _iomem;
+extern char _start, _data, _stack, _estack, _fcstack, _efcstack, _end, _iomem;
// XXX check use and merge
#define phys_to_virt(phys) ((void *) ((unsigned long) (phys)))
--
1.7.10.4
More information about the OpenBIOS
mailing list