| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
|
|
| |
The FUNCFSEG macro was introduced to force a C function into the
f-segment. This was needed for some C functions that used inline
assembler that contained some 16bit code. Instead of forcing the
entire C function into the f-segment, just force the small subset of
inline assembler into the f-segment.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
| |
Add support for a FUNCFSEG macro that will force a "32bit flat" C
function to be located in the f-segment. This is useful for 32bit
code with inline assembler that thunks to 16bit mode.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
The segoff_s definition is used by a number of header files that would
not otherwise need farptr.h, so move it to a more central location.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
| |
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
|
| |
Add a build check to verify certain variables are only reachable via
the 32bit "init" code. This can be used as a mechanism to enforce
certain data (and code that accesses that data) as only available
during POST.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
|
| |
Since the final location of the "varlow" variables are known at build
time, link the final locations into the binary during the build. The
16bit code was already done at link time - update the build so the
32bit code is also done at link time.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
|
|
|
| |
Convert all users of the alternative variable exports to VARFSEG.
There isn't a significant distinction between the existing types of
exports, so it's simpler to just use one type going forward.
The new VARFSEG declaration is only emitting when in 32bit mode, so
update and move some variables as needed.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
| |
Introduce a variable declaration that will force variables (that are
compiled in 32bit mode) to be emitted into the f-segment.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
|
| |
Rename datalow_base (and similar) to zonelow_base, and datalow_start
(and similar) to varlow_start. This helps distinguish between the
bounds for the runtime dynamic memory pool and the compile time global
variables.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
| |
Use 'lo' to mean the low bits and 'hi' to mean the high bits of a
64bit value.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
| |
Since SeaBIOS has been updated to use "_cfuncx_" prefixes when calling
cross-mode C functions, there is no reason to restrict an exported C
function to only the given mode.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a mechanism (VARLOW declaration) to make a variable reside in the
low memory (e-segment) area. This is useful for runtime variables
that need to be accessed from 16bit code and need to be modifiable
during runtime.
Move the 16bit "extra stack" from the EBDA to the low memory area
using this declaration mechanism. Also increase the size of this
stack from 512 bytes to 2048 bytes.
This also reworks tools/layoutrom.py a bit.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The compiler can get confused when referencing a C function in a
different mode. (It reasonably assumes that the C function in the
current mode is desired.) To avoid this compiler confusion, introduce
symbol prefixes (_cfunc16_, _cfunc32flat_, _cfunc32seg_) that must be
used on C function symbols that are referenced from other compilation
modes.
This makes it less likely compiler confusion will occur. It will also
makes it easier to implement and use vtable like operation structures.
|
|
|
|
|
|
|
|
| |
Enhance tools/layoutrom.py code so that it can detect which sections
are used from the "32bit flat" runtime code. All other "32bit flat"
sections can then be assured to be initialization code only.
This is in preparation for relocating the 32bit initialization code.
|
| |
|
|
|
|
|
| |
Moving the ebda while an optionrom is running could confuse it. So,
avoid doing that.
|
|
|
|
|
|
|
|
|
|
| |
Reduce the need for placing #if guards around functions that are
marked as VISIBLE in another code chunk by declaring the functions as
"weak" when they are not needed.
It's still necessary to ensure that no C code references the data from
a different chunk (or an -fwhole-program compile might try to keep a
local reference).
|
|
|
|
| |
Omitting "void" leads to a K&R style declaration which was not intended.
|
|
|
|
|
|
| |
Force functions intended for other code segments to be discarded
during link - this will cause a link error if it used.
Clean up rom layout code to ensure discarded sections are not used.
|
| |
|
|
|
|
|
|
|
|
|
| |
Create a new code blob (code32seg) with support for 32bit functions
that need to utilize explicit segment accesses.
This code blob uses global variables relative to %gs and with a
dynamic code offset (determined by get_global_offset()).
Add BIOS32 structure and code.
Add code for 32bit PCI BIOS code.
|
|
|
|
|
| |
Prepare for support of segmented 32bit code.
Add new MODESEGMENT definition, and clarify existing 32bit mode defs.
|
|
|
|
| |
Simplify and name the clock multiplier constants.
|
|
|
|
|
| |
Sometimes VAR16_32 is used to export a definition to assembler, so
clarify its naming.
|
|
|
|
|
|
| |
Fix bug where zones over 2gig may fail to allocate.
Add memalign_high() and use for acpi facs allocation.
Misc code cleanups.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Complete the initial implementation of PMM.
Default new PMM code to be enabled.
Move malloc code from memmap.c to pmm.c.
Define new malloc zones for PMM (ZoneTmpLow and ZoneTmpHigh).
Change default READ/WRITE_SEG macros to use 32bit pointers (the 16bit
PMM code use "big real" mode and requires 32bit accesses).
Allow pmm allocations to occur during bcv executions also.
Add low-memory clearing before boot.
Also, align the default f-seg memory.
|
|
|
|
|
|
|
| |
Add ASSERT16/ASSERT32 macros to farptr.h.
Use those macros in place of open-coded checks.
Add "noreturn" attribute to functions to reduce compiler warnings.
Add ASSERT32 to smp_probe() to eliminate 16bit assembler warnings.
|
|
|
|
|
|
|
|
| |
Suppress __attribute__((externally_visible)) when no -fwhole-program
Add switch hack for compilers without -fno-jump-tables
Define memcpy() function (for compilers without -minline-all-stringops).
Define call16_simpint as a macro (a param needs to be inlined).
Make sure s3_resume is only defined in 32bit mode.
|
|
|
|
|
|
|
|
|
|
|
| |
Implement -ffunction-sections and -fdata-sections in both 32bit and
16bit code.
Make sure all sections have unique names (even asm and discarded
sections).
Enhance tools/layoutrom.py script to find all sections reachable from
exported 16bit code - prune all other sections.
Mark sections with "export" if they can be visible outside of code -
these sections wont be dropped when pruning unused sections.
|
|
|
|
|
|
|
|
| |
Define macro VAR16FIXED for declaring a variable at a fixed location.
Introduce new file src/misc.c, and move non int15 calls from system.c
to it.
Implement all fixed location variables in C code.
Move IDT/GDT defs to misc.c. Remove unused gdt entry 1.
|
|
|
|
|
|
|
|
| |
The fixed offset requirements of the 16bit code can be done using
multiple sections and a linker script. Using the linker allows
for more flexibility.
Also, have the 16bit code generate sections for every function and
variable definition.
|
|
|
|
|
|
|
|
| |
Change license of contributions from Kevin O'Connor from GPLv3 to
LGPLv3 (or later). Since the work as a whole is based on Kevin's
contributions and the "bochs bios" which has a license of LGPL (v2 or
later), this effectively makes the work as a whole available under
LGPLv3 (or later).
|
|
|
|
|
|
|
| |
Rename VAR16 to VAR16_32 -- that macro supports accesses from both
16bit and 32bit mode.
Introduce a new macro VAR16 that must be present on all global
variables accessed from 16bit mode.
|
|
|
|
|
|
| |
Add VAR16 macro to enable a variable to be available in both 32bit and
16bit code. This reduces the occurrences of "#if MODE16".
Also add ASM16 macro to reduce occurrences of "#if MODE16".
|
|
|
|
|
|
|
| |
Detect a non-standard CMOS shutdown code during post and run a
separate resume handler.
Set aside space in the EBDA for the resume handler stack.
Add support for several of the code supported in bochs bios.
|
|
|
|
| |
When in 32bit mode - just define it to 0.
|
|
|
|
|
|
|
|
| |
Move acpi code from rombios32.c to acpi.c.
Move all fixed memory addresses used by the code to config.h and
consistently use a "BUILD_" prefix on the definitions.
Move some pci defs to pci.h - allows access from acpi.c and rombios32.c.
Introduce ALIGN() macro - remove old align function.
|
| |
|
|
|
|
| |
Use 64bit integers for sector and lba values.
|
|
|
|
| |
Break up some functions and play with inlining to reduce stack usage.
|
|
|
|
| |
Before, inline was enough to force inlining.
|
| |
|
|
|
|
|
|
|
| |
- Make rombios32.c to use the interger types already defined in types.h
- Add u64 typedef
Signed-off-by: Nguyen Anh Quynh <aquynh@gmail.com>
|
| |
|
|
|
|
|
|
|
|
| |
Inline alters stack usage, so don't let gcc uninline.
Also, gcc seems to include multiple copies of uninlined functions when
using -combine.
With inlining forced on, the no null check optimization causes
problems, so disable it.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds acpi, smbios, pci init, etc.
Changes from original rombios32.c code:
* Header file translation.
* Use common functions already in code (eg, outb, memset, bios_printf,
usleep)
* Implement trampoline for disabling bios shadowing (rombios32 code
actually runs in the 0xf0000 area).
* Copy asm code from rombios32start.S to an asm() statement in C
code.
|
|
|
|
|
|
|
|
| |
This reverts commit 3d029417164e9a6dffee491fb061de3de6d85595.
Conflicts:
src/post.c
|
|
|
|
|
| |
VISIBLE16 is used to mark functions externally available in 16bit code.
VISIBLE32 is for 32bit functions.
|