Make sure handle_smi() and handle_smp() are compiled out if not enabled.

Add CONFIG_ checks around the handle_smi/handle_smp functions.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Remove the TODO file.

The TODO file hasn't been updated in years and the info in it is stale.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Abstract reset call (and possible 16bit mode switch) into reset() function.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
build: Remove unused function getSectionsStart() from layoutrom.py.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
build: Extract section visiting logic in layoutrom.py.

Extract out the logic that visits all reachable sections into new
function findReachable().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
build: Refactor layoutrom.py gc() function.

Eliminate the per-section 'keep' variable - the list of sections that
will be emitted is sufficient to track that state.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
build: Use customized entry point for each type of build.

Set an appropriate elf entry point (entry_elf, entry_csm,
reset_vector) for each type of build (coreboot, csm, qemu).  Use that
entry point when determining which sections to keep.

Also, remove the '.export.' mechanism to keep a section in the final
binary - it is no longer used.

This allows the build to slightly reduce the overall size as entry_elf
is no longer needed on non-coreboot builds and entry_csm is no longer
needed on non-csm builds.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
build: Refactor findInit() function.

Push findInit() into main() and unify the category setting code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
build: Rework getRelocs() to use a hash instead of categories in layoutrom.py

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
build: Keep segmented sections separate until final link step.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
build: Use fileid instead of category to write sections in layoutrom.py.

The 'category' really determines the memory location while the
'fileid' determines which link stage the section is in.  So, use
'fileid' when writing the linker scripts.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
build: Only export needed fields in LayoutInfo in layoutrom.py.

A number of fields were exported from the layout info that weren't
used.  Don't bother exporting them.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
build: Get fixed address variables from 32bit compile pass (not 16bit)

Update the layoutrom.py build script so that fixed address sections
can come from the 32bit compiled C code.  Update the C code so that
all VAR16FIXED variables instead use the new VARFSEGFIXED which is
defined in 32bit mode.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>