mirror of
https://gitlab.com/qemu-project/openbios.git
synced 2024-02-13 08:34:06 +08:00
Commit more readable version of obp_fortheval_v2 as posted to the mailing list, plus increase the default client image stack
size on SPARC32 to help Solaris 8 boot. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@919 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
committed by
Mark Cave-Ayland
parent
d92b811c6e
commit
d0b1458780
@@ -11,7 +11,7 @@
|
|||||||
#include "openbios.h"
|
#include "openbios.h"
|
||||||
|
|
||||||
#define MAIN_STACK_SIZE 16384
|
#define MAIN_STACK_SIZE 16384
|
||||||
#define IMAGE_STACK_SIZE 4096*2
|
#define IMAGE_STACK_SIZE 4096*4
|
||||||
|
|
||||||
#define debug printk
|
#define debug printk
|
||||||
|
|
||||||
|
|||||||
@@ -424,41 +424,30 @@ int obp_cpuresume(__attribute__((unused)) unsigned int whichcpu)
|
|||||||
|
|
||||||
void obp_fortheval_v2(char *str, int arg0, int arg1, int arg2, int arg3, int arg4)
|
void obp_fortheval_v2(char *str, int arg0, int arg1, int arg2, int arg3, int arg4)
|
||||||
{
|
{
|
||||||
int pusharg = 0;
|
int dstacktmp = 0;
|
||||||
|
|
||||||
// It seems Solaris passes up to 5 arguments which should be pushed onto the Forth
|
// It seems Solaris passes up to 5 arguments which should be pushed onto the Forth
|
||||||
// stack for execution. However the API doesn't provide for a way to pass the number
|
// stack for execution. However the API doesn't provide for a way to specify the number
|
||||||
// of arguments actually passed. Hence we start at arg4 and then starting from the
|
// of arguments actually being passed. Hence we preserve the state of the Forth stack
|
||||||
// first non-zero argument, we push all subsequent arguments onto the stack down to
|
// before, push all the arguments, execute the Forth, then restore the stack to its
|
||||||
// arg0.
|
// previous state. This enables us to have a variable number of arguments and still
|
||||||
|
// preserve stack state between subsequent calls.
|
||||||
|
|
||||||
|
// Preserve stack state
|
||||||
|
dstacktmp = dstackcnt;
|
||||||
|
|
||||||
if (arg4) {
|
|
||||||
PUSH(arg4);
|
PUSH(arg4);
|
||||||
pusharg = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (arg3 || pusharg == 1 ) {
|
|
||||||
PUSH(arg3);
|
PUSH(arg3);
|
||||||
pusharg = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (arg2 || pusharg == 1) {
|
|
||||||
PUSH(arg2);
|
PUSH(arg2);
|
||||||
pusharg = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (arg1 || pusharg == 1 ) {
|
|
||||||
PUSH(arg1);
|
PUSH(arg1);
|
||||||
pusharg = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (arg0 || pusharg == 1) {
|
|
||||||
PUSH(arg0);
|
PUSH(arg0);
|
||||||
}
|
|
||||||
|
|
||||||
DPRINTF("obp_fortheval_v2(%s)\n", str);
|
DPRINTF("obp_fortheval_v2(%s)\n", str);
|
||||||
push_str(str);
|
push_str(str);
|
||||||
fword("eval");
|
fword("eval");
|
||||||
|
|
||||||
|
// Restore stack state
|
||||||
|
dstackcnt = dstacktmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *
|
void *
|
||||||
|
|||||||
Reference in New Issue
Block a user