Be a bit more strict about what is accepted into mainline by building
with -Werror set for gcc builds.
Clang builds will get the same treatment soon.
Also turn off some ubsan compiles for some of the older arches where
there's very little value (and it probably doesn't work anyway).
Mostly from the use of ssize_t which does not play well with printf and
32bit arches on LK for underlying type reasons that haven't really ever
been sorted out properly.
The test inside riscv/rules.mk was assuming gcc and that the CC variable
isn't passed in from the user. This is not a very clean solution and
acts like a bandaid over the problem. Added some todos for a potential
solution.
Mostly dealing with comparing a pointer variable that is declared
nonnull, which I find to be a dubious warning but is pretty safe in this
case since the compiler will be more aggressive about the nullness of
the arguments.
This will boot a list of qemu emulated devices with the option to run
all of the unittests at boot.
Will be automatically enabled on the build servers soon which will fail
any pending CLs if it breaks.
This will cause the system to automatically run all of the unit tests
after a short pause on boot. Will be used by an automatic test script.
At the moment there aren't a lot of unit tests in the list, but this
should greatly increase the utility of them since they'll be
automatically run.
Have the unit tests for the FAT driver fail a bit more gracefully if the
test device is not present, to make it somewhat easier to live with this
driver present with systems a way to mount a test volume.
Most of the functions for this was declared in a top level lk/ include
space, so go ahead and move it there.
A few exceptions:
- Moved spin() over to platform/time.h and platform/time.c since the
function more logically belongs to platform/time.h. Any users of
spin() will need to update their headers to include platform/time.h
instead.
- Renamed spin_cycles() to arm_cm_spin_cycles() and moved over into
arm/cm.h since it is currently defined in arch/arm-m and only used for
targets that implicitly are for arm-m.
While waking up all threads from wait-queue, order should
start from tail to maintain correct scheduling sequence.
Signed-off-by: Mahavir Jain <mahavirpj@gmail.com>
Not exactly what we want but avoids the lapic code needing the per cpu
structures which aren't set up without SMP support.
Consider leaving the percpu structure in, just only support for cpu 0.
This fixes trying to boot the X86_LEGACY build on a machine with a local
apic.
Doesn't do much but provided the detection path for it and ability to
hold initialized state. The higher level platform code is going to need
to use it directly so will mostly just provide an api for access to it.
Moved ACPI sniffing back to just after the VM is initialized instead of
all the way into platform_init(). This should try to ensure that all
drivers that come up afterwards will have ioapics discovered in case
future development tries to enable and use them, kicking the machine out
of virtual-wire-mode.
I have a bulldozer machine here that curiously starts the APIC IDs for
the cpus at 16 and counts up.
This is a problem since the current code assumes that the boot cpu is 0,
and would try to start itself (apic id 16) later because it thought it
was the first secondary. Fix this by re-reading the APIC id on the boot
cpu and patching the percpu structure a bit into boot. Kinda a hack but
avoids having to detect the APIC, find the type of ID to read, etc.
Also means that practically speaking the system is using the full 32bit
APIC IDs if that feature is present, since now the local apic id is
entirely read from the local apic as it should be (if present).
Fixes#475
OEMs may want to override certain bio functions, hence mark
`open_block_device` and `open_async_block_device` as WEAK. This allows
OEMs to customize any of the bio functions
Forgot to expand the variable in the call to the TOBOOL function which
would cause the result to always be true. In this case always resulted
in the test code for these three modules to be included.
No real functional change except how the smaller ARCH_DEFAULT_PAGE_SIZE
is now computed and set in defines.h instead of rules.mk for arch/arm to
be consistent with the other arch that has a large/small build (riscv).
Not enabled by default, but if you want to use this one for now while
things are stabilized feel free. Going to move off astyle since this
seems to be superior now (wasn't always).
Also switched scripts/codestyle to use clang-format
ssize_t is annoying with formatting, since %zd doesn't really know how
to match it, so the usual strategy is to use %ld, since ssize_t is
always defined as a signed long on LK.
The platform_watchdog_ methods are optional features that the target
platform can choose to implement.
If they are implemented, then BootService.SetWatchdogTimer() would call
them to setup the hardware watchdog.
If they are not implemented (for example presubmit targets), then
BootService.SetWatchdogTimer() would test the WEAK symbol against a NULL
pointer and error out.
To use BootService.SetWatchdogTimer(), platforms can choose to either
implement platform_watchdog_init and platform_watchdog_set_enabled, or
override the entire BootService.SetWatchdogTimer() method.
GBL debug target will use GetVariable to get a variable called
gbl_debug. If the variable exists, it waits for the gdb to be started.
Signed-off-by: Ying-Chun Liu (PaulLiu) <paulliu@debian.org>