Commit Graph

10 Commits

Author SHA1 Message Date
Martin Whitaker
4078b7760e Faster barrier implementation.
The old barrier implementation was very slow when running on a multi-socket
machine (pcmemtest issue 16).

The new implementation provides two options:

  - when blocked, spin on a thread-local flag
  - when blocked, execute a HLT instruction and wait for a NMI

The first option might be faster, but we need to measure it to find out. A
new boot command line option is provided to select between the two, with a
third setting that uses a mixture of the two.
2022-02-28 22:05:21 +00:00
Martin Whitaker
f8b82eb0bd Exclude copyright notices from Doxygen file descriptions. 2022-02-19 19:56:55 +00:00
Martin Whitaker
76adad2fe6 Add ability to generate internal API documentation using Doxygen. 2022-02-19 16:17:40 +00:00
Martin Whitaker
dcac527068 Don't make assumptions about usable memory.
When using a legacy BIOS, the memory regions used by the BIOS are well
defined. This is not the case when using a UEFI BIOS. So include the
stack area in the BSS so the loader knows how much memory to allocate,
and check we have space to relocate the program to either low or high
memory.

There are still some assumptions in the USB driver code that need to
be fixed.
2022-02-02 12:20:39 +00:00
Martin Whitaker
4100a44b12 Properly protect the startup stack with a mutex.
Because we start the APs sequentially, it is unlikely they will coincide
for the brief period that they use the temporary startup stack, but we
should guard against it. This allows us to remove the mutex around the
restart of each AP when relocating, which should improve test times.
2022-01-31 21:54:24 +00:00
Martin Whitaker
c5e9fa4e18 Increase maximum number of APs to 256. 2022-01-29 16:13:05 +00:00
Martin Whitaker
fe4374e818 Allocate the main program stacks after the loaded program.
After we relocate the program, we restart it. So there is no need to copy
over the old stack contents. This allows us to increase the maximum number
of APs without a run time overhead. The maximum number of APs will still
be limited by the size of low memory.
2022-01-29 15:17:00 +00:00
Martin Whitaker
0aa1b1fa97 Rearrange stack space to reduce memory footprint.
The BSP only needs extra stack space during program initialisation. The APs
aren't running at that point, so by positioning the BSP stack above the AP
stacks, it can extend down into the AP stack space without causing any
problems.
2022-01-09 21:25:16 +00:00
Martin Whitaker
cae4ffa636 Add missing header include. 2020-05-30 10:55:34 +01:00
Martin Whitaker
fbd3376668 Initial commit. 2020-05-24 21:30:55 +01:00