2 * support for dynamic binding from C
6 * This software is part of the SBCL system. See the README file for
9 * This software is derived from the CMU CL system, which was
10 * written at Carnegie Mellon University and released into the
11 * public domain. The software is in the public domain and is
12 * provided with absolutely no warranty. See the COPYING and CREDITS
13 * files for more information.
25 #if defined(ibmrt) || defined(__i386__)
26 #define GetBSP() ((struct binding *)SymbolValue(BINDING_STACK_POINTER))
27 #define SetBSP(value) SetSymbolValue(BINDING_STACK_POINTER, (lispobj)(value))
29 #define GetBSP() ((struct binding *)current_binding_stack_pointer)
30 #define SetBSP(value) (current_binding_stack_pointer=(lispobj *)(value))
33 void bind_variable(lispobj symbol, lispobj value)
36 struct binding *binding;
38 old_value = SymbolValue(symbol);
42 binding->value = old_value;
43 binding->symbol = symbol;
44 SetSymbolValue(symbol, value);
49 struct binding *binding;
52 binding = GetBSP() - 1;
54 symbol = binding->symbol;
56 SetSymbolValue(symbol, binding->value);
63 void unbind_to_here(lispobj *bsp)
65 struct binding *target = (struct binding *)bsp;
66 struct binding *binding = GetBSP();
69 while (target < binding) {
72 symbol = binding->symbol;
75 SetSymbolValue(symbol, binding->value);