Reworked version of Forth Source debugger (Mark Cave-Ayland)
[openbios.git] / kernel / stack.c
blobcb45f975a95cbe6143bffba7a61e8795a59618d1
1 /* tag: defines the stacks, program counter and ways to access those
3 * Copyright (C) 2003 Patrick Mauritz, Stefan Reinauer
5 * See the file "COPYING" for further information about
6 * the copyright and warranty status of this work.
7 */
10 #include "openbios/config.h"
11 #include "openbios/stack.h"
12 #include "cross.h"
14 #define dstacksize 512
15 int dstackcnt = 0;
16 cell dstack[dstacksize];
18 #define rstacksize 512
19 int rstackcnt = 0;
20 cell rstack[rstacksize];
22 /* Rstack value saved before entering forth interpreter in debugger */
23 int dbgrstackcnt = 0;
25 #if defined(CONFIG_DEBUG_DSTACK) || defined(FCOMPILER)
26 void printdstack(void)
28 int i;
29 printk("dstack:");
30 for (i = 0; i <= dstackcnt; i++) {
31 printk(" 0x%" FMT_CELL_x , dstack[i]);
33 printk("\n");
35 #endif
36 #if defined(CONFIG_DEBUG_RSTACK) || defined(FCOMPILER)
37 void printrstack(void)
39 int i;
40 printk("rstack:");
41 for (i = 0; i <= rstackcnt; i++) {
42 printk(" 0x%" FMT_CELL_x , rstack[i]);
44 printk("\n");
46 #endif