The smacro expansion code was virtually impossible to understand, and
was leading to very strange failures. Clean it up, and do much better
handling of magic macros. This should also allow for recursive
macros, but recursive macros are extremely tricky in that it is very
hard to keep them from recursing forever, unless there is at least one
argument which is never expanded. They are not currently implemented.
Even so, I believe token pasting makes it possible to create infinite
loops; e.g.:
%define foo foo %+
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Make the RAA infrastructure a bit cleaner, make it support 64-bit
indicies, and reduce the memory overhead of a sparse or small RAA --
the old code would allocate a *minimum* of 256K for each RAA. The new
code reduces that to 16K, and will not mandatorily allocate an entry
in the zero position.
The new shift, 11, was chosen so that a 32-bit RAA value will need 3
layers and a 64-bit value 6 layers, without excessive waste.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
RAAs can, and should be, usable for storing pointers as well as
integers. In reality it is exactly the same code, but make it explicit
by having different entry points. In the actual RAA the data is
stored as a union, which in practice will not occupy any more space
than the existing code.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Make the source code easier to understand and keep track of by
organizing it into subdirectories depending on the function.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>