Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
This reverts commit 9c7906d8ad6ebec014b22b8757d916e9cad7d6d3.
|
|
|
|
This makes sure symbols referenced by assert uses may not be generated
if unused. The recently introduced __unused macro is used to suppress
compiler warnings resulting from this change.
|
|
|
|
|
|
|
|
|
|
Move the page properties into the new x86/page module, and the virtual
memory layout macros into the x86/pmap module.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This module is likely to do more than provide multi-processor information.
|
|
This turns assert.h into a standard header.
|
|
|
|
In particular, the pic and ioapic modules register their respective
devices as interrupt controllers. Selection between the legacy XT-PIC
and the modern APIC system is made on the availability of ACPI,
disregarding the multiprocessor specification entirely. The uart
driver is also updated to register devices interrupt handlers.
|
|
|
|
The mb module has never been well defined, and has become irrelevant now
that the kern/atomic module has been introduced. Phase it out until the
need for non-SMP memory barriers rises.
|
|
|
|
Make kernel code obtain definitions for the printf family of functions
through the inclusion of the standard stdio.h header.
|
|
The printk functions are close enough to the printf ones to bear the
same names.
|
|
|
|
Instead of mixing standard headers and internal redefinitions of standard
types, completely rely on the compiler for what is guaranteed for a free
standing environment. This results in the removal of kern/stddef.h and
kern/stdint.h. The kern/types.h header is reintroduced for the different
(and saner) purpose of defining types not specified in standard C,
namely ssize_t for now.
|
|
This is mostly done for the machine-independent part.
|
|
This change was done using astyle, with a few manual editing here and
there.
|
|
|
|
This module is probably the most impacted by the direct physical
mapping.
First, it establishes the direct physical mapping before paging is
enabled, and uses the largest available page size when doing so.
In addition, the recursive mapping of PTEs is removed, since all
page table pages are allocated from the direct physical mapping.
This changes the way mapping requests are processed.
The ability to access any page table page at any time removes the
need for virtual addresses reserved for temporary mappings.
Since it's now perfectly possible to return physical address 0 for
a kernel mapping, change the interface of the pmap_extract function
and rename it to pmap_kextract to stress the fact that it should
only be used for kernel mappings.
|
|
|
|
While not technically a mistake, it's part of the (not yet explicit)
coding rules not to compare pointers to zero.
|
|
|
|
Make functions accept and return pointers instead of integers. Most
users of the kernel allocator directly use the returned addresses.
Pointers make that more practical.
|
|
|
|
Provide cross-processor function calls.
|
|
|
|
The cpu_cpuid wrapper used unsigned long integers to store register
content, although the CPUID instruction uses 32-bits integers in all
modes. This was leading to a corruption of the cpu structures. Fix
by using unsigned int integers instead.
|
|
- Move declarations and definitions that are really private into cpu.c.
- Use __always_inline where appropriate, not systematically.
- Fix headers and comments.
|
|
Relocating percpu data is actually tricky, for the same reason relocating
memory in general is. There may be pointers to such variables which then
become invalid. Instead, keep using the percpu section as the percpu area
for the BSP and store the content of the percpu section in dedicated
kernel virtual memory. In addition, remove the notification kludge from
the x86 cpu module.
|
|
- declare CPU descriptors as percpu variables
- make the percpu segment register point to the percpu area instead of
the CPU descriptor
- remove the ugly accessors for the local CPU descriptor, pmap and TCB
and use percpu variables for them instead
- implement the cpu_local accessors as described in the percpu
documentation
|
|
Introduce proper per-CPU variables.
Such support becomes necessary as more statically allocated per-CPU data
are added to the kernel.
|
|
|
|
Commit bc7c779bc15d6a47b785478fa1fd9505662761a9 removed support for
legacy multiprocessor specification, but also messed up error handling
on ACPI MP setup failure, leading to a situation where the system would
start with one processor but without a local APIC.
In addition, fix handling of buggy BIOSes exporting the same tables
multiple times.
|
|
|
|
Use a global checkpoint identifier as a generation counter and remove
reset interrupts.
For some reason I can't remember, using reset interrupts was thought to
be more efficient, perhaps because accessing a global variable on each
checkpoint looked expensive. But it's really not scalable, and a
read-mostly global variable can get cached locally and not incur expensive
access.
In addition, add a decent amount of documentation about the semantics
with regard to the rest of the system. Explicitely state that checkpoints
are triggered by context switches and that it's not allowed to block
inside read-side critical sections. Make periodic events attempt to trigger
checkpoints too. Add a thread-local read-side critical section nesting
counter so that it can be reliably determined whether the processor is
running a read-side critical section or not.
|
|
The main goal of this change is to reduce the size of the kernel
executable image since boot stacks, despite being uninitialized,
aren't declared as common symbols.
|
|
|